Linux EACCESHigh

How to Fix 'Permission denied' Error in VirtualBox on Linux

The article explains why the 'Permission denied' error occurs in VirtualBox on Linux and provides proven solutions, including adding users to the vboxusers group and configuring permissions.

Updated at February 16, 2026
5-10 minutes
Easy
FixPedia Team
Применимо к:Ubuntu 20.04+Debian 10+Fedora 34+Arch Linux

What the EACCES Error Means

The EACCES (Permission denied) error in VirtualBox on Linux indicates that the current user lacks the necessary permissions to access required resources. This is a Linux system error that occurs when attempting read, write, or execute operations without appropriate permissions. In the context of VirtualBox, it typically appears when:

  • Starting a virtual machine via the graphical interface or VBoxManage.
  • Attempting to access virtual disk files (VDI, VMDK, etc.).
  • Interacting with the /dev/vboxdrv device, which manages the hypervisor.

The full error text may vary: VERR_ACCESS_DENIED, Could not open the medium, or simply Permission denied. The problem is critical, as it completely blocks the use of VirtualBox.

Causes

The Permission denied error in VirtualBox on Linux occurs due to the following reasons:

  1. User not added to the vboxusers group — the primary cause. The vboxusers group grants access to the /dev/vboxdrv device and other VirtualBox resources.
  2. Incorrect permissions on virtual machine files — if the VM was created by root or another user, the current user cannot access them.
  3. SELinux or AppArmor blocking — security systems may prohibit VirtualBox from accessing files or devices.
  4. Missing or incorrect permissions on /dev/vboxdrv — the kernel driver device may be missing or belong to another group.
  5. Incomplete VirtualBox installation — kernel modules (DKMS) are not compiled or loaded.

Solution 1: Adding the User to the vboxusers Group

This is the primary and most common solution. The vboxusers group grants access to the VirtualBox hypervisor.

Steps:

  1. Open the terminal (Ctrl+Alt+T or via the applications menu).
  2. Check the current user's groups:
    groups
    
    If vboxusers is not in the output, proceed to the next step.
  3. Add the user to the vboxusers group:
    sudo usermod -aG vboxusers $USER
    
    Enter the administrator password when prompted. The -aG flag adds the user to the group without removing them from other groups.
  4. Apply the changes:
    • Option A (recommended): Reboot the computer:
      sudo reboot
      
    • Option B: If you do not want to reboot, run:
      newgrp vboxusers
      
      This applies the group to the current terminal session. For the graphical interface, a reboot or logout/login is still required.
  5. Verify the result:
    groups
    
    vboxusers should appear in the list.
  6. Launch VirtualBox — the error should disappear.

⚠️ Important: A reboot is mandatory for graphical applications after being added to the group. Without it, VirtualBox may continue to operate under the old session.

Solution 2: Fixing Permissions on Virtual Machine Files

If a VM was created by root (e.g., via sudo VirtualBox), its files are owned by root, and a regular user cannot access them.

Steps:

  1. Locate the virtual machines folder. By default:
    • ~/VirtualBox VMs/ for user VMs.
    • /var/lib/virtualbox/ for global VMs (if created by root).
  2. Determine file ownership:
    ls -la /path/to/vm/folder
    
    If the owner is root, change it:
    sudo chown -R $USER:$USER /path/to/vm/folder
    
    The -R flag recursively applies to all files and folders.
  3. Check access permissions:
    ls -ld /path/to/vm/folder
    
    Ensure the user has read/write permissions (e.g., drwxr-xr-x).
  4. Launch VirtualBox — the VM should open without errors.

Solution 3: Configuring SELinux or AppArmor

On distributions with SELinux (Fedora, CentOS, RHEL) or AppArmor (Ubuntu, Debian), security systems may block VirtualBox's access to files or devices.

For SELinux:

  1. Check SELinux status:
    sestatus
    
    If Enabled, temporarily disable it for testing:
    sudo setenforce 0
    
    If the error disappears, SELinux is the issue. For a permanent solution, configure policies:
    sudo ausearch -m avc -ts recent | audit2allow -M virtualbox
    sudo semodule -i virtualbox.pp
    
    Or disable SELinux (not recommended):
    sudo nano /etc/selinux/config
    
    Change SELINUX=enforcing to SELINUX=disabled, then reboot.

For AppArmor:

  1. Check AppArmor profiles:
    sudo apparmor_status
    
    If there is a profile for VirtualBox (/etc/apparmor.d/usr.bin.VirtualBox), disable it:
    sudo aa-disable /usr/bin/VirtualBox
    
    Or reboot for changes to take effect.

Solution 4: Reinstalling VirtualBox and Kernel Modules

If the issue is related to a missing or incorrectly loaded vboxdrv kernel module.

Steps:

  1. Ensure the module is loaded:
    lsmod | grep vbox
    
    If the output is empty, the module is not loaded.
  2. Reinstall the DKMS package (for automatic module compilation):
    • Ubuntu/Debian:
      sudo apt-get update
      sudo apt-get install --reinstall virtualbox-dkms
      
    • Fedora:
      sudo dnf reinstall virtualbox
      
    • Arch Linux:
      sudo pacman -S virtualbox-host-modules-arch
      
  3. Compile and load the module:
    sudo modprobe vboxdrv
    
    If the command fails, check logs:
    sudo dmesg | grep vbox
    
  4. Check permissions on /dev/vboxdrv:
    ls -l /dev/vboxdrv
    
    It should be: crw-rw---- 1 root vboxusers ... /dev/vboxdrv. If the group is not vboxusers, fix it:
    sudo chown root:vboxusers /dev/vboxdrv
    sudo chmod 660 /dev/vboxdrv
    
  5. Reboot the system and try launching VirtualBox.

Prevention

To avoid the Permission denied error in VirtualBox on Linux in the future:

  • During VirtualBox installation, always add the current user to the vboxusers group (many installers do this automatically, but verify).
  • Never run VirtualBox as root via sudo — this creates VM files owned by root, causing problems later.
  • Regularly update VirtualBox and kernel modules via your distribution's package manager.
  • For new virtual machines, ensure the storage folder is owned by your user (e.g., ~/VirtualBox VMs/).
  • When using external disks or network shares, check their access permissions.

Following these steps will ensure stable operation of VirtualBox on Linux without access errors.

F.A.Q.

Why does the 'Permission denied' error occur in VirtualBox on Linux?
How to add the current user to the vboxusers group?
What to do if the 'Permission denied' error persists after adding to the group?
Can I run VirtualBox with sudo instead of adding to the group?

Hints

Check membership in the vboxusers group
Add the user to the vboxusers group
Apply group changes
Launch VirtualBox
FixPedia

Free encyclopedia for fixing errors. Step-by-step guides for Windows, Linux, macOS and more.

© 2026 FixPedia. All materials are available for free.

Made with for the community