Assigning Host USB device to a Guest VM

Source: Internet
Author: User

Example assigning Host USB device to a Guest VM

This example was based on QEMU-KVM (0.15.0) as installed in Fedora 15. Would first show how does this manually, and second how to do it using the the Virt-manager tool. This HOWTO are limited to UHCI devices (no USB2 EHCI).

Here we'll use a phone attached to the host:

# Lsusb ... Bus 002 Device 003:id 18D1:4E11 Google Inc. Nexus One

(Note the Bus and device numbers).

manually, using QEMU-KVM command line

Here we add -usb the to add a host controller, and add to -device usb-host,hostbus=2,hostaddr=3 add the host's USB device at Bus 2, device 3. Simple as that.

Now, we can verify the guest:

$ lspci ... 00:01.2 USB Controller:intel Corporation 82371SB PIIX3 USB [Natoma/triton II] (rev 01)
$ lsusbbus 001 Device 001:id 1d6b:0001 Linux Foundation 1.1 root hubbus 001 Device 002:id 18d1:4e11 Google Inc Nexus on E Phone

And on the phone enable USB Mass Storage, and the guest should display a dialog seeing a new USB filesystem. Open it and ...

$ Ls/media/[mountpoint]android/  data/  dcim/...
Managed, using Virt-manager

This assumes already has created a VM using Virt-manager. The VM is not running, and you're a like-to-add a USB host device to the VM. Start Virt-manager, and open your VM by double clicking on it. Click the virtual hardware details (lightbulb). Now Click Add Hardware, and Choose USB Host Device. Here, we are choosing the same Phone device.

Start the VM and verify the USB host controller and device show up like above. Now on the phone enable USB Mass Storage, and the guest should display a dialog seeing a new USB filesystem.

Assigning Host USB device to a Guest VM

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.