# KVM USB Printer - Blue Screen

## grooveman

Hi everyone,

I have an xp box running under qemu, and so far it has been working very well.  Recently, I went to add USB support, as I need to use USB printer connected to the host system.

My printer is an epson stylus photo 2200:

```
Bus 001 Device 003: ID 04b8:0007 Seiko Epson Corp. Printer
```

I add it to the kvm (qemu) command line like so:  

```
-usb -usbdevice host:04b8:0007
```

The virtual XP box detects the printer, I install the drivers, and everything goes smoothly.  However, when I go to print a test page, I get a blue screen (lasting only a split-second) and the XP box reboots.  This is 100% replicable.

I'm getting this kind of output in my dmesg:

```

usbfs 1-2:1.0: forced unbind                                                                                    

ehci_hcd 0000:00:12.2: port 2 high speed                                                                        

ehci_hcd 0000:00:12.2: GetStatus port 2 status 001005 POWER sig=se0 PE CONNECT                                  

usb 1-2: reset high speed USB device using ehci_hcd and address 3                                               

ehci_hcd 0000:00:12.2: port 2 high speed                                                                        

ehci_hcd 0000:00:12.2: GetStatus port 2 status 001005 POWER sig=se0 PE CONNECT                                  

usblp 1-2:1.0: usb_probe_interface                                                                              

usblp 1-2:1.0: usb_probe_interface - got id                                                                     

drivers/usb/core/file.c: looking for a minor, starting at 0                                                     

usblp0: USB Bidirectional printer dev 3 if 0 alt 0 proto 2 vid 0x04B8 pid 0x0007                                

usblp 1-2:1.0: disconnect by usbfs                                                                              

drivers/usb/core/file.c: removing 0 minor                                                                       

usblp0: removed                                                                                                                                                       

```

I have cups shut down on the host OS when I start the vm.  

I'm using qemu-kvm-0.12.3 and gentoo-sources-2.6.31-r6.

Thanks for the help.

G

----------

## bbgermany

Hi, 

you should go to system properties and disable auto reboot of your vm in case of a bsod. maybe its a driver issue of the windows driver.

bb

----------

## Mad Merlin

Is your printer USB 2.0 only? If so, you're out of luck, KVM only supports USB 1.1.

Theoretically USB 2.0 devices are supposed to fall back to 1.1 when the host only supports 1.1, but many don't.

Also, I know for PCI passthrough you need to make sure the device isn't in use on the host before you pass it to the guest, there's a kernel module called pci-stub or something like that which simply reserves the relevant resources to make sure they're not used. You may need to do something similar for USB passthrough.

----------

## grooveman

 *bbgermany wrote:*   

> Hi, 
> 
> you should go to system properties and disable auto reboot of your vm in case of a bsod. maybe its a driver issue of the windows driver.
> 
> bb

 

Yeah, I have done that, but unfortunately, google says nothing about those particular error codes.  I have even tried several different drivers, including the generic text only driver for this printer.  Crashes the system every time.

 *Quote:*   

> Is your printer USB 2.0 only? If so, you're out of luck, KVM only supports USB 1.1.

 

I doubt it, it is a fairly old printer.

 *Quote:*   

> Also, I know for PCI passthrough you need to make sure the device isn't in use on the host before you pass it to the guest, there's a kernel module called pci-stub or something like that which simply reserves the relevant resources to make sure they're not used. You may need to do something similar for USB passthrough.

 

I cannot find any info on using this... can you point me somewhere?   Though I'm not sure it is appropriate here, as it isn't really a pci device, the usb controler is, but not the printer...

Thanks.

----------

## Mad Merlin

Some PCI passthrough stuff: http://www.linux-kvm.org/page/How_to_assign_devices_with_VT-d_in_KVM

As I said, I don't know if you need usb-stub or something similar, but USB passthrough definitely doesn't require an IOMMU or most of the other things there, but your kernel messages make me wonder.

----------

## kanal108

Well ... I have the same problem.

I tried it first with qemu-kvm, then later with libvirt, but I have all the time a blue screen as soon as I try to do sth. with usb within the VM with Win XP. Is there a solution for this problem?

The devices I tried: 1x scanner, 1x printer, 1x usb stick, every time the same problem ... blue screen

----------

