public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: "André Weidemann" <Andre.Weidemann@web.de>
To: Flypen CloudMe <flypen@gmail.com>
Cc: kvm@vger.kernel.org
Subject: Re: Does anyone successfully use USB drive in Windows7 guest?
Date: Sat, 25 Jun 2011 14:24:02 +0200	[thread overview]
Message-ID: <4E05D362.1090108@web.de> (raw)
In-Reply-To: <BANLkTimXNUkqb_3Mhwmgt_epWNFm7U+Y8w@mail.gmail.com>

Hi,

On 25.06.2011 03:32, Flypen CloudMe wrote:
> Hi,
>
> Does anyone successfully use USB drive in Windows7 guest? If I pass a
> USB drive to Windows7 guest, Device Manager may find this device but
> the USB mass storage driver can't be installed successfully. I have
> tried many times. Is the emulated USB controller is so old and
> Windows7 doesn't support it? I can't use PCI passthrough feature to
> pass the whole USB controller to VM, because the hypervisor also needs
> to use some USB ports.
>
> If I use Windows XP or Linux, the USB drive can work well.
>

Try the following when starting qemu-kvm. Replace sdX with your USB device.

...
-device usb-ehci,id=ehci \
-drive if=none,id=usbstick,file=/dev/sdX \
-device usb-storage,bus=ehci.0,drive=usbstick \
...

If would like to add the device while your VM is running, you may omit 
the last two lines and add this one instead:
-monitor telnet:127.0.0.1:11111,server,nowait,nodelay

Add the device using the two commands below:
echo "drive_add 0 id=usbdrive,if=none,file=/dev/sdX"| /bin/nc -w1 
127.0.0.1 11111
echo "device_add usb-storage,id=usbdrive,bus=ehci.0,drive=usbdrive"| 
/bin/nc -w1 127.0.0.1 11111

Remove the device by first ejecting the USB drive under Win7. Then use 
this line to remove the drive from the VM:
echo "device_del usbdrive"| /bin/nc -w1 127.0.0.1 11111

Regards
  André

  reply	other threads:[~2011-06-25 12:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-25  1:32 Does anyone successfully use USB drive in Windows7 guest? Flypen CloudMe
2011-06-25 12:24 ` André Weidemann [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-06-25 10:35 Tomasz Chmielewski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E05D362.1090108@web.de \
    --to=andre.weidemann@web.de \
    --cc=flypen@gmail.com \
    --cc=kvm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox