core-admin/README.pvusb

96 lines
3.5 KiB
Plaintext
Raw Normal View History

2012-10-13 00:34:24 +02:00
Dedicated usbvm (optional)
~~~~~~~~~~~~~~~~~~~~~~~~~~
2012-10-10 22:43:49 +02:00
2012-10-10 23:40:16 +02:00
In dom0, once:
2012-10-10 22:43:49 +02:00
qvm-create -l red usbvm
2012-10-10 23:40:16 +02:00
2012-10-10 22:43:49 +02:00
# 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
2012-10-10 23:40:16 +02:00
2012-10-13 00:25:17 +02:00
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:
2012-10-13 00:34:24 +02:00
2012-10-13 00:25:17 +02:00
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)
~~~~~~~~~~~~~~~~~~~~~~~
2012-10-10 23:40:16 +02:00
In dom0, after each dom0 reboot:
sudo ./install-pvusb-dom0.sh
2012-10-13 00:25:17 +02:00
FIXME: merge the installer into some rpm
2012-10-10 22:43:49 +02:00
2012-10-10 23:40:16 +02:00
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}
2012-10-13 00:25:17 +02:00
FIXME: some kind of hook in dom0?
2012-10-10 23:40:16 +02:00
In usbvm, after each reboot:
2012-10-10 22:43:49 +02:00
sudo ./install-pvusb-backend.sh
2012-10-13 00:25:17 +02:00
FIXME: convert the installer into "qubes-pvusb-backend" rpm?
2012-10-10 22:43:49 +02:00
2012-10-10 23:40:16 +02:00
In appvms, after each reboot:
2012-10-10 22:43:49 +02:00
sudo ./install-pvusb-frontend.sh
2012-10-13 00:25:17 +02:00
FIXME: convert the installer into "qubes-pvusb-frontend" rpm?
List
~~~~
2012-10-10 22:43:49 +02:00
2012-10-13 00:25:17 +02:00
In dom0:
qvm-usb -l
2012-10-13 00:25:17 +02:00
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)
2012-10-11 01:08:49 +02:00
2012-10-10 22:43:49 +02:00
Attach
~~~~~~
In dom0:
2012-10-13 00:25:17 +02:00
qvm-usb -a [--no-auto-detach] <vm-name> <device-vm-name>:<backend-controller>-<backend-port>
2012-10-10 22:43:49 +02:00
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
~~~~~~~~~~~~
2012-10-13 00:34:24 +02:00
List/attach/detach operations seem to work ok, devices are recognized by the target VM etc. But actual usage of the attached devices is unstable at best. In fact the only working device I saw was one USB stick (and this only after it took a minute to time out and reset the bus couple times). Kernel crashes are normal as well. I have not investigated these issues yet, I had similar experience with Marek's scripts.
2012-10-13 00:25:17 +02:00
* The content of backend/vusb does not get cleaned on domain shutdown (?)
2012-10-10 22:43:49 +02:00
* System keyboard / mouse are listed and can be detached away
2012-10-10 23:40:16 +02:00
* Virtual USB devices (ones created by PVUSB frontend) may be listed
* The installation/configuration is not persistent, not retained between reboots
2012-10-13 00:25:17 +02:00
* 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)
2012-10-13 00:25:17 +02:00
* 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.
2012-10-10 22:43:49 +02:00