USB inf .con

hadyos

Renowned Member
Nov 9, 2008
54
0
71
How do I add USB device in .conf so that it will load automatically each time I reboot the guest OS?
 
How do I add USB device in .conf so that it will load automatically each time I reboot the guest OS?

try to edit the conf file of the VM:

Code:
nano /etc/qemu-server/VMID.conf
do you succeed?
 
What kind of prams should I edit there?

USB support is not yet finished/tested in Proxmox VE, its still on our todo list.
Pls see the KVM documentation pages in the meantime.
 
May I ask what device you want to access? What monitor command do you use currently? Maybe we can find a workaround.

- Dietmar
 
I'm trying to use an External USB disk

In qm monitor I type usb_add host:xxxx:xxxx and it works but it won't last a reboot of the guest, so I have to do it again each time I boot the guest OS.
(BTW, If I pool the USB drive out is port the all system goes dead. some kind of a kernel panic with numbers on the screen, Only hard reboot of the all system cure the problem)
 
The problem is that there is no way to uniquely identify a usb drive. As soon as you unplug/plug you have a problem. I need to talk to the qemu developers first.

- Dietmar
 
Just uploaded a fix. Please update with:

# apt-get update
# apt-get upgrade

there is a new 'hostusb' option (see man qm):

Example: to map usb device 5.2 simple do:

# qm set 777 -hostusb 5.2

Does that work for you?

- Dietmar
 
Just uploaded a fix. Please update with:

# apt-get update
# apt-get upgrade

there is a new 'hostusb' option (see man qm):

Example: to map usb device 5.2 simple do:

# qm set 777 -hostusb 5.2

Does that work for you?

- Dietmar

Excuse my ignorance, but when I plug in a USB device how can I establish the bus:address or vendor_id:product_id?

Also can you now safely remove the USB, is so what command?
thanks
 
Excuse my ignorance, but when I plug in a USB device how can I establish the bus:address or vendor_id:product_id?

You need to inspect /proc/bus/usb/devices

I consider this an 'expert-only' option ;-)

Also can you now safely remove the USB, is so what command?
thanks

# qm set 777 -hostusb ''

But add/remove only modifies the config file, so you need to restart the VM to actually change it.

- Dietmar
 
Nice, do you expect this will work generically for other non-disk devices that Linux doesn't recognize? For example, if someone had a piece of Windows software that required a stupid USB dongle for copy protection, could I use this to bring that USB dongle into the Windows KVM?
 
Ok, appreciate this is 'expert only' which iam not, but keen to test this..
So this is how far i got...
Plugged in device, and looked at /rpco/bus/usb/device
Looks like this is the one (only one usb flashdrive plugged in):-

T: Bus=01 Lev=01 Prnt=01 Port=07 Cnt=01 Dev#= 3 Spd=480 MxCh= 0
D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=0204 ProdID=6025 Rev= 1.00
S: Manufacturer=USB 2.0
S: Product=Flash Disk
S: SerialNumber=158527973750
C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA
I:* If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usbfs
E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=125us
E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms

So ... # qm set 110 -hostusb 0204:6025
Then rebooted VM, some messages within XP detecting USB flash drive but then only shows within device manager, usb controllers, USB mass storage device - shows error.
This device cannot start (Error 10)

Anything I am doing wrong?
Cheers
 
Just uploaded a fix. Please update with:

# apt-get update
# apt-get upgrade

there is a new 'hostusb' option (see man qm):

Example: to map usb device 5.2 simple do:

# qm set 777 -hostusb 5.2

Does that work for you?

- Dietmar

Is that means that it will works automatically each time I reboot the guest OS or I have to type the above command each time the guest OS is booted.
 
Well, It Works.

I can confirm that qm set XXX -hostusb XXX:XXX works.
I just tried it under an ubuntu guest OS with a USB Bluetooth adapter an it works.
I just have to test now the performance of that device under a VM.

Now if you could only release kvm-79 then I can hook my PCI video capture device, that will really be cool.

Thanks a million.
 
Reboot wont help. Instead you need to stop/start the VM.

- Dietmar

Ok, so you cannot shut down the OS (eg WinXP) - you STOP the vm then START the vm. Would this not potentialy damage the OS?

Plus the how can i establish the bus.address values...

Eg: T: Bus=01 Lev=01 Prnt=01 Port=07 Cnt=01 Dev#= 3 Spd=480 MxCh=0
Bus is listed, but what do i use for the address value?
 
Last edited by a moderator:
Ok, so you cannot shut down the OS (eg WinXP) - you STOP the vm then START the vm. Would this not potentialy damage the OS?

Why cant you shutdown your OS?

1.) shutting down WinXP should work without problems anyways.
2.) you can always login into the Guest and shutdown your OS.
3.) The hostusb option is not there to dymamically add/remove storage devices. Instead we added it to allow people to access printers or special devices like hardware dongles.

Plus the how can i establish the bus.address values...

Eg: T: Bus=01 Lev=01 Prnt=01 Port=07 Cnt=01 Dev#= 3 Spd=480 MxCh=0
Bus is listed, but what do i use for the address value?

Bus=01
Dev#= 3

So '1.3' is the value to use ;-)

- Dietmar
 
You said above you need to STOP/START the VM in order for the "qm set 110 -hostusb 0204:6025" command to be implemented. What i was saying is, does it not work if I shutdown the OS cleanly, then Start the VM.
They way I read your response was that you HAD to STOP/START the VM (IE usingf the web interface buttons) for the USB to work. I am hoping you can cleanly shutdown the OS, then simply START the VM in order to recognise the USB device (which I beleive is true). Appologies for any confusion
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!