[qubes-users] not giving back PCI device

After assigning a USB controller to an AppVM as described in http://qubes-os.org/trac/wiki/AssigningDevices I’m stuck in a weird situation.

Even though I have shut down the AppVM that was using the USB controller and changed the AppVM’s settings to not use this PCI device, the USB controller still seems to be unavailable to Dom0 and other AppVMs.

Expected behaviour: The USB controller should be grabbed by Dom0 and made available to all running AppVMs - at the very least to all newly launched AppVMs. Is this expected behaviour or am I experiencing a bug?


This is expected behaviour to not automatically reenable device in dom0 after
VM shutdown - to not assign there all the untrusted devices just used in some
AppVM. You should be able to assign the device to some other VM.

If you still want to use the device in dom0, you can manually enable it
(commands in dom0 terminal as root):
# use your device id in place of <BDF>, for example 00:1f.2
echo 0000:<BDF> > /sys/bus/pci/drivers/pciback/unbind
MODALIAS=`cat /sys/bus/pci/devices/0000:<BDF>/modalias`
MOD=`modprobe -R $MODALIAS | head -n 1`
echo <BDF> > /sys/bus/pci/drivers/$MOD/bind