I am trying to figure out If I am capable of having symlinks in my shared folder when booting up a vm.
I currently have a project with a few symlinks in the library directory which I would like to edit on the fly and see the changes on the vm.
I can't seem to figure this out. I have a feeling it's not possible. The symlinks do not exist.
config.vm.share_folder "k5", "/projects", "/Users/slik/projects"
config.vm.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root", "1"]
If you are using the Vagrant VirtualBox provider, then VirtualBox shared folders are the default synced folder type. These synced folders use the VirtualBox shared folder system to sync file changes from the guest to the host and vice versa.
Another issue is the lack of support for proper symlinks in Windows, and a default Vagrant setup won't allow you to create symlinks in shared/sync'd folders when running on a Windows host. Thankfully, we've found a way aroundthese issues.
To my knowledge /vagrant in "VBoxInternal2/SharedFoldersEnableSymlinksCreate//vagrant" specifies the shared folder in which symlinks are allowed. v-root specifies the root of the vm. Furthermore symlinks are activated by default for v-root.
You MUST run the GitBash as "Admin" user because it seems that Usermanagement in Windows just allows the symlink creation for "Admin" users *2) Afterwards you should be able to log into the vagrant box and create symlinks inside shared folders which showup in Windows explorer as .symlink files.
You just have to add the setextradata parameter for every shared folder mount.
config.vm.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/k5", "1"]
Or from the command line
VBoxManage setextradata <VM Name> VBoxInternal2/SharedFoldersEnableSymlinksCreate/<volume> 1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With