USB devices are more and more present and in use within organizations. Nowadays, plugging in a usb device on a physical computer running Windows or Linux is a breeze. This operation has becomed quite common. Time to time, when working with virtual machines, you might need to present a USB device inside the virtual machine. With virtualization software such as Vmware or MS Virtual pc, you could connect an USB device to the host machine and make it available as a USB device inside the virtual machine. All major virtualization software providers are offering this USB pass-through capability. I was wondering if Proxmox VE would be offering such capabilities.
After some research, I found out that the Linux virtualization solution “KVM” was providing the usb pass-through capabilities. Cool ! Proxmox ve is based on KVM technology thus there is a chance that this function is integrated within the Proxmox VE solution. After some tests, I was kind of frustrated by the results. Yes, KVM/Proxmox VE support usb pass-through but with some important limitations (for me at least).
Configuring USB Pass-through in Proxmox VE (out-of-the-box solution)
I have made some tests in my test environment. The server was runnning Proxmox VE 1.8. There no options available within the web gui to configure usb pass-through so far. You will need to perform some configuration actions from the command line. I’ve mainly tests usb pass-through against Windows KVM guests virtual machines. I’ve not test the feature against Linux but I’m assuming that the procedure should be similar.
So, you wanna use USB devices within your virtual machine…. Just perform the following steps :
Step 1 : Plug your USB device on the Proxmox VE host
Step 2 : We need to find out the Vendor/Device ID of the usb device you are about to present to a virtual machine.
To find this information, you will simply type the following command from the console (or you can use a ssh session)
The screenshot below shows the results returned by the command. In my situation, I have plugged a Kingston USB Device with the following numbering. 13fe:3600
Click to Enlarge picture
Step 3 : configure the virtual machine to use the USB Device
In this step, you have to tell your virtual machine that a usb port is available. To change this, you would simply issue the following command
qm set <VMID> -hostusb 13fe:3600.
This command will add a line at the end of the configuration file for the Virtual machine. You can run this when the machine is turned on or turned off. However, in order to have the changes applied, you will need to stop and then restart the virtual machines.
Note: You can edit the configuration file of the virtual machines and manually add the information related to the usb port. The config file of the virtual machines are all located in the following directory /etc/qemu-server. You can open it and edit it as needed. For example, if you want to enable usb support, you would edit the confiugration file and add the following information : hostusb:xxxx:xxxx.
Click to Enlarge picture
Step 4 : Boot your virtual machine and check that the USB device is present
The following screenshot show you the the USB device is indeed presented to the virtual machine.
Click to Enlarge picture
Step 5 : Enabling automount feature (optional)
With the current configuration, the virtual machine will only recognize the usb device that you have defined in your configuration file. Moreover, the settings will be persistent. Based on some KVM documentation, it’s possible to configure a simili automount feature. In order words, the virtual machine can detect when the usb device is plugged in and removed. To configure this option, you simply need to specify the Vendor ID and no device ID. In other words, instead of typing qm set <VMID> -hostusb xxxx:yyyy, you would type something like qm set <VMID> -hostusb 13fe:*
Using this notation, you will be able to have your virtual machine detecting when the usb device is plugged in or not.
1. No Migration of Virtual machine configured to use usb ports
Based on the qm manual documentation (on the proxmox ve wiki), when you enable the hostusb option, you will basically grant direct access to the host hardware and thus make migration of virtual machines not possible. If you have to use this option, keep that in mind.
2. No concurrent access to the use usb ports
In other words, this means that only one virtual machine at a time will have access to the usb device. If you have 2 virtual machines configured to use the usb port, both machine will see the device (within Windows Explorer) but only one will have the ownership of the device. Thus, only this virtual machine will be able to use the usb device.
3. Supported Windows Operating System Family
So far, we have seen that the usb pass-through is available and seems to work. However, you have to know that this functionality is working (and quite well actually) only with the following operating systems :
- Windows XP (32/64 bit)
- Windows 2003 (32/64 bit)
- Linuxdistribution (I’ve not test it yet but we assume that this is working)
I’ve tried to perform the same configuration on a Windows 2008 R2 virtual machine and the results were not really satisfactory. The usb port is detected by the virtual machine but the usb device is never mounted in the virtual machine. I’ve got this error message : The device cannot start. (see screenshot below)
Click to Enlarge picture
This is for me a important limitations. If you are mainly working with “legacy” version of Windows Operating system, you are fine and you can use the out-of-the-box solution provided here. If you are like me, you are exclusively working with Windows 2008 R2 (and coming new versions) and you cannot use this tip.
To overcome this limitation, you can always try to use another option : USB over IP technology
USB over IP Approach
Usb over IP technology basically allows you to connect a usb device on a host machine and share it through your IP network. Because the usb pass-through feature is not yet “ready to use”, Proxmox VE wiki web site is describing a way to implement USB over IP based on an partially free software. I have not tested it yet but if you are interested, you can have a detailed step by step procedure here
I’ve been testing another usb over IP option : the open source usbip project.
I have downloaded and installed the software on a physical linux machine and start playing around with this utility . The tool is working as expected against windows 2003 operating systems. But again, big disappointment when trying from the Windows 2008 or later operating systems : it simply fails. Funny enough, the error message I’m receiving is exactly the same…device cannot start.
USBIP project could provide a really interesting open source alternative for USB over IP technology. I hope that the project team will continue their work and make available soon a working and stable version of the software that will be compatible with Windows 2008 R2operating system.
I’m kinda frustated now because yes, Proxmox VE can “out-of-the-box” use usb pass-through capabilities but only against Windows 2003 operating system. If you try with Windows 2008 and later, the usb device will not be accessible within your virtual machine. At the moment of writing, the only real alternative would be to use usb over IP technology. USBIP project could have been the way to go but the software is not really working with WIndows 2008 operating system Family.
If you really need usb pass-through technology (whatever the operating system), you will need to invest some money and read this step by step procedure provided by the Proxmox VE team
Till next time
- Proxmox VE Wiki & Proxmox VE Forums
- USBIP Project