[Bug 787091] Re: Unable to use USB device in KVM quest

Royston Carter 787091 at bugs.launchpad.net
Tue Jun 7 16:09:45 UTC 2011


Serge,
Done and I will attach the trace. We appear to get the following extract at regular intervals.  By the way I had to update apparmor to allow execution of strace and writing to /tmp.

Regards

Roy


8865  munmap(0x7eff052c7000, 4096)      = 0
8865  write(1, "husb: open device 1.4\n", 22) = 22
8865  open("/dev/bus/usb/001/004", O_RDWR|O_NONBLOCK) = -1 EPERM (Operation not permitted)
8865  write(2, "/dev/bus/usb/001/004: Operation "..., 46) = 46
8865  getdents(21, /* 0 entries */, 32768) = 0
8865  close(21)                         = 0
8865  futex(0x869a60, FUTEX_WAKE_PRIVATE, 1) = 1


Sent from my iPad

On 7 Jun 2011, at 15:57, Serge Hallyn <787091 at bugs.launchpad.net> wrote:

> Quoting Royston Carter (787091 at bugs.launchpad.net):
>> Serge,
>> Done as requested but no change. I no longer get my host reporting that it has seen a new printer but the KVM guest still does not see the device. The log file is still showing "operation not permitted" on a regular basis.
>> 
>> Any other thoughts?
> 
> This sometimes works, but it can be hard to get it right.  We're going
> to try inserting a wrapper around kvm when executed by libvirt.  Please
> do the following precisely (after re-starting cups and re-installing the
> packages as described earlier):
> 
>    mv /usr/bin/kvm /usr/bin/kvm.real
>    vi /usr/bin/kvm
> 
> Insert the following:
> 
>    #!/bin/sh
>    strace -f -o/tmp/strace-kvm.$$.out /usr/bin/kvm.real $*
> 
> and make it executable:
> 
>        chmod ugo+x /usr/bin/kvm
> 
> Then start the virtual machine through libvirt as usual.  It'll be slow.
> When it is shut down, attach /tmp/strace-kvm.*.out to this bug report,
> and undo the wrapper by doing:
> 
>        mv /usr/bin/kvm.real /usr/bin/kvm
> 
> -- 
> You received this bug notification because you are a direct subscriber
> of the bug.
> https://bugs.launchpad.net/bugs/787091
> 
> Title:
>  Unable to use USB device in KVM quest
> 
> Status in “qemu-kvm” package in Ubuntu:
>  Incomplete
> 
> Bug description:
>  Binary package hint: qemu-kvm
> 
>  Ubuntu 10.04 Server:
> 
>  I have been trying for some considerable time to get a Windows XP
>  guest to recognise a USB Canon printer. I have searched google
>  endlessly and applied a number of changes to apparmor profiles. I am
>  still not able to get the guest to recognise that there a USB device
>  attached. I was originally getting repeated messages in kern.log as
>  below but the apparmor changes did resolve these:
> 
>  May 22 08:01:51 vmserver kernel: [424696.858434] type=1503
>  audit(1306047711.654:81239):  operation="open" pid=19695 parent=1
>  profile="libvirt-629433c8-3714-561b-8e91-4a8a9bb65b9f"
>  requested_mask="r::" denied_mask="r::" fsuid=0 ouid=0
>  name="/sys/devices/pci0000:00/0000:00:05.0/0000:02:00.0/usb8/devnum"
> 
>  I am now left with messages in the VM log file as follows which I
>  cannot find a solution for:
> 
>  char device redirected to /dev/pts/5
>  usb_create: no bus specified, using "usb.0" for "usb-host"
>  husb: open device 1.4
>  /dev/bus/usb/001/004: Operation not permitted
>  husb: open device 1.4
>  /dev/bus/usb/001/004: Operation not permitted
>  husb: open device 1.4
> 
> 
>  This is a fairly basic requirement and hopefully a solution already exists.
> 
>  ProblemType: Bug
>  DistroRelease: Ubuntu 10.04
>  Package: kvm 1:84+dfsg-0ubuntu16+0.12.3+noroms+0ubuntu9.6
>  ProcVersionSignature: Ubuntu 2.6.32-31.61-server 2.6.32.32+drm33.14
>  Uname: Linux 2.6.32-31-server x86_64
>  NonfreeKernelModules: fglrx
>  Architecture: amd64
>  Date: Mon May 23 17:33:39 2011
>  InstallationMedia: Ubuntu-Server 10.04 LTS "Lucid Lynx" - Release amd64 (20100427)
>  KvmCmdLine:
>   UID        PID  PPID  C    SZ   RSS PSR STIME TTY          TIME CMD
>   root      3604     1 25 188376 364400 1 15:55 ?        00:24:30 /usr/bin/kvm -S -M pc-0.12 -enable-kvm -m 512 -smp 2,cores=2 -name Trixbox2.8 -uuid c19e7ccd-6a2d-35b0-5e0a-e9832434c517 -chardev socket,id=monitor,path=/var/lib/libvirt/qemu/Trixbox2.8.monitor,server,nowait -monitor chardev:monitor -boot c -drive file=/var/lib/libvirt/images/Trixbox2.8.img,if=virtio,index=0,boot=on,format=raw -drive if=ide,media=cdrom,index=2,format=raw -net nic,macaddr=52:54:00:45:84:af,vlan=0,model=virtio,name=virtio.0 -net tap,fd=48,vlan=0,name=tap.0 -chardev pty,id=serial0 -serial chardev:serial0 -parallel none -usb -vnc 127.0.0.1:0 -vga cirrus
>   root      5355     1  9 249533 283612 5 16:16 ?        00:07:42 /usr/bin/kvm -S -M pc-0.12 -enable-kvm -m 769 -smp 2 -name MediaServer -uuid b38159a1-5ee5-b792-e110-c270f30f6925 -chardev socket,id=monitor,path=/var/lib/libvirt/qemu/MediaServer.monitor,server,nowait -monitor chardev:monitor -boot c -drive file=/var/lib/libvirt/images/MediaServer.img,if=virtio,index=0,boot=on,format=raw -drive if=ide,media=cdrom,index=2,format=raw -net nic,macaddr=52:54:00:54:df:b7,vlan=0,model=virtio,name=virtio.0 -net tap,fd=49,vlan=0,name=tap.0 -chardev pty,id=serial0 -serial chardev:serial0 -parallel none -usb -usbdevice tablet -vnc 127.0.0.1:1 -vga cirrus
>   root      5392     1 18 600048 2095120 4 16:16 ?       00:14:01 /usr/bin/kvm -S -M pc-0.12 -enable-kvm -m 2048 -smp 4,cores=2 -name hamlet -uuid 1f04fb04-dc50-c259-70af-8124cf9f6022 -chardev socket,id=monitor,path=/var/lib/libvirt/qemu/hamlet.monitor,server,nowait -monitor chardev:monitor -localtime -boot c -drive if=ide,media=cdrom,index=2,format=raw -drive file=/dev/vmserver_vg1/hamlet,if=virtio,index=0,boot=on,format=raw,cache=none -net nic,macaddr=52:54:00:6f:66:2c,vlan=0,model=virtio,name=virtio.0 -net tap,fd=50,vlan=0,name=tap.0 -chardev pty,id=serial0 -serial chardev:serial0 -parallel none -usb -usbdevice tablet -vnc 127.0.0.1:2 -vga cirrus -soundhw ac97
>   root      5494     1 13 321228 431924 3 16:17 ?        00:10:08 /usr/bin/kvm -S -M pc-0.12 -enable-kvm -m 1024 -smp 4 -name Scientific -uuid 9463aae5-6fdb-0c67-72dc-98dd50de1984 -chardev socket,id=monitor,path=/var/lib/libvirt/qemu/Scientific.monitor,server,nowait -monitor chardev:monitor -boot c -drive file=/var/lib/libvirt/images/Scientific.img,if=virtio,index=0,boot=on,format=raw,cache=none -drive if=ide,media=cdrom,index=2,format=raw -net nic,macaddr=52:54:00:6e:b8:bf,vlan=0,model=virtio,name=virtio.0 -net tap,fd=51,vlan=0,name=tap.0 -chardev pty,id=serial0 -serial chardev:serial0 -parallel none -usb -usbdevice tablet -vnc 127.0.0.1:3 -vga cirrus -soundhw ac97
>  MachineType: Gigabyte Technology Co., Ltd. GA-890GPA-UD3H
>  ProcCmdLine: BOOT_IMAGE=/vmlinuz-2.6.32-31-server root=/dev/mapper/hostname_vg1-root ro quiet
>  ProcEnviron:
>   LANG=en_GB.utf8
>   SHELL=/bin/bash
>  SourcePackage: qemu-kvm
>  dmi.bios.date: 05/17/2010
>  dmi.bios.vendor: Award Software International, Inc.
>  dmi.bios.version: FB
>  dmi.board.name: GA-890GPA-UD3H
>  dmi.board.vendor: Gigabyte Technology Co., Ltd.
>  dmi.board.version: x.x
>  dmi.chassis.type: 3
>  dmi.chassis.vendor: Gigabyte Technology Co., Ltd.
>  dmi.modalias: dmi:bvnAwardSoftwareInternational,Inc.:bvrFB:bd05/17/2010:svnGigabyteTechnologyCo.,Ltd.:pnGA-890GPA-UD3H:pvr:rvnGigabyteTechnologyCo.,Ltd.:rnGA-890GPA-UD3H:rvrx.x:cvnGigabyteTechnologyCo.,Ltd.:ct3:cvr:
>  dmi.product.name: GA-890GPA-UD3H
>  dmi.sys.vendor: Gigabyte Technology Co., Ltd.
> 
> To unsubscribe from this bug, go to:
> https://bugs.launchpad.net/ubuntu/+source/qemu-kvm/+bug/787091/+subscribe

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to qemu-kvm in Ubuntu.
https://bugs.launchpad.net/bugs/787091

Title:
  Unable to use USB device in KVM quest



More information about the Ubuntu-server-bugs mailing list