If you want to use USB devices in a VirtualBox VM running Windows as a guest on an Ubuntu host, you need to enable USB support. Here’s how you can set it up.
Step 1: Install the VirtualBox Extension Pack
To enable USB 2.0 and 3.0 support in VirtualBox, you need to install the
VirtualBox Extension Pack. This package can be installed through the
Ubuntu Software Center, using the terminal, or by downloading it directly
from the Oracle
VirtualBox download page.
- Make sure to download the Extension Pack that matches the version of VirtualBox installed on your system. You can check the installed version of VirtualBox in the Help > About VirtualBox menu.
- All virtual machines must be powered off before proceeding with the installation of the Extension Pack.
Step 2: Add your user to the vboxusers group on the host
Regardless of how you've installed the Extension Pack, your Ubuntu user account must be added to the vboxusers group. Here’s how to do it:
-
Open a terminal and past the following command:
After executing the command, reboot Ubuntu to apply the changes.sudo adduser $USER vboxusers
-
Once Ubuntu has restarted, open the terminal again to verify that your
user has been successfully added to the vboxusers group. Your username
will appear at the beginning of the terminal prompt (e.g.,
johndoe@machineName if your username for login is johndoe).
To check the groups your user is part of, run the following command:
You should see an output similar to this:groups
Ensure that vboxusers is included in the list.johndoe adm cdrom sudo dip plugdev lpadmin lxd sambashare vboxusers
Step 3: Activate USB Support in VirtualBox Manager
With your virtual machine powered off, go to the USB settings tab in the VirtualBox Manager. Ensure that Enable USB Controller is checked, and select either USB 2.0 (EHCI) Controller or USB 3.0 (xHCI) Controller, depending on your needs. If these options are greyed out, it means your virtual machine is not fully shut down.
Step 4: Start the Virtual Machine
-
To use a USB device in a virtual machine, right-click on the USB icon in
the lower panel of the VirtualBox Manager or select it from the Devices
menu.
Once selected, the USB device will be immediately accessible by the guest.
A Windows guest may require additional drivers:- Windows 7 requires an additional driver for USB 3.0 support
- Windows 10 not support NTFS-formatted USB drives
- If your USB device does not appear in the list, VirtualBox might not have access to the USB devices on your host Ubuntu machine. Ensure that your user is added to the vboxusers group and that you have rebooted your host.
- Remember: simultaneous access to a USB device is not allowed. Be careful with USB devices that are currently in use on the host. For example, if you allow your guest to connect to a USB hard disk that is currently mounted on the host, when the guest is activated, it will be disconnected from the host without a proper shutdown. This may cause data loss.
Step 5: [Optional] Add USB Device Filters for Persistent Access
This feature allows VirtualBox to automatically capture and assign specified USB devices to your VM whenever they are plugged in or when VM starts.
-
In the USB setting tab, click the Add Filter button (the icon with a USB
plug and a green plus sign).
From the list of available devices, choose the USB device you want to automatically be presented to the VM. - Optionally, customize the filter to match certain attributes, such as the device's vendor ID, product ID, or serial number.
- Note: some devices may lead to a boot failure of the guest. We can not add these devices to USB Device filters.
For more detailed information on USB support in VirtualBox, refer to the official VirtualBox User Manual.
Succesfully tested on Ubuntu 18.04, 20.04, 22.04 LTS (64-bit) with VirtualBox 6.1.50.During my research I found out that the problem also occurs on other Linux distros, such as Manjaro and Mint. Let me know in the comments below if this solution works. Thanks
Comments
Post a Comment