vbox Any way to run vbox guest machines with USB2.0 support for them?

- I have VMs created for VirtualBox (.vbox and .vmdk) under Linux or Windows, many VMs and many OSs, created along the years, these VMs are some sort of "time capsules" for personal projects, with full GUI and many settings inside, they are not headless servers that can be migrated to other forms of isolation.
- this year I've changed my desktop OS from Linux to FreeBSD, so now I need to run those old VMs in FreeBSD
- the guest VMs I already have must handle USB2.0 devices, USB 1.0 or USB 1.1 speed is not enough

Couldn't find any way to run former VirtualBox guests with USB2.0 support for them. They run, but with USB1.1 at most.

What I've done so far:

1). Installed and configured VirtualBox, pkg installed virtualbox-ose and virtualbox-ose-additions (6.1.30), then did all the required setting steps. After this, former vbox machines can run, but only with USB1.1 support. With USB2.0 vbox guests can not be started in FreeBSD.

2). Searched for the cause and found out there is another component that has to be installed inside the VirtualBox host (not to be confused with the VBoxGuestAddition which is to install inside the guest VMs). This component for the host is called Oracle VM Extension Pack, and it's a file of type .vbox-extpack (i.e. Oracle_VM_VirtualBox_Extension_Pack-4.3.16-95972.vbox-extpack)

This extension pack can not be installed in a FreeBSD host, the error message is saying it couldn't find "PUEL", which PUEL is some component written by Oracle and does not work in FreeBSD. This component only works for Windows, Linux, Mac or Solaris.

3). Following existing bug reports filed to Oracle for this extension pack and/or PUEL, I've found in a mailing list that there are no plans from Oracle to provide a "PUEL" component for FreeBSD hosts.

4). Read the handbook Chapter 22. - Virtualisation where I couldn't find any workaround for USB2.0, in fact, as a newcomer I found very confusing that the handbook first say it has USB2.0, but VirtualBox for FreeBSD doesn't support USB2.0
VirtualBox™ is an actively developed, complete virtualization package, that is available for most operating systems including Windows®, macOS®, Linux® and FreeBSD. It is equally capable of running Windows® or UNIX®-like guests. It is released as open source software, but with closed-source components available in a separate extension pack. These components include support for USB 2.0 devices. More information may be found on the Downloads page of the VirtualBox™ wiki. Currently, these extensions are not available for FreeBSD.
The underline text is logically disjointed, and only makes sense for those already familiar with the state of facts. First it's talking about "components" and states that includes USB2.0, then a link to an Oracle wiki page, then says "extensions" not available.

I found that paragraph very misleading, and understood quite contrary at first read, I've understood that USB2.0 would be supported.

Some 1-2 pages later it is stated that USB2.0/3.0 is not available for VirtualBox in FreeBSD, you can say RTFM, but nobody reads manuals in full when first paragraph let one to believe something is supported.

5). Read in the handbook about jails, if I got it right jails are similar with chroots, they are not for virtualisation, as I hoped.

6). Read in the handbook about bhyve and FreeBSD as Xen host, but it was not clear to me if any of these will run vbox machines with USB2.0 support.

I am running FreeBSD bsd 13.0-RELEASE-p4
---------------------------------------

TL;DR
How do I run vbox VMs with FreeBSD as host and USB2.0 support?
VirtualBox-OSE does not have USB2.0 support, so any other ideas or workarounds are welcome.
 
How do I run vbox VMs with FreeBSD as host and USB2.0 support?

VirtualBox-OSE does not have USB2.0 support, so any other ideas or workarounds are welcome.

I can not imagine a workaround. Sorry. You probably already read, at <https://www.freshports.org/emulators/virtualbox-ose/#description>:

For the Extension Pack: FreeBSD is not a supported host platform. Installation of the Pack will not extend the feature set.

It's frustrating, however the port of VirtualBox to FreeBSD is neither developed, nor maintained, by Oracle®.

You're not the first person to find difficulty with wording.
 
… the guest VMs I already have must handle USB2.0 devices, …

I imagine that this is doubly frustrating.



No consolation, but if you do choose to continue with FreeBSD as a host for VirtualBox, you might benefit from this in future FreeBSD guests:

kern.smp.disabled=1

– in the /boot/loader.conf of each guest.

loader.conf(5)
 
When I moved from VMware Player to VirtualBox, there was no problem to run the already existing VMware machines in VirtualBox. It just worked out of the box. Now, I've read about other hypervisers for FreeBSD, like bhyve and FreeBSD as a Xen host.

1. Is it possible to run existing vbox machines with bhyve or Xen?
2. If not, are there any way to import/convert former vbox machines into a format that can be run by bhyve or Xen?

I've read the handbook, and it is not clear for me if that could be a workaround.

Later edit:
To be more direct, my understanding is that for now there are no options to run, for example, a WinXP/32bits + USB2.0 + GUI without VNC or RDP. I don't want to waste a week trying to achieve something that is not yet available. Though, some info I've drawn upon this conclusion is a couple of years old already, and hoping for good news changes since then.

(if I should open another topic for the above two questions, please let me know)
 
1. Is it possible to run existing vbox machines with bhyve or Xen?
No, it's not possible to run existing vbox machines directly with bhyve (I can't tell for Xen), see https://wiki.freebsd.org/bhyve FAQ.

2. If not, are there any way to import/convert former vbox machines into a format that can be run by bhyve or Xen?
Yes, it's possible to convert VirtualBox disks (I can't tell for Xen) into a bhyve supported RAW format (see https://wiki.freebsd.org/bhyve FAQ), e.g.:
Code:
%  qemu-img convert -f vmdk -O raw <vbox disk>.vmdk bhyve.img

The *.img can then be integrated into bhyve and the guest system can be reached by VNC or RDP. I, for example use net/xrdp on the (FreeBSD only) guest systems and net/remmina on the host.

For the USB2.0 problem, if you have a Intel platform which supports IOMMU (a.k.a. VT-d) feature, you could try PCI passthrough of the xhci USB host controller to bhyve to optain USB2.0 (or USB3.0) for the guest. See https://wiki.freebsd.org/bhyve/pci_passthru .

Also the PCI device and driver must support MSI/MSI-x interrupts. Run to check pciconf -lvc. See Thread 67760

for example, a WinXP/32bits
Again, I can't tell fo Xen but only for bhyve and according to https://wiki.freebsd.org/bhyve/Windows WinXP is not supported on bhyve. Supported version are:
Code:
bhyve supports Windows desktop versions Vista, 7, 8/8.1/8.2 and 10, as well as Windows Server versions 2008/2008R2, 2012/2012R2 and 2016 Technical Preview 2 and 3

EDIT: That wiki page is not up to date, Windows 11 is supported as well: Thread ive-declared-8-cores-for-my-bhyve-windows-11-vm-but-it-says-there-is-only-one-allocated.83814
 
Hi! I moved from Linux to FreeBSD on my workstation this year. This alone I moved VB machines. I tried to passthrough the whole PCI controller, but it doesn't work without Oracle extensions. So, no, I guess not possible.
 
Thank you both for confirming that a WinXP/32 + USB2.0 + GUI is not yet possible (no 2D/3D accel needed, but also no VNP or RDP allowed - VNC and RDP are too slow even when used with bare metal installs).

----------------------

I am trying right now a different approach, to trick the VirtualBox's Extension Pack into working on FreeBSD (the extension pack that normally adds all available features, including my wished USB2.0).


The Oracle_VM_VirtualBox_Extension_Pack-6.1.30.vbox-extpack can be downloaded from Oracle, and contains binaries for Solaris, Darwin, Linux and Windows, but not for FreeBSD. That strange .vbox-extpack type can be installed from the VirtualBox GUI menus, but I've tried and it can be also unpacked with Ark.

So far, I've installed the Extension Pack inside VirtualBox, then took a look at the directory tree layout and at the errors. First error was that it can not found VBoxPuelMain a file to be found 4 times, once for each OS.

I've poked at that, and been lucky to trick VirtualBox into making it believing there is a corresponding binary for FreeBSD, too, by doing this:

cd /usr/local/lib/virtualbox/ExtensionPacks/Oracle_VM_VirtualBox_Extension_Pack
mkdir freebsd.amd64
cp linux.amd64/* freebsd.amd64/*


That worked, VirtualBox is now loading and running Extension Pack binaries that were compiled for Linux. :)

Next step, I've made the required settings to enable FreeBSD to run Linux binaries - https://docs.freebsd.org/en/books/handbook/linuxemu/ (I think the FreeBSD name for this is Linuxulator, but I'm very new here, still confusing names and terminology).

Right now I'm stuck with a missing libc.so.6 error (VERR_FILE_NOT_FOUND - Shared object "libc.so.6" not found, required by "VBoxPuelMain.so") like in the attached png,

Err VERR_FILE_NOT_FOUND - libc.so.6 - VboxPuelMain.so.png


though the Linux libc.so.6 is present, more precise a symlink of it exists at /compat/linux/usr/lib64/libc.so.6, pointing to libc-2.17.so

-----------------------

I'm not a software dev, no idea how should I debug this, but so far I've tried to change the brand ELF from SVR4 to Linux, brandelf -t Linux VBoxPuelMain.so, in the hope that this way the missing lib will be found during execution of virtualbox, but it didn't work.

Another try was to put a symlink to /compat/linux/usr/lib64/libc.so.6 in the same directory with /usr/local/lib/virtualbox/ExtensionPacks/Oracle_VM_VirtualBox_Extension_Pack/freebsd.amd64/VBoxPuelMain.so, but the err message is the same.

-----------------------

Next steps I want to try:
- install a full Ubuntu with deboostrap, in the hope that libc.so.6 will somehow become visible to VirtualBox , too
- if not, to force LD_LIBRARY_PATH and alike environment variables, not sure how to do that in such a way that only the Linux library path will be redirected, without changing the FreeBSD libraries path
- learn how to use kdump/ktrace to get more info why the lib is not seen

The goal right now is to make VirtualBox load the Linux version of libc.so.6 and to see what's the next error.

-----------------------

Highly unlikely this approach will ever work, but for now I'm curios to see if it's possible to trick the FreeBSD version of VirtualBox into loading the Extension Pack binaries for Linux, just like VirtualBox would normally do if it were for it to be installed on a normal bare metal Linux machine. :what:
 
An interesting project.

You might be able to load the binary (i.e with the Linux emulation layer) but it is highly likely that the actual code will be using Linux specific stuff deeper down to do the actual passing through of the usb. I.e the raw devices in /dev are likely to be accessed very differently on Linux vs FreeBSD.

However if it uses a higher level abstraction library like libusb, you might be onto a winner if you can get it to call back into the native FreeBSD version of that.

Potentially an option could be a cheap Raspberry Pi running Raspbian with USBIP kernel modules and (i.e https://github.com/cezanne/usbip-win) connecting within the VirtualBox (or Bhyve) across ethernet. Just think of it as a (slightly overengineered) usb hub ;)
 
Potentially an option could be a cheap Raspberry Pi running Raspbian with USBIP kernel modules and (i.e https://github.com/cezanne/usbip-win) connecting within the VirtualBox (or Bhyve) across ethernet. Just think of it as a (slightly overengineered) usb hub

Wow, that's a great idea!

Never used or even tried that before. The request to have USB2.0 is because many of the "time capsules" virtual machines I already have are in fact frozen IDE/toolchains for various microcontrollers and FPGA (hardware) development boards. Those devboards are using USB programmers/debuggers, and it is not unusual to wait about a minute for a firmware or for a bitstream to be downloaded into the devboard, sometimes even more, and that is for normal USB2.0 machines, with USB1.1 will be unusable slow.

A few of those devboards might have proprietary Windows drivers for their embedded programmers, so not sure how USBIP will deal with that, but definetly worth trying.

I would have never thought about rerouting the USB over LAN, thanks for the hint.
 
The request to have USB2.0 is because many of the "time capsules" virtual machines I already have are in fact frozen IDE/toolchains for various microcontrollers and FPGA (hardware) development boards.
Heh, yeah this is a good point. I was in a similar boat not too long ago with an old Keil toolchain and 8051 programmer. Admittedly I do keep an old (Offline!) Windows XP laptop around for this purpose.

There is something about this kind of hardware that tends to always go extremely "old and crusty" and yet still works perfectly well at its original task so why replace it?

There are some alternative toolchains like SDCC that will be possible to get working natively on FreeBSD but (as you may well know) Keil has extensions to the C language (sbit) that causes a little bit of vendor lockin and hardware programmers are shakey at the best of times, just finding one and getting the job done is time consuming enough.
 
Back
Top