Product SiteDocumentation Site

8.2.2. Using USB Devices on Virtual Machines

A virtual machine that is connected with the SPICE protocol can be configured to connect USB devices. To do so, the USB device has to be plugged into the client machine, then redirected to appear on the guest machine. Red Hat Enterprise Virtualization presently supports USB usage on the following clients and guests:
  • Client
    • Red Hat Enterprise Linux 6.0 and higher
    • Red Hat Enterprise Linux 5.5 and higher
    • Windows XP
    • Windows 7
    • Windows 2008
  • Guest
    • Windows XP
    • Windows 7

Important

It is important to note the distinction between the client machine and guest machine. The client is the hardware from which you access a guest. The guest is the virtual desktop or virtual server which can be connected through the User Portal.

8.2.2.1. Using USB Devices on a Linux Client

If you connect to a virtual guest from a Red Hat Enterprise Linux client machine, you have to install several SPICE packages before you can share USB devices between the client and the guest.
To use USB devices on Red Hat Enterprise Linux clients
  1. Install SPICE packages on client
    On your Linux client machine, install the following packages:
    • spice-usb-share
    • kmod-kspiceusb-rhel60 for Red Hat Enterprise Linux 6 or
      kmod-kspiceusb-rhel5u6 for Red Hat Enterprise Linux 5
    These packages are available from the Red Hat Network, from the Red Hat Enterprise Linux Supplementary software channel for your version of Red Hat Enterprise Linux. To install the packages, run:
    # yum install spice-usb-share kmod-kspiceusb
  2. Run SPICE USB services
    Start the spiceusbsrvd service and load the kspiceusb module. Run:
    # service spiceusbsrvd start
    # modprobe kspiceusb
    
  3. Install RHEV-Tools on guest
    On the Power User Portal, select the Windows guest on which you will use your USB device. Ensure that it is powered up, then click Change CD. From the list of images, select RHEV-toolsSetup.iso. If this image is not available in your ISO domain contact your system administrator.
    Once you have attached the Guest Tools, click Console and log in to the guest machine. Locate the CD drive to access the contents of the Guest Tools ISO, and launch RHEV-ToolsSetup.exe. After the tools have been installed, you will be prompted to restart the machine for changes to be applied. Close the SPICE console window.
  4. Open firewall ports
    Allow connections on TCP port 32023 on any firewalls between the guest machine and the client machine.
  5. Enable USB Auto-Share
    On the Power User Portal, select your guest machine. Ensure that its connection protocol is SPICE, and that you have enabled USB Auto-Share as described in Section 8.1.1, “Configuring SPICE Console Options”.
  6. Attach USB device
    Connect to your guest machine as instructed in Section 2.1, “Connecting to Virtual Machines”. Place the SPICE console window of your guest desktop in focus, then attach a USB device to the client. The USB device displays in your guest desktop.
When you close the SPICE session the USB device will no longer be shared with the guest.