Resolving USB Device Access Issues in VirtualBox on Linux
Problem
Error appears when VirtualBox is open:
VirtualBox is not currently allowed to access USB devices. You can change this by adding your user to the 'vboxusers' group. Please see the user manual for a more detailed explanation.
Result Code:
NS_ERROR_FAILURE (0X00004005)
Component:
HostWrap
Interface:
IHost {e54f6256-97a7-4947-8a78-10c013ddf4b8}
Main cause
VirtualBox requires specific user permissions to access USB devices, which are not set correctly by default. This necessitates adding the user to the vboxusers
group and configuring udev rules to ensure the appropriate permissions and group ownership for USB devices.
Solution
- Open a terminal.
- Add your user to the vboxusers group using the following command (replace your_username with your actual username):
sudo usermod -aG vboxusers your_username
Since your username is 'geek', the command will be:sudo usermod -aG vboxusers geek
- Log out and log back in to apply the group changes.
- Verify the group change with the following command:
groups
This should list vboxusers
among the groups.Once you've completed these steps, VirtualBox should be able to access USB devices. If you've added your user to the vboxusers group and are still encountering issues, there are a few more steps you can take to troubleshoot and resolve the problem:
- Ensure Extension Pack is Installed: The VirtualBox Extension Pack provides support for USB 2.0 and USB 3.0 devices. Make sure you have it installed. You can download it from the VirtualBox website. To install the Extension Pack, follow these steps:
- Download the Extension Pack.
- Open VirtualBox.
- Go to File > Preferences > Extensions.
- Click the + icon and select the downloaded Extension Pack file.
- Check USB Permissions: Sometimes, the USB devices require additional permissions. You can create a udev rule to grant the necessary permissions:
- Create a new udev rules file:
sudo nano /etc/udev/rules.d/60-vboxdrv.rules
- Add the following line to the file:
SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", RUN+="/bin/chmod 0666 %c"
- Save and close the file.
- Reload the udev rules:
sudo udevadm control --reload-rules
sudo udevadm trigger
- Restart VirtualBox and your system:
Sometimes a full system restart is needed to apply the changes correctly.
- Run VirtualBox as Root (for testing purposes only):
To check if the issue is related to permissions, you can try running VirtualBox as root (not recommended for regular use): sudo virtualbox
If it works as root, then the issue is likely related to user permissions or udev rules.
- Check VirtualBox Logs: Look at the VirtualBox logs for more detailed error messages. You can find the logs in the VirtualBox GUI under Show Log in the Machine menu.
After performing these steps, try accessing USB devices again in VirtualBox. Let me know if you need further assistance!