Go to file
2012-10-21 14:59:40 +02:00
dom0 dom0/qvm-usb: bugfix 2012-10-21 14:59:39 +02:00
misc dom0/qvm-usb: detach operation appears to work 2012-10-21 14:59:39 +02:00
network vm/network: do not fail service on failed xenstore-read 2012-10-13 11:47:32 +02:00
qrexec vm/qrexec: fix race between child cleanup and select call 2012-10-04 05:44:18 +02:00
qubes_rpc Merge branch 'hvm-for-master' 2012-10-17 21:41:03 +02:00
rpm_spec dom0/spec: add R: python-lxml for pretty print 2012-10-19 02:21:41 +02:00
test dvp/qvm-usb: ignore whitespaces when comparing output of qvm-usb tools 2012-10-21 14:59:36 +02:00
u2mfn gitignores 2011-03-23 19:57:48 -04:00
vchan win/vchan: reset the evtchn buffer in case of overflow 2012-09-16 23:32:56 +02:00
vm-init.d vm/prepare-dvm: wait for Xorg in more deterministic way (#636) 2012-07-22 01:23:45 +02:00
vm-systemd vm/systemd: force exit status 0 in qubes-sysinit 2012-10-15 02:33:36 +02:00
.gitignore gitignore files - add build products 2011-03-06 14:06:24 +01:00
install-pvusb-backend.sh dvp/qvm-usb: fixed global install script 2012-10-21 14:59:39 +02:00
install-pvusb-dom0.sh dom0/qvm-usb: detach operation appears to work 2012-10-21 14:59:39 +02:00
install-pvusb-frontend.sh dvp/qvm-usb: reworked installation scripts for usbvm and added one for appvms 2012-10-21 14:59:37 +02:00
install-pvusb-xen.tgz dvp/qvm-usb: fixed global install script 2012-10-21 14:59:39 +02:00
install-pvusb.sh dvp/qvm-usb: support multiple backend vms in the installer 2012-10-21 14:59:40 +02:00
LICENSE Added LICENSE 2010-04-05 21:21:27 +02:00
Makefile vm: kernel-placeholder package to inhibit real kernel pkg in VM (#645) 2012-07-23 23:17:50 +02:00
README.pvusb dvp/qvm-usb: updated readme 2012-10-21 14:59:40 +02:00
version_dom0 version 1.7.46 2012-09-27 11:03:26 +02:00
version_vaio_fixes sony-vaio-fixes v1.6.1 2011-07-25 01:49:07 +02:00
version_vm version 1.7.46 2012-09-27 11:03:26 +02:00

Dedicated usbvm
~~~~~~~~~~~~~~~

In dom0, once:
 qvm-create -l red usbvm

 # FIXME: use your own PCI device IDs
 qvm-pci -a usbvm 00:1d.0
 qvm-pci -a usbvm 00:1d.1
 qvm-pci -a usbvm 00:1d.2
 qvm-pci -a usbvm 00:1d.7

After each dom0 reboot:
 qvm-start usbvm

Confirm it finds all the devices

Installation (short way)
~~~~~~~~~~~~~~~~~~~~~~~~

Check install-pvusb.sh, change parameters on the top. Defaults are:
 dom0_usbvm=y # deploy pvusb backend in dom0
 usbvms="usbvm" # deploy pvusb backend in these domUs
 appvms="netvm qdvp" # deploy pvusb frontend in these domUs

Run it in dom0 (it will use sudo inside as needed):
 ./install-pvusb.sh

Installation (long way)
~~~~~~~~~~~~~~~~~~~~~~~

In dom0, after each dom0 reboot:
 sudo ./install-pvusb-dom0.sh
FIXME: merge the installer into some rpm

In dom0, after each usbvm reboot:
 usbvm_xid=`xl list | awk '($1=="usbvm"){print $2}'`
 xenstore-write /local/domain/${usbvm_xid}/qubes-usb-devices ''
 xenstore-chmod /local/domain/${usbvm_xid}/qubes-usb-devices n0 b${usbvm_xid}
FIXME: some kind of hook in dom0?

In usbvm, after each reboot:
 sudo ./install-pvusb-backend.sh 
FIXME: convert the installer into "qubes-pvusb-backend" rpm?

In appvms, after each reboot:
 sudo ./install-pvusb-frontend.sh 
FIXME: convert the installer into "qubes-pvusb-frontend" rpm?

List
~~~~

In dom0:
 qvm-usb -l

Example output:
 dom0:7-4        0718:061a TDKMedia_Trans-It_Drive_070326AE8AF92D95 (attached to qdvp:0-1)
 dom0:7-5        0b05:1706 ASUS_802.11g_WLAN_Drive (attached to netvm:0-1)
 dom0:1-1        045e:0084 Microsoft_Basic_Optical_Mouse
 usbvm:4-6       05e3:0723 Generic_USB_Storage (attached to qdvp:1-1)

Attach
~~~~~~

In dom0:
 qvm-usb -a [--no-auto-detach] <vm-name> <device-vm-name>:<backend-controller>-<backend-port>

Example:
 qvm-usb -a netvm usbvm:4-1

Detach
~~~~~~

In dom0:
 qvm-usb -d <vm-name>:<vusb-controller>-<vusb-port>

Example:
 qvm-usb -d netvm:0-1

Known issues
~~~~~~~~~~~~

* The content of backend/vusb does not get cleaned on domain shutdown (?)
* System keyboard / mouse are listed and can be detached away
* Virtual USB devices (ones created by PVUSB frontend) may be listed
* The installation/configuration is not persistent, not retained between reboots
* No debugging / logging / audit trail
* When an attached device is physically unplugged, USB port remains mapped but not displayed in the list. If device is plugged back it continues to work. Unlisted device cannot be detached.
* We are not attaching actual devices, but USB ports (different behavior from VMWare, might be confusing)
* After device is detached from the frontend and returned back to the backend it is not alwayws usable there
* Code changing configuration of pvusb fe/be and vusb bind/unbind helper are located misc/xl-qvm-usb-attach.py misc/xl-qvm-usb-detach.py misc/vusb-ctl.py. These helpers are deployed into the backend domain. The initialization code is qubesutils.py in usb_setup(), should probably also be moved into an external helper. Perhaps the functionality of these external helpers should be merged into libxl? The is one catch is invokation of vusb helper in the backend domain -- now it relies on qubes-specific API.