USB passthrough in Proxmox

Intro

Sometimes you might need the use of USB devices directly on your virtual machines. In Proxmox this is just a few clicks away. The only trouble I have noticed is that I have to reboot the VM for the changes to be activated doing this. In a homelab that is usually a minor issue, but if you are running any services, you do not wish to stop on that VM it can be an inconvenience.

Video

How

  1. In the Server View, Click the desired VM.
  2. Click Hardware, on the menu to the right.
  3. Click Add
  4. In the dropdown menu click USB Device
  5. Here you can select the device you wish to pass through. There are three methods for you to choose from here.
    • Spice Port: Spice standing for "Simple Protocol for Independent Computing Environments". To use this, you have to configure it first.
    • Use USB Vendor/Device ID: Once a USB device is connected you should be able to see it here and select it for passthrough.
    • Use USB Port: This will connect a specific port to the VM. When a device is controlled by Proxmox, something can get lost. Passing the port through to the VM gives it full control of whatever is connected.
    • Use USB3: If it is checked there is no need to uncheck it. Can be used to force devices to run as USB2 instead.
  6. Click add when the device is selected.

If the device ID shows up in orange, you will have to reboot the VM for it to be passed to it. This can happen even if hotswap is enabled for USB. To be safe, the reboot should be done from Proxmox. If done from inside the VM, proxmox might not recognize that it has been done.

As long as the device ID is black you should be able to use it inside the VM.

Uses for it

  • USB drive: If you have not set up the networking side of filesharing it can be a quick and straightforward way to transfer data.
  • Camera: For my part, running less than enterprise grade equipment it can be practical to check the camera if I cannot connect to a machine. Unless the machine with the camera VM goes down of course.
  • USB network: Sometimes it can be useful for a VM to have direct access to your network directly or even access to the WLAN.
  • Octoprint: With the prices of Raspberry PI's being as they are these days why not virtualize Octoprint so you can control you 3D printer via the network instead of using SD cards.

Translations: