To use USB devices other than mice and storage devices it's necessary to attach the PCI USB card to another VM than sys-usb. The obvious way to do this is:
* shutdown sys-usb
* attach USB card to other VM using qubes-manager
* start the other VM
As of R3.1 rc2 this stopped working for me. When starting the VM I get this error:
--> Creating volatile image: /var/lib/qubes/appvms/usb-test/volatile.img...
--> Loading the VM (type = AppVM)...
Traceback (most recent call last):
File "/usr/bin/qvm-start", line 131, in <module>
main()
File "/usr/bin/qvm-start", line 115, in main
xid = vm.start(verbose=options.verbose, preparing_dvm=options.preparing_dvm, start_guid=not options.noguid, notify_function=tray_notify_generic if options.tray else None)
File "/usr/lib64/python2.7/site-packages/qubes/modules/000QubesVm.py", line 1876, in start
self.libvirt_domain.createWithFlags(libvirt.VIR_DOMAIN_START_PAUSED)
File "/usr/lib64/python2.7/site-packages/libvirt.py", line 1059, in createWithFlags
if ret == -1: raise libvirtError ('virDomainCreateWithFlags() failed', dom=self)
libvirt.libvirtError: internal error: libxenlight failed to create new domain 'usb-test'
This is libxl-driver.log
2016-01-15 14:04:14 CET libxl: error: libxl_pci.c:1000:do_pci_add: xc_assign_device failed: Operation not permitted
2016-01-15 14:04:14 CET libxl: error: libxl_create.c:1422:domcreate_attach_pci: libxl_device_pci_add failed: -3
When I try to start the VM anew:
--> Creating volatile image: /var/lib/qubes/appvms/usb-test/volatile.img...
--> Loading the VM (type = AppVM)...
Traceback (most recent call last):
File "/usr/bin/qvm-start", line 131, in <module>
main()
File "/usr/bin/qvm-start", line 115, in main
xid = vm.start(verbose=options.verbose, preparing_dvm=options.preparing_dvm, start_guid=not options.noguid, notify_function=tray_notify_generic if options.tray else None)
File "/usr/lib64/python2.7/site-packages/qubes/modules/000QubesVm.py", line 1868, in start
nd.dettach()
File "/usr/lib64/python2.7/site-packages/libvirt.py", line 5249, in dettach
if ret == -1: raise libvirtError ('virNodeDeviceDettach() failed')
libvirt.libvirtError: Requested operation is not valid: PCI device 0000:00:1a.0 is in use by driver xenlight, domain usb-test
Note that the PCI device is thought to be attached to the VM I actually WANT to start.
I can't even restart sys-usb without getting the same error.
1) Does anyone have an idea what's going on here?
2) Is there a (xen) way to detach a PCI device from a non running VM? Such that Qubes does not have to be rebooted after such an error?
Thanks for your help!