USB printer passthrough

shaman01

New Member
Aug 28, 2012
13
0
1
Ive got problem with forwarding usb2.0 printer to guest vm. I tried to add a QEMU EHCI controller to vm with options:
Code:
args: -device usb-ehci,id=ehci -device usb-host,bus=ehci.0,hostbus=1,hostport=1.2
VM fails to start with the following error:
Code:
kvm: -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3: PCI: slot 3 function 0 not available for virtio-balloon-pci, in use by usb-ehci
Here is the kvm config file:
Code:
boot: dcn
bootdisk: ide0
cores: 1
ide0: local:102/vm-102-disk-1.raw,cache=writethrough,size=15G
ide2: local:iso/ru_winxp_pro_with_sp3_vl.iso,media=cdrom
memory: 512
name: winxp
net0: rtl8139=B6:5A:B0:B0:58:6F,bridge=vmbr0
ostype: wxp
sockets: 1
#usb0: host=04a9:266a
args: -device usb-ehci,id=ehci -device usb-host,bus=ehci.0,hostbus=1,hostport=1.2
Here is the lsusb output from host system:
Code:
Bus 001 Device 051: ID 04a9:266a Canon, Inc. CAPT Device

qm> info usbhost
  Bus 1, Addr 2, Port 1, Speed 480 Mb/s
    Hub: USB device 8087:0024
  Bus 2, Addr 2, Port 1, Speed 480 Mb/s
    Hub: USB device 8087:0024
  Bus 1, Addr 51, Port 1.2, Speed 480 Mb/s
    Class 00: USB device 04a9:266a, Canon CAPT USB Device

Any ideas?
 
Ive got problem with forwarding usb2.0 printer to guest vm. I tried to add a QEMU EHCI controller to vm with options:
Code:
args: -device usb-ehci,id=ehci -device usb-host,bus=ehci.0,hostbus=1,hostport=1.2
VM fails to start with the following error:
Code:
kvm: -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3: PCI: slot 3 function 0 not available for virtio-balloon-pci, in use by usb-ehci
Here is the kvm config file:
Code:
boot: dcn
bootdisk: ide0
cores: 1
ide0: local:102/vm-102-disk-1.raw,cache=writethrough,size=15G
ide2: local:iso/ru_winxp_pro_with_sp3_vl.iso,media=cdrom
memory: 512
name: winxp
net0: rtl8139=B6:5A:B0:B0:58:6F,bridge=vmbr0
ostype: wxp
sockets: 1
#usb0: host=04a9:266a
args: -device usb-ehci,id=ehci -device usb-host,bus=ehci.0,hostbus=1,hostport=1.2
Here is the lsusb output from host system:
Code:
Bus 001 Device 051: ID 04a9:266a Canon, Inc. CAPT Device

qm> info usbhost
  Bus 1, Addr 2, Port 1, Speed 480 Mb/s
    Hub: USB device 8087:0024
  Bus 2, Addr 2, Port 1, Speed 480 Mb/s
    Hub: USB device 8087:0024
  Bus 1, Addr 51, Port 1.2, Speed 480 Mb/s
    Class 00: USB device 04a9:266a, Canon CAPT USB Device

Any ideas?
Why don't you use simply usb0: .... option. This auto add ehci controller + passthrough your usb device
 
With option "usb0: host=04a9:266a" guest vm with winxp recognize this printer and installs drivers. When trying to print test page, it just appears in the print queue with the Status as "Error - Printing".
 
It looks like system detects printer as usb2.0 device, but qemu/KVM forwards only usb1.1 max.

dmesg on printers connect
Code:
usb 2-1.3: new high speed USB device number 3 using ehci_hcd
usb 2-1.3: New USB device found, idVendor=04a9, idProduct=266a
usb 2-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 2-1.3: Product: Canon CAPT USB Device
usb 2-1.3: Manufacturer: Canon
usb 2-1.3: SerialNumber: 0000B154CMtn
usb 2-1.3: configuration #1 chosen from 1 choice
dmesg on vm start
Code:
usb 2-1.3: reset high speed USB device number 3 using ehci_hcd
usb 2-1.3: reset high speed USB device number 3 using ehci_hcd
usb 2-1.3: reset high speed USB device number 3 using ehci_hcd
usb 2-1.3: reset high speed USB device number 3 using ehci_hcd
usb 2-1.3: reset high speed USB device number 3 using ehci_hcd
usb 2-1.3: reset high speed USB device number 3 using ehci_hcd
 
It looks like system detects printer as usb2.0 device, but qemu/KVM forwards only usb1.1 max.

I am having the same exact issue below. Is there a workaround to provide usb 2.0 to kvm guests? Below is the details of pveversion:

Code:
root@VE1:~# pveversion -vproxmox-ve-2.6.32: 3.1-109 (running kernel: 2.6.32-23-pve)
pve-manager: 3.1-3 (running version: 3.1-3/dc0e9b0e)
pve-kernel-2.6.32-23-pve: 2.6.32-109
lvm2: 2.02.98-pve4
clvm: 2.02.98-pve4
corosync-pve: 1.4.5-1
openais-pve: 1.1.4-3
libqb0: 0.11.1-2
redhat-cluster-pve: 3.2.0-2
resource-agents-pve: 3.9.2-4
fence-agents-pve: 4.0.0-1
pve-cluster: 3.0-7
qemu-server: 3.1-1
pve-firmware: 1.0-23
libpve-common-perl: 3.0-6
libpve-access-control: 3.0-6
libpve-storage-perl: 3.0-10
pve-libspice-server1: 0.12.4-1
vncterm: 1.1-4
vzctl: 4.0-1pve3
vzprocps: 2.0.11-2
vzquota: 3.1-2
pve-qemu-kvm: 1.4-17
ksm-control-daemon: 1.1-1
glusterfs-client: 3.4.0-2
 
Hi shaman01,

you should specify an alterantive address for the ehci controller. I prefer to use vendorids and productids.

Instead of
args: -device usb-ehci,id=ehci -device usb-host,bus=ehci.0,hostbus=1,hostport=1.2

this should work

args: -device usb-ehci,id=ehci,addr=0x9 -device usb-host,id=canon,bus=ehci.0,vendorid=0x04a9,productid=0x266a

hope it helps...