Create symlink inside Virtual Machine (Virtual Box) Host’s shared folder

Many of you folks had faced this issue while installing Node.js and its other module inside the shared folder of Host especially when host is Windows based machine and guest is Linux.

Here is the trick :-
  1. Shutdown or halt your VM.
  2. Go inside your Virtual Box installed folder (default location: C:Program FilesOracleVirtualBox)
  3. Execute this command to list your VMs
    1. vboxmanage list vms
    2. Output will be something like this :
      • “Lubuntu” {199bfa3d-ee72-4685-bf7d-9ec52e3a7de4}
  4. Take a note of that VM name (in this case its Lubuntu)
  5. Now Execute this command :-
    • VBoxManage setextradata Lubuntu VBoxInternal2/SharedFoldersEnableSymlinksCreate/vagrant 1
    • *Note that Instead of Lubuntu enter your VM name and vagrant will be replaced by your shared folder.
    • You can also verify the added configuration by executing this command:
    • VBoxManage getextradata Lubuntu enumerate
  6. Now start your VM as Administrator, I usually do that via command line so even if you want to start your VM as Admin via command line just open Command Prompt as Administrator.
  7. Now if you want to create any symbolic link inside shared folder it will be able to do that. Like you are inside your shared folder (on Linux) and try to enter this command it will successfully create it:
    • ln -s /path/to/actual/folder link_name
  8. If any problem persists then you can ask me out in comments!