VirtualBox Shared Folder File Permissions

VirtualBox is really great software for virtualizing systems on desktops. One nice feature is shared folders, which avoids needing to configure networking to access files outside the virtual machine (VM).

One challenge with shared folders is the folder is auto-mounted by VirtualBox as executable, which plays havoc with file permissions. From within the guest VM all files are executable even when they are not executable on the host.

I configure VirtualBox to auto-mount shared folders. To avoid the executable nuisance I use the following in the VM’s rc.local:

    umount /media/sf_tmp
    mount -t vboxsf -o noexec,rw tmp /media/sf_tmp

In this example the host system's /tmp directory is shared. The noexec option avoids the executable file permission problem.

I could configure VirtualBox to not auto-mount. In that case I would need only the second line in rc.local.

Posted: Category: Tutorial Tagged: General

Next: The Root Cause of the Equifax Data Breaches

Previous: Creating a Guest Account