If your data center relies on VirtualBox and your virtual machines rely on USB, you've probably noticed that USB doesn't work unless you enable it. Here's how to do that.
If there's one thing that frustrates VirtualBox users more than anything, it's that USB doesn't work out of the box. No matter how much we'd all like this to to be the case, with every new iteration, the developers continue to keep USB out of the long list of things that just work.
Why would you want or need USB working with VirtualBox? What if you want to backup data to an external drive, or transfer data between virtual machines that aren't on the same subnet? For such instances, having the ability to easily share data via USB could make VirtualBox a significantly easier VM solution.
For those that need USB working on VirtualBox, I'm going to walk you through the process of getting this working. I'll be demonstrating on VirtualBox 5.2 running on an Elementary OS host (based on Ubuntu). The process isn't really challenging, you just have to know what to look for.
SEE: Special report: The cloud v. data center decision (free PDF) (TechRepublic)
With that said, let's take care of this.
Installing the latest version of VirtualBox
The first thing we want to do is make sure to install the latest version of VirtualBox. To do this, remove the current version with the command:
sudo apt purge virtualbox
Once that completes, add the necessary repository with the command:
sudo add-apt-repository "deb http://download.virtualbox.org/virtualbox/debian <UBUNTU-RELEASE> contrib"
Where UBUNTU-RELEASE is the version of Ubuntu you are using. If you're unsure which version of Ubuntu you have installed, issue the command lsb_release -a.
Next, download and install the signature key for the repository with the command:
wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add -
Now we can install the latest release with the following commands:
sudo apt-get update sudo apt install virtualbox-5.2 dkms
Install the Extension Pack
The first thing that must be done is the installation of the VirtualBox Extension Pack. There is a catch here. The open source Extension Pack only supports USB 1.0. If you need USB 2.0 or 3.0 support, you must install the closed source version, released by Oracle. To get the Oracle version, head over to the Downloads page and download the file for All supported platforms. Once that has downloaded, open up VirtualBox and do the following:
- Click File | Preferences
- Click the Extension tab and then click the + button (Figure A)
- Navigate to where you saved the Extension Pack
- Select the Extension Pack and click Open
- When prompted, click the Install button
- Scroll through the EULA and then click I Agree
- Type your sudo password
- Allow the installation to complete
There is one final step for this. In order for VirtualBox to have access to the USB subsystem, the user running VirtualBox must belong to the vboxuser group. To do this, open up a terminal and issue the following command:
sudo usermod -aG vboxusers <USERNAME>
Where USERNAME is the name of the user.
Once the command runs, logout and log back int.
Activate USB support
Open up VirtualBox, right-click on the virtual machine that needs access to USB, and click Settings. In the VM settings window, click USB. You should see that USB is now available. Click on the + button under USB Device Filters to add a new device (Figure B).
When you start up that VM, it will now have access to the USB device. If you need to give it access to more than one USB device, go back into the Settings window of the VM, click on USB, and add the next device. Repeat that until the VM has access to all necessary USB devices (Figure C).
A bit more usable now
Congratulations, VirtualBox is a bit more usable now. You no longer have to jump through hoops to get data from an external device to your VMs (or vice versa). Your data center will thank you for it.
- VirtualBox: Everything the pros need to know (TechRepublic)
- How to connect to a VirtualBox VM desktop remotely (TechRepublic)
- How to manually install the VirtualBox extension pack (TechRepublic)
- How to resize a VirtualBox VM from the command line (TechRepublic)
- How to run Windows 10 on your Mac (ZDNet)