0

I'm on Windows 10. I have a vagrant box, with the following vagrantfile configuration:

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

  config.hostmanager.enabled = true
  config.hostmanager.manage_host = true
  config.hostmanager.ignore_private_ip = false
  config.hostmanager.include_offline = true

  # Every Vagrant virtual environment requires a box to build off of.
  config.vm.box = "ubuntu/trusty64"

  # Create a private network, which allows host-only access to the machine using a specific IP.
  config.vm.network "private_network", ip: "192.168.33.22"
  config.vm.hostname = "test.local"

  # Share an additional folder to the guest VM. The first argument is the path on the host to the actual folder.
  # The second argument is the path on the guest to mount the folder.
  config.vm.synced_folder "./", "/var/www/html", type: "virtualbox" 

  # Define the bootstrap file: A (shell) script that runs after first setup of your box (= provisioning)
  config.vm.provision :shell, path: "bootstrap.sh"

end

By this:

config.vm.synced_folder "./", "/var/www/html", type: "virtualbox" 

naturally there is the public_html folder within the main vagrant file folder. The structure is the following:

enter image description here

This works by default, however I wanted to make a junction of a different folder to the e:\vagrant\lamp\public_html folder, but I get a protocol error.

I ran the following command to create the junction:

mklink /J e:\vagrant\lamp\public_html\ c:\xxx\xyz\public_html\

Of course in windows it works, if I open the public_html I get the junctioned content, however the VM machine cannot access that.

This is what I see when I try to access it via SSH:

enter image description here

cannot read symbolic link public_html: Protocol error

I wonder, is there a way to access the junctioned synced folder within the vagrant box? Is this a permission issue, or something more?

Thanks for your help :)

Ernest Marcinko
  • 405
  • 3
  • 12

1 Answers1

0

In the meantime I have found a possible solution. Changing your synced folder type to SMB seems to solve the issue:

config.vm.synced_folder "./", "/var/www/html", type: "smb", mount_options: ["vers=3.02", "mfsymlinks"]

So far it looks good, but I'm open to other solutions as well.

Ernest Marcinko
  • 405
  • 3
  • 12