Ask Your Question

gnome-boxes USB forwarding not working

asked 2015-03-08 13:23:51 -0500

firefexx gravatar image

updated 2015-03-09 05:01:59 -0500


I'm using gnome-boxes for virtualization. Current setup: Fedora 21 host, Fedora 21 guest.

USB forwarding works very well for my external BluRay drive but it does not for any of my USB storage (sticks or hard drives).

The storage devices are simply not recognized by the guest OS, after I toggled the appropriate USB forwarding switch in the boxes settings.

Some ideas on how to debug the issue?

EDIT: it seems that all USB 2.0 devices are working, while I was not successful to pass through USB 3.0 devices. I thought this is possible with recent QEMU versions. Am I doing something wrong?

edit retag flag offensive close merge delete


I like your question!

fedoramonsecond gravatar imagefedoramonsecond ( 2016-11-04 06:50:24 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2017-01-28 08:15:43 -0500

oneThingInMyWay gravatar image

I used this workaround to copy content from USB flash devices into my virtual machine. The fix doesn't work perfekt, because the mouse has some hesitations during using the workaround. After copying the files you can switch back to boxes. The Problem consists between the interface of boxes and the visualizing machine qemu in the background. Therefore I bypass boxes and connect over VNC with the program Remote Deskop in Fedora. The disadvantage of this technique is, that you have to connect every singele device on their own.

I used following commands to check out all active USB devices: $ lsusb

The device I was looking for was: Bus 002 Device 009: ID 8564:1000 Transcend Information, Inc. JetFlash

You have to change this command depending on your Device match, the userName and the nameOfVirtualMachine (in my case win7-profess) pkexec --user root qemu-system-x86_64 -machine accel=kvm -smp 2 -m 1024 -net none -device usb-ehci,id=usb,bus=pci.0,addr=0x4 -device usb-host,hostbus=2,hostaddr=9 -usb /home/userName/.local/share/gnome-boxes/images/nameOfVirtualMachine -boot c -vnc

Note: If your windows version number is higher than 7 or support touch screens, you can add touch to your command and the mouse works more correct.

pkexec --user root qemu-system-x86_64 -machine accel=kvm -smp 2 -m 1024 -net none -device usb-ehci,id=usb,bus=pci.0,addr=0x4 -device usb-host,hostbus=2,hostaddr=9 -usb -usbdevice tablet -hda /home/userName/.local/share/gnome-boxes/images/win10-educat -boot c -vnc

After you stated this connection, you can access the VM over Remote Desktop. Open the programm, click on Connect and select Protocol VNC and Host localhost:5901. After this click connect. Hopefully it will work for you.

Good luck!

edit flag offensive delete link more

answered 2017-01-28 11:31:05 -0500

MaoTao gravatar image

I hope this helps:

With USB redirection, USB devices plugged into the client machine can be transparently redirected to the guest OS. This redirection can either be automatic (all newly plugged devices are redirected), or manual (the user selects which devices (s)he wants to redirect).

For redirection to work, the virtual machine must have an USB2 EHCI controller (this implies 3 additional UHCI controllers). It also needs to have Spice channels for USB redirection. The number of such channels correspond to the number of USB devices that it will be possible to redirect at the same time.

Using QEMU we need to add EHCI/UHCI controllers to QEMU command line, and we also need to add one Spice redirection channel per device we want to redirect simultaneously.

-device ich9-usb-ehci1,id=usb \
-device ich9-usb-uhci1,masterbus=usb.0,firstport=0,multifunction=on \
-device ich9-usb-uhci2,masterbus=usb.0,firstport=2 \
-device ich9-usb-uhci3,masterbus=usb.0,firstport=4 \
-chardev spicevmc,name=usbredir,id=usbredirchardev1 \
-device usb-redir,chardev=usbredirchardev1,id=usbredirdev1 \
-chardev spicevmc,name=usbredir,id=usbredirchardev2 \
-device usb-redir,chardev=usbredirchardev2,id=usbredirdev2 \
-chardev spicevmc,name=usbredir,id=usbredirchardev3 \
-device usb-redir,chardev=usbredirchardev3,id=usbredirdev3

The client needs to have support for USB redirection. In remote-viewer, you can select which USB devices to redirect in "File/USB device" selection once the Spice connection is established. There are also various command line redirection options which are described when running remote-viewer with --help-spice.


edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2015-03-08 13:23:51 -0500

Seen: 3,015 times

Last updated: Jan 28 '17