Remove USB passthrough devices

Darren

New Member
Jul 28, 2016
21
1
1
48
A couple of things:

1) The older USB passthrough instructions on the wiki will cause some hosts to crash (I followed the instructions entitled "Simple Way: pass the USB device ID to the guest" and my host crashed when I powered down the VM in the final step). I ended up using the instructions entitled "Assign Devices to an already Running VM", which probably should be first on the list since most people won't have the opportunity to power off their VM to begin with). There should be better warnings here.

2) Now that I've passed the USB through to the VM, I've spent some hours in trying to remove the passthrough devices with no success. Is this not possible?
 
to 1) what kind of device are you passing through ?
if you do "qm set ID -usb0 xxxx:xxxx" there will be changed nothing to the virtual machine, only when you start it again,
so this should definitely NOT crash your host

also why should people not be able to power off their vms?
every os i know "requires" a reboot *sometimes* (eg after a kernel update)

to 2)
what commands did you execute?

if you did something like
Code:
device_add usb-host,vendorid=0x058f,productid=0x6387

but without specifiying an id like this:
Code:
device_add usb-host,vendorid=0x058f,productid=0x6387,id=usb0

you cannot remove it again AFAIK (until the vm is powered off)

if you specified an id, it should be possible to do
Code:
device_del id=usb0
 
I used the commands in the wiki for USB 3.0 under "Assign Devices to an already Running VM":

Code:
device_add nec-usb-xhci,id=xhci,addr=0x5
device_add usb-host,bus=xhci.0,vendorid=0x0480,productid=0xa007

You're saying that I need to include an identifier (id=xyz) on the second line in order to be able to remove that device?

For example:

Code:
device_add usb-host,bus=xhci.0,vendorid=0x0480,productid=0xa007
Becomes:

Code:
device_add usb-host,bus=xhci.0,vendorid=0x0480,productid=0xa007,id=mydevice
Thereby, removing it would become:

Code:
device_del id=mydevice
 
  • Like
Reactions: aasami
also why should people not be able to power off their vms?
every os i know "requires" a reboot *sometimes* (eg after a kernel update)

Passing through a USB device and upgrading kernels happen at different intervals. I work for an organization that works 24x7 on things in large groups - powering off a server is often something that needs to wait for a small window where all the time zones are mostly sleeping.