Skip to content

Instantly share code, notes, and snippets.

@bkonetzny
Last active December 20, 2017 12:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bkonetzny/41221d5ad0e87f8690472f09fd8a5818 to your computer and use it in GitHub Desktop.
Save bkonetzny/41221d5ad0e87f8690472f09fd8a5818 to your computer and use it in GitHub Desktop.
Vagrant synced folders with symlinks
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
if !Vagrant::Util::Platform.windows?
# On Mac, use NFS
config.vm.synced_folder ".", "/vagrant", type: "nfs", mount_options: ['rw', 'vers=3', 'tcp', 'fsc', 'actimeo=1']
else
# On Windows, use SMB
# Needs to run CMD as admin for SMB share to work.
# Use "mklink /d <Link> <Target>" on Windows to create symlink which also works in guest
config.vm.synced_folder ".", "/vagrant", type: "smb", owner: "www-data", group: "www-data", mount_options: ['vers=3.02', 'mfsymlinks', 'dir_mode=0777', 'file_mode=0777']
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment