Remove README.pvusb and test - it is about dom0 tools
This commit is contained in:
parent
34b31c0f71
commit
ee2539a234
69
README.pvusb
69
README.pvusb
@ -1,69 +0,0 @@
|
|||||||
Dedicated usbvm (optional)
|
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
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
|
|
||||||
~~~~~~~~~~~~
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
* 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.
|
|
||||||
* After reboot attached USB devices are not listed by 'qvm-usb -l' until replugged.
|
|
@ -1,50 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
tmpf=`mktemp`
|
|
||||||
|
|
||||||
## === List
|
|
||||||
echo 'qvm-block -l'
|
|
||||||
qvm-block -l > $tmpf
|
|
||||||
|
|
||||||
cat <<'END' | diff -u - $tmpf
|
|
||||||
netvm:sda STORAGE_DEVICE () 0 B
|
|
||||||
dom0:sdb1 Cruzer () 3 GiB
|
|
||||||
dom0:sdb Cruzer () 3 GiB
|
|
||||||
END
|
|
||||||
|
|
||||||
## === Attach
|
|
||||||
echo 'qvm-block -a'
|
|
||||||
qvm-block -a work dom0:sdb | diff -u /dev/null -
|
|
||||||
|
|
||||||
## === List again
|
|
||||||
echo 'qvm-block -l'
|
|
||||||
qvm-block -l > $tmpf
|
|
||||||
|
|
||||||
cat <<'END' | diff -u - $tmpf
|
|
||||||
netvm:sda STORAGE_DEVICE () 0 B
|
|
||||||
dom0:sdb1 Cruzer () 3 GiB
|
|
||||||
dom0:sdb Cruzer () 3 GiB (attached to 'work' as 'xvdi')
|
|
||||||
END
|
|
||||||
|
|
||||||
## === Use
|
|
||||||
echo 'qvm-run work fdisk'
|
|
||||||
qvm-run -qp work 'su - root -c "fdisk -l /dev/xvdi"' > $tmpf
|
|
||||||
|
|
||||||
cat <<'END' | diff -u - $tmpf
|
|
||||||
|
|
||||||
Disk /dev/xvdi: 4022 MB, 4022337024 bytes
|
|
||||||
124 heads, 62 sectors/track, 1021 cylinders, total 7856127 sectors
|
|
||||||
Units = sectors of 1 * 512 = 512 bytes
|
|
||||||
Sector size (logical/physical): 512 bytes / 512 bytes
|
|
||||||
I/O size (minimum/optimal): 512 bytes / 512 bytes
|
|
||||||
Disk identifier: 0x3963a77b
|
|
||||||
|
|
||||||
Device Boot Start End Blocks Id System
|
|
||||||
/dev/xvdi1 * 62 7849447 3924693 c W95 FAT32 (LBA)
|
|
||||||
END
|
|
||||||
|
|
||||||
## === Detach
|
|
||||||
echo 'qvm-block -d'
|
|
||||||
qvm-block -d work dom0:sdb1 | diff -u /dev/null -
|
|
||||||
|
|
||||||
rm $tmpf
|
|
@ -1,14 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
tmpf=`mktemp`
|
|
||||||
|
|
||||||
sudo xenstore-ls -f qubes-usb-devices | sort > $tmpf
|
|
||||||
|
|
||||||
cat << 'END' | diff -u - $tmpf
|
|
||||||
qubes-usb-devices/2-1 = ""
|
|
||||||
qubes-usb-devices/2-1/desc = "046a:0021 046a_0021"
|
|
||||||
qubes-usb-devices/2-2 = ""
|
|
||||||
qubes-usb-devices/2-2/desc = "045e:0745 Microsoft_Microsoft\xc2\xae_Nano_Transceiver_v1.0"
|
|
||||||
END
|
|
||||||
|
|
||||||
rm $tmpf
|
|
@ -1,18 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
tmpf=`mktemp`
|
|
||||||
|
|
||||||
sudo xenstore-ls -f qubes-usb-devices | sort > $tmpf
|
|
||||||
|
|
||||||
cat << 'END' | diff -u - $tmpf
|
|
||||||
qubes-usb-devices/2-1 = ""
|
|
||||||
qubes-usb-devices/2-1/desc = "046a:0021 046a_0021"
|
|
||||||
qubes-usb-devices/2-2 = ""
|
|
||||||
qubes-usb-devices/2-2/desc = "045e:0745 Microsoft_Microsoft\xc2\xae_Nano_Transceiver_v1.0"
|
|
||||||
qubes-usb-devices/7-1 = ""
|
|
||||||
qubes-usb-devices/7-1/desc = "07d1:3c0a Ralink_11n_Adapter_1.0"
|
|
||||||
qubes-usb-devices/7-5 = ""
|
|
||||||
qubes-usb-devices/7-5/desc = "0781:5530 SanDisk_Cruzer_1942531DB09038A6"
|
|
||||||
END
|
|
||||||
|
|
||||||
rm $tmpf
|
|
@ -1,67 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
tmpf=`mktemp`
|
|
||||||
domu='qdvp'
|
|
||||||
|
|
||||||
## === List
|
|
||||||
echo 'qvm-usb -l'
|
|
||||||
qvm-usb -l | sort > $tmpf
|
|
||||||
|
|
||||||
cat <<'END' | diff -bu - $tmpf
|
|
||||||
dom0:2-1 046a:0021 046a_0021
|
|
||||||
dom0:2-2 045e:0745 Microsoft_Microsoft®_Nano_Transceiver_v1.0
|
|
||||||
dom0:7-1 07d1:3c0a Ralink_11n_Adapter_1.0
|
|
||||||
dom0:7-5 0781:5530 SanDisk_Cruzer_1942531DB09038A6
|
|
||||||
END
|
|
||||||
|
|
||||||
## === Attach
|
|
||||||
echo 'qvm-usb -a'
|
|
||||||
qvm-usb -a $domu dom0:7-5 | diff -bu /dev/null -
|
|
||||||
#echo 'pvusb-script/usb-attach.py'
|
|
||||||
#sudo /home/abb/pvusb-scripts/usb-attach.py 7-5 3 1
|
|
||||||
|
|
||||||
## === List again
|
|
||||||
echo 'qvm-usb -l'
|
|
||||||
qvm-usb -l | sort > $tmpf
|
|
||||||
|
|
||||||
# FIXME
|
|
||||||
cat <<'END' | diff -bu - $tmpf
|
|
||||||
dom0:2-1 046a:0021 046a_0021
|
|
||||||
dom0:2-2 045e:0745 Microsoft_Microsoft®_Nano_Transceiver_v1.0
|
|
||||||
dom0:7-1 07d1:3c0a Ralink_11n_Adapter_1.0
|
|
||||||
dom0:7-5 0781:5530 SanDisk_Cruzer_1942531DB09038A6
|
|
||||||
END
|
|
||||||
|
|
||||||
read -p 'Press ENTER to continue'
|
|
||||||
|
|
||||||
## === Use: try ls
|
|
||||||
echo 'qvm-run $domu ls /dev/sda'
|
|
||||||
qvm-run -p $domu 'ls /dev/sda' > $tmpf
|
|
||||||
cat <<'END' | diff -bu - $tmpf
|
|
||||||
/dev/sda
|
|
||||||
END
|
|
||||||
|
|
||||||
## === Use: try fdisk
|
|
||||||
echo 'qvm-run $domu fdisk'
|
|
||||||
qvm-run -p $domu 'su - root -c "fdisk -l /dev/sda"' > $tmpf
|
|
||||||
|
|
||||||
cat <<'END' | diff -bu - $tmpf
|
|
||||||
|
|
||||||
Disk /dev/sda: 4022 MB, 4022337024 bytes
|
|
||||||
124 heads, 62 sectors/track, 1021 cylinders, total 7856127 sectors
|
|
||||||
Units = sectors of 1 * 512 = 512 bytes
|
|
||||||
Sector size (logical/physical): 512 bytes / 512 bytes
|
|
||||||
I/O size (minimum/optimal): 512 bytes / 512 bytes
|
|
||||||
Disk identifier: 0x3963a77b
|
|
||||||
|
|
||||||
Device Boot Start End Blocks Id System
|
|
||||||
/dev/sda1 * 62 7849447 3924693 c W95 FAT32 (LBA)
|
|
||||||
END
|
|
||||||
|
|
||||||
## === Detach
|
|
||||||
#echo 'qvm-usb -d'
|
|
||||||
#qvm-usb -d $domu:7-5 | diff -bu /dev/null -
|
|
||||||
echo 'pvusb-script/usb-detach.py'
|
|
||||||
sudo /home/abb/pvusb-scripts/usb-detach.py 7-5 4 1
|
|
||||||
|
|
||||||
rm $tmpf
|
|
Loading…
Reference in New Issue
Block a user