Sunday, December 3, 2006

VMware, USB and BSOD in an Windows XP guest system

Ha, I am happy this has so easy solution under Linux :-)

When you attach an USB 2.0 device to a VMware virtual machine running Windows XP, you almost surely get the BSOD.

VMware proposes to attach a USB 1.1 hub to force the device to use the USB 1.1 mode (classical Windows solution?).

But under Linux, you may just unload the ehci_hcd kernel module responsible for USB 2.0, VMware virtual controller does not get confused and the device works like a charm (but slow).

More detailed explanation:

Let's assume you have a computer with USB 2.0 controller and a guest Windows XP system under VMware. When you attach an USB 2.0 device to the controller and some software starts using it, there is a big chance you get a BSOD in few moments.
Actually - for some devices like Canon PTP cameras each time you attach them.

Core of the problem is that the USB virtual controller in VMware is only USB 1.1 capable.

There is response in VMware forums to this problem stating: One workaround is to get a USB 1.1 hub, and plug the USB2 device into the USB 1.1 hub instead of directly into the computer, then the host will see it as a USB 1.1 device instead of USB 2 and it will likely work better.

Ok, so you should carry a notebook, camera and an USB hub. No, thanks.

However, under Linux there is an easier solution - two kernel modules take care about handling USB device - ehci_hcd and uhci_hcd (as for my 2.6.18). The first one is just an extension of uhci_hcd (USB 1.1) to USB 2.0. If you do a rmmod ehci_hcd prior to attaching the device, your system will respond as with an USB 1.1 controller.

At least for a Canon S3 camera this helped. Sure, if they finally port the remote capture utility to Linux, that would be better...

No comments: