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!
- Qubes OS v3.1 installed on Thinkpad T420 using default options
- After install, sys-net has 4 mapped devices: Ethernet Controler, Wireless adapter, USB 00:1a, and USB 00:1d. sys-net does not require the USB devices for any reason. Unmapping the USB devices from sys-net was not a problem, network was still fine. Mapping the USB devices to any AppVM domain other than sys-net however caused this issue:
Failed to start domain <domain>
0000:00:1a.0 is in use by driver xenlight, domain <domain>
This occurred even after setting pci_strictreset=false via qvm-prefs.
The resolution was to update the BIOS from Lenovo. Now that I am using the most current BIOS build (148) I am able to map the camera USB device to any AppVM and it starts successfully. The webcam is fully operational in any AppVM domain.