From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?ISO-8859-1?Q?Andr=E9_Weidemann?= Subject: Re: Does anyone successfully use USB drive in Windows7 guest? Date: Sat, 25 Jun 2011 14:24:02 +0200 Message-ID: <4E05D362.1090108@web.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: kvm@vger.kernel.org To: Flypen CloudMe Return-path: Received: from fmmailgate03.web.de ([217.72.192.234]:48288 "EHLO fmmailgate03.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751077Ab1FYMYq (ORCPT ); Sat, 25 Jun 2011 08:24:46 -0400 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: 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 need= s > 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 dev= ice. =2E.. -device usb-ehci,id=3Dehci \ -drive if=3Dnone,id=3Dusbstick,file=3D/dev/sdX \ -device usb-storage,bus=3Dehci.0,drive=3Dusbstick \ =2E.. If would like to add the device while your VM is running, you may omit=20 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=3Dusbdrive,if=3Dnone,file=3D/dev/sdX"| /bin/nc -w1= =20 127.0.0.1 11111 echo "device_add usb-storage,id=3Dusbdrive,bus=3Dehci.0,drive=3Dusbdriv= e"|=20 /bin/nc -w1 127.0.0.1 11111 Remove the device by first ejecting the USB drive under Win7. Then use=20 this line to remove the drive from the VM: echo "device_del usbdrive"| /bin/nc -w1 127.0.0.1 11111 Regards Andr=E9