VirtualBox 6: How to enable symlinks for shared folders

For security reasons, creating symbolic links in a shared folder is disabled in the guest OS (ticket 10085 and manual 5.3 Shared Folders). If you trust your Linux guest OS, you can enable symlinking from the host OS with the following command:

~ $ VBoxManage setextradata "VM_Name" VBoxInternal2/SharedFoldersEnableSymlinksCreate/Folder_Name 1

Replace VM_Name and Folder_Name with your own names. To get a list of names of your virtual machines, execute in the host console:

~ $ VBoxManage list vms

You can also list information about a specific machine with:

~ $ VBoxManage showvminfo "VM_Name"

Now you can start your Linux guest OS and create the symbolic link, in my case  I wanted to point my shared folder to the apache directory /var/www/html, e.g.

~ $ sudo ln -s /media/sf_Websites /var/www/html

Note: On a Windows host you need to enable symlinks also on the OS level for the current user, otherwise you have to run VirtualBox with administrator rights, @see How do I create a symlink in Windows

Join the Conversation

6 Comments

Your email address will not be published. Required fields are marked *

  1. Thanks for the idea!

    However 1 more important thing was not mentioned:
    VirtualBox have to be started as Admin after the change.