Changes

Jump to: navigation, search

Adding USB Devices to a Xen HVM domainU Guest

2,224 bytes added, 15:32, 9 May 2008
Adding the New USB Device to the Xen domainU Configuration File
== Adding the New USB Device to the Xen domainU Configuration File ==
 
To add the USB device to the Xen domainU guest to address a long term requirement the device should be specified in the domainU configuration file. The first step is to enable USB support which is achieved by adding the following line to the configuration:
 
<pre>
usb=1
</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>
usbdevice=[ 'host:03f0:a004' ]
</pre>
 
Once these changes have been made, restart the domainU system. The USB device should now be accessible within the guest operating system.
 
== 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 a number of configuration changes are necessary. Firstly, the monitor needs to be enabled in the domainU configuration file:
 
<pre>
monitor=1
</pre>
 
Secondly, the graphical console of the domainU guest must be using SDL rather than VNC:
 
<pre>
sdl=1
vnc=0
</pre>
 
One 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>
HVM device model. type 'q' to exit
(HVMXen)
</pre>
 
At the (HVMXen) prompt a USB device may be added using the ''usb_add'' command together with the ''host:vendor:product'' value pair of the required device, for example:
 
<pre>
usb_add host:03f0:a004
</pre>
 
The devide may be similarly 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>
1,798
edits

Navigation menu