all&all

CoreOS Windows Vagrant File Sharing

As soon as one turns on the file sharing settings detailed on the CoreOS Vagrant into, you invariably end up with the following error:

No synced folder implementation is available for your synced folders!
Please consult the documentation to learn why this may be the case.
You may force a synced folder implementation by specifying a "type:"
option for the synced folders. Available synced folder implementations
are listed below.

docker, nfs, rsync, smb, virtualbox

How do we fix this?

The rsync Fix

Steps to set up rsync:

  • Download cygwin
  • Be sure to install rsync on the cygwin packages selection screen (its under Net)
  • After install, add the c:/cygwin64/bin dir to your PATH

Great! Now that we have rsync installed, let’s modify our Vagrantfile to use it– we’re going to go from:

config.vm.synced_folder ".", "/home/core/share", id: "core", :nfs => true,  :mount_options   => ['nolock,vers=3,udp']

to:

config.vm.synced_folder ".", "/home/core/share", id: "core", type: "rsync", rsync__auto: "true"

Great! So we vagrant destroy && vagrant up to totally delete and reprovision/restart our VMs and we get…

rsync: change_dir "/c/Users/micah/coreos-vagrant" failed: No such file or directory (2)

RRRRRRRGHGHGHGH!!!

Fortunately the fix for this is pretty simple, near the top of your Vagrantfile, add the line:

ENV["VAGRANT_DETECTED_OS"] = ENV["VAGRANT_DETECTED_OS"].to_s + " cygwin"

Done! Note that I had to restart my PC for it to entirely work for me.

“Auto Syncing”

To make it automatically sync up, you want to have one shell window open with vagrant rsync-auto running, outside of your shell where you’re doing vagrant ssh.

comments powered by Disqus