Changes

Jump to: navigation, search

Adding USB Devices to a Xen HVM domainU Guest

65 bytes added, 18:52, 29 May 2016
m
Text replacement - "<htmlet>xen<htmlet>" to "<htmlet>xen</htmlet>"
<htmlet>xen</htmlet>  Xen provides two mechanisms for adding USB devices to an HVM virtualization domainU guest system. The first technique is a long-term solution, requires requiring the addition of the device to the domainU configuration file and involves a domainU restart . The second solution is better suited to adding a device temporarily to a running Xen HVM guest system and involves the use of the Qemu QEMU monitor.
== Identifying USB Devices on the Xen Host System ==
</pre>
USB devices which are connected are shown with a ''vendor:product'' value pair. Devices with ''0000:0000'' represent USB ports where no device is connected or a device is connected but currently powered off. A list of device ID strings is contained in the ''/usr/share/hwdata/usb.ids'' file). If no matching ID is found in the file this field is left blank. This file is constantly updated so it may be worth downloading the latest release from [http://www.linux-usb.org/usb.ids http://www.linux-usb.org/usb.ids].
== A Trick to Identify the Correct USB Device ==
If, even with the latest ''usb.ids'' file, you are unsure which ID relates to the device you wish to add to your Xen HVM guest another option is to power off or unplug the device in question, and run ''lsusb'' again. The device which is no longer listed is most likely the device you are looking for.
== Adding the New USB Device to the Xen domainU Configuration File ==
</pre>
With USB support enabled, the next step is to specify the device to be added. Devices are referenced using ''host:vendor:product'' where ''vendor'' and ''product''' are the ID values as listed by the ''lsusb'' command. For example, to add the HP printer listed in the previous ''lsusb'' output the following line needs to be added to the configuration file:
<pre>
== Temporarily Adding a USB Device to a running Xen HVM Guest ==
If access to a USB device is needed temporarily the device can be added to the running domainU guest without shutting it down and modifying the configuration file. This feat is achieved using the QEMU monitor. Before the QEMU monitor of a running Xen HVM domainU guest can be access accessed, however, a number of configuration changes are necessary. Firstly, the monitor needs to be enabled in the domainU configuration file:
<pre>
</pre>
One Once these changes are made, restart the domainU and from now on USB devices may be added and removed dynamically without having to restart the system. To access the QEMU monitor press ''Crtl+Alt+2''. The graphical display will subsequently change to the text based QEMU monitor. The initial display will read:
<pre>
</pre>
The devide device may be similarly subsequently removed from the domianU guest when no longer required using the ''usb_del'' command combined with the appropriate device identification values:
<pre>
usb_del host:03f0:a004
</pre>
 
 
<htmlet>xen</htmlet>

Navigation menu