<div class="markdown">
<blockquote>
<p dir="auto">Hi team,</p>

<p dir="auto">I had some queries and was seeking some opinions on <a href="https://github.com/projectatomic/adb-atomic-developer-bundle/issues/118">https://github.com/projectatomic/adb-atomic-developer-bundle/issues/118</a> about mounted volumes not being accessible from the host</p>

<p dir="auto">It says,<br>
Mounted volumes on Docker containers should be accessible from the Host VM, so a user can deploy his application from his IDE on the Host VM into the mounted volume (ie, a specific directory in the host VM) and the application server in the Docker container will be able to pick the changes automatically.</p>

<p dir="auto">The way I understand, what we are trying to achieve is:</p>

<p dir="auto">Mounting volumes from host to guest (problem), then guest to Docker containers (not a problem)</p>
</blockquote>

<p dir="auto">If we don't have two-way sync we won't be completive with docker-machine-like setups.</p>

<p dir="auto">If it is only one-way there is no way to get the output of a docker container easily on to my host disk nor<br>
is it easy to use existing tools on host to get data into to docker containers.</p>

<blockquote>
<p dir="auto">One way sync from host to guest:</p>

<p dir="auto">Linux: This is what Vagrant does by default (rsync), and as already pointed out on the GitHub issue page, <code>vagrant rsync-auto</code> can be used for a continuous one way sync</p>

<p dir="auto">Windows: rsync will have to be packaged with the installer (Cygwin has it?) (not tested rsync, yet)</p>
</blockquote>

<p dir="auto">could be a fallback - I would prefer it not to be default.</p>

<blockquote>
<p dir="auto">Two way sync from host to guest:</p>

<p dir="auto">Solution 1 - SSHFS (vagrant-sshfs plugin) (testing in progress)</p>

<p dir="auto">Pros:<br>
- One solution for all platforms</p>

<p dir="auto">Cons:<br>
- No longer maintained, so it has to be maintained by us since it might break with future Vagrant versions<br>
- Performance issues (high latency, reliable over heavy load?) since it's working over SSH<br>
- SSH server has to be packaged with the Windows installer</p>
</blockquote>

<p dir="auto">How is security handled here ? how is the vagrant box able to connect to the host ? do users need to configure<br>
username/passwords ?</p>

<blockquote>
<p dir="auto">--</p>

<p dir="auto">Solution 2 - NFS (Linux + Mac) and SMB (Windows)</p>

<p dir="auto"><a href="https://www.vagrantup.com/docs/synced-folders/nfs.html">https://www.vagrantup.com/docs/synced-folders/nfs.html</a><br>
<a href="https://www.vagrantup.com/docs/synced-folders/smb.html">https://www.vagrantup.com/docs/synced-folders/smb.html</a></p>

<p dir="auto">Pros:<br>
- Maintained by Vagrant, so easier to maintain. Also, this will have more testing and user feedback backing it than our customized vagrant-sshfs plugin will have.<br>
- Works out of the box, just one <code>vagrant up</code><br>
- No tinkering required on the Windows host (but NFS server required on Linux and Mac hosts)</p>
</blockquote>

<p dir="auto">Mac has smb built in afaik. don't know about NFS - but if users need to install it this feels doomed since<br>
we already have a ton of other things that need to be configured.</p>

<blockquote>
<p dir="auto">Cons:<br>
- The Vagrantfile gets a bit typical to understand, but can we also make this solution into a plugin (don't know how that works)?<br>
- Multiple solutions for one problem, but both of these are well built in and their implementation (mounts) is automated and hidden away from the end user, so no change in the user experience, rather it is more seamless<br>
- Vagrant is not 'supposed' to maintain these in the future, but if we have to maintain the solution, then why not this than vagrant-sshfs?</p>

<p dir="auto">I have tried out the second solution and the resultant Vagrantfile might look something like this,<br>
<a href="https://raw.githubusercontent.com/containscafeine/dots/master/Vagrantfile">https://raw.githubusercontent.com/containscafeine/dots/master/Vagrantfile</a> (please change the mount points according to your environment)</p>

<p dir="auto">This Vagrantfile will not work out of the box since Vagrant does not provision before mounting the synced folders, but it should not matter if cifs-utils is packaged inside the adb vagrant box, so if someone wants to try it:</p>

<p dir="auto">Steps for Windows:<br>
- <code>vagrant up</code><br>
- <code>vagrant provision</code><br>
- <code>vagrant reload</code></p>

<p dir="auto">Steps for Linux:<br>
- Allow incoming connections to the NFS server on the host<br>
- <code>vagrant up</code></p>
</blockquote>

<p dir="auto">I'm not following why the steps are different between the OS's here ? </p>

<p dir="auto">And if users need to learn to run all three vagrant up/provision/reload and different between OS's this is bad/not good either ;/</p>

<p dir="auto">...feels like its time to consider to implement our own guest additions ?</p>

<p dir="auto">/max<br>
<a href="http://about.me/maxandersen">http://about.me/maxandersen</a></p>

</div>