Attaching an USB device to a Virtual Machine result in a error: Failed to create a proxy devices for the USB device. (Error: VERR_READ_ERROR) Result Code: NS_ERROR_FAILURE (0x80004005) Component: Console Interface: IConsole {8ab7c520-2442-4b66-8d74-4ff1e195d2b6} More info at the FreeDBS forum https://forums.freebsd.org/viewtopic.php?f=5&t=48134
Auto-assigned to maintainer vbox@FreeBSD.org
I want to confirm this bug. On 10.0-RELEASE I cannot get any USB devices into the guest VM (MS Windows XP), which worked before Virtualbox version 4.3.16. They are not detected anymore. On 10.1-RC1 Virtualbox 4.3.16 crashes when there is a usbfilter entry specified. Everything seems to work correctly when I remove my usbfilter entry.
I tested 10.0-RELEASE and 10.1-RC1 with the older version VirtualBox-4.3.12_2 (SVN revision 367888). Works like expected. It seems there is a breakage in 4.3.16.
This bug is still present in version 4.3.18. Verified on: $ uname -a FreeBSD clover-nas2 9.3-STABLE FreeBSD 9.3-STABLE #0 r271760: Thu Sep 18 16:25:02 CEST 2014 ssh@clover-nas2:/usr/obj/usr/src/sys/GENERIC amd64
Upgraded via portmaster to virtualbox-ose-4.3.18 today and bug remains.
Also, update ports today and this bug appear.
Same problem FreeBSD 9.3-RELEASE-p2 amd64. virtualbox-version 4.13.18.
This is a known problem. FYI, 4.3.14 introduced new USB support code and I just added a stub to make it compile at the time. Unfortunately, I had no free time to complete it but decke committed the incomplete code with 4.3.16. Hans, can you please take a look at the following upstream change? https://www.virtualbox.org/changeset/49814
Hi, Looking at: https://svnweb.freebsd.org/ports/head/emulators/virtualbox-ose/files/patch-src-VBox-Devices-USB-freebsd-USBProxyDevice-freebsd.cpp?revision=373388&view=markup I think you should set cMillies = 0, right after RTPipeRead(pDevFBSD->hPipeWakeupR, &bRead, 1, &cbIgnored), so that the function actually returns when the hPipeWakeupR is signalled. I think the purpose of the hPipeWakeupR is to force the reaper to return to the caller. Else it looks good! Test with a USB webcam, USB audio device and/or a USB memory stick and it should be fine. --HPS
(In reply to Hans Petter Selasky from comment #9) > I think you should set cMillies = 0, right > after RTPipeRead(pDevFBSD->hPipeWakeupR, &bRead, 1, &cbIgnored), so that the > function actually returns when the hPipeWakeupR is signalled. Thanks for the suggestion. Unfortunately, it didn't improve the situation, e.g., "VBoxManage list usbhost" shows all devices are busy, guests with valid USB filter refuse to start, etc. :-(
Did you enable VBox debugging? It should have the possibility to have some nice printouts from the USB subsystem which should tell what is going on! --HPS
I've reproduced the issue and found the root cause. Will upload a new patch soonish. --HPS
Created attachment 149966 [details] New USB patch Hi, Replace "files/patch-src-VBox-Devices-USB-freebsd-USBProxyDevice-freebsd.cpp" using this attachment and try again! Issue #1) Change wrong callback area size from "sizeof(PUSBPROXYDEVFBSD)" into "sizeof(USBPROXYDEVFBSD)" Issue #2) Implement new "usbProxyFreeBSDWakeup" callback function. Issue #3) Don't free the private USB data in the USB close function. --HPS
FYI: https://www.marshut.net/kswtpp/freebsd-virtualbox-usb-support.html
Patch from comment 13 seems to be working for an usb remote emulating a keyboard, and for a flash drive after setting hw.usb.ehci.no_hs=1 (tested mounting and ls -l), both using a FreeBSD 10.0 guest.
I have tested the patch with virtualbox-ose-4.3.20 and a 4GB SanDisk Cruzer Blade 1.01 USB stick formatted with FAT32. With an Ubuntu Mate x86 VM the stick do not works: when I connect the stick, the VM and the VM VirtualBox Manager do not respond to the user. I need to kill both. With a Windows XP VM the stick usually works: I can format it, copy and remove files but stressing a bit the system I receive the same error as in Ubuntu VM. For example I can not copy a 300MB file on the stick from the Windows VM.
Hi, This sounds like a different problem. I suspect that there is some interaction issues, that you maybe need to remove "device umass" from the kernel and remove "/boot/kernel/umass.ko" so that the umass is not trying to access the device while VirtualBox does. I don't remember right now if the FreeBSD virtualbox USB backend detach the kernel drivers or not. --HPS
A commit references this bug: Author: jkim Date: Mon Dec 1 21:23:05 UTC 2014 New revision: 373722 URL: https://svnweb.freebsd.org/changeset/ports/373722 Log: Fix crash with USB devices attached. PR: 194196 Changes: head/emulators/virtualbox-ose/Makefile head/emulators/virtualbox-ose/files/patch-src-VBox-Devices-USB-freebsd-USBProxyDevice-freebsd.cpp
(In reply to Hans Petter Selasky from comment #13) > Created attachment 149966 [details] > New USB patch > > Hi, > > Replace > "files/patch-src-VBox-Devices-USB-freebsd-USBProxyDevice-freebsd.cpp" using > this attachment and try again! > > Issue #1) > Change wrong callback area size from "sizeof(PUSBPROXYDEVFBSD)" into > "sizeof(USBPROXYDEVFBSD)" > > Issue #2) > Implement new "usbProxyFreeBSDWakeup" callback function. > > Issue #3) > Don't free the private USB data in the USB close function. Good catch! It worked for me.
(In reply to Hans Petter Selasky from comment #17) > Hi, > > This sounds like a different problem. I suspect that there is some > interaction issues, that you maybe need to remove "device umass" from the > kernel and remove "/boot/kernel/umass.ko" so that the umass is not trying to > access the device while VirtualBox does. I don't remember right now if the > FreeBSD virtualbox USB backend detach the kernel drivers or not. > > --HPS Unfortunately removing umass from the kernel does not solve the problem for me. The stick works in the same way with or without umass. Regards Maurizio
I'll see if I can find some time to test USB in VirtualBox a bit more ...