Enabling USB Device Support in VirtualBox for Ubuntu Virtual Machines
To use USB devices (e.g., flash drives, cameras) in an Ubuntu virtual machine (VM) hosted on VirtualBox, you need to configure USB controller settings, adjust user permissions, and ensure proper installation of VirtualBox extensions. Below are the step-by-step requirements and solutions:
The VirtualBox Extension Pack is required to enable USB 2.0/3.0 support (critical for faster data transfer with modern devices).
Before connecting a USB device, configure the VM to recognize USB controllers:
vboxusers
GroupBy default, VirtualBox runs with restricted permissions, preventing direct access to USB devices. Adding your user to the vboxusers
group grants the necessary access:
$USER
with your username if needed):sudo usermod -aG vboxusers $USER
orsudo gpasswd --add $USER vboxusers
Once the above steps are complete, connect the USB device to the VM:
Ubuntu typically auto-mounts USB devices to the desktop or file manager. If not:
lsblk
to identify the device (e.g., /dev/sdb1
)./mnt/usb
) and mount the device:sudo mkdir /mnt/usb
sudo mount /dev/sdb1 /mnt/usb
/mnt/usb
directory. To unmount, use sudo umount /mnt/usb
.vboxusers
group. Restart VirtualBox and the VM after making changes.groups $USER
to verify) and ensure the device is not mounted on the host OS before connecting it to the VM.By following these steps, you can successfully enable USB device support in VirtualBox for Ubuntu VMs, allowing seamless access to external storage, peripherals, and other USB-enabled devices.