Fixed an issue where VirtualBox shared folders were locked / could not be opened on Ubuntu 21.04

Are you running Ubuntu as a virtual machine through VirtualBox? You may encounter permission issues to access the shared folder between the host and guest.

Shared folders are a useful feature for file synchronization between the Virtualbox host and the guest operating system. However, after creation, the shared folder will display a cross icon and a lock icon. Also, when I try to open it, an error dialog is displayed.

Unhandled error message: GDBus.Error: org.freedesktop.PolicyKit1.Error.Failed: The Unix process subject does not have a uid set.

Fixed an issue where VirtualBox shared folders were locked / could not be opened on Ubuntu 21.04

Alternatively, you can see permission issues when accessing from the left pane of the file manager.

You do not have the necessary permissions to view the contents of “xxx”

Fixed an issue where VirtualBox shared folders were locked / could not be opened on Ubuntu 21.04

Fixes shared folder permissions issues.

Shared folders belong to vboxsf A group of guests. All you need to do is add your users to this group.

There are several ways to add users to a group. Here we do it with one command.

  1. First, start the virtual machine and log in.
  2. Open a terminal window from the System App Launcher.
  3. When the terminal opens, run the command to see your username in case you don’t remember it.
    whoami
  4. Finally, add the user to the vboxsf group (replace USER_NAME with the one output by the last command).
    sudo adduser USER_NAME vboxsf

Fixed an issue where VirtualBox shared folders were locked / could not be opened on Ubuntu 21.04

Reboot the VM to apply your changes and have fun!

Share this:

  • More
Sidebar