Ask HN: How do you sync your source tree from the host to the VM?

3 points by chadaustin ↗ HN
It seems like syncing source between the host and VM should be a solved problem by now, but I've yet to find something that satisfies all of my use cases.

NFS/Samba with the source hosted on the host machine means that git/search operations inside the VM are slow and don't get file change notifications.

NFS hosted by the guest prevent Atom and VS Code from using filesystem change events to keep their UI in sync. Also tools like ag and git are slow.

Periodic (or change-triggered) rsync is too high-latency for huge source trees. Ideally, within 100 ms of saving a source file in your editor, it would be available on the VM.

Surely there's a tool that, on both the host and the guest, 1) rapidly keeps source trees in sync 2) provides filesystem change events and 3) has great performance and sync latency... Conflicts aren't an issue - they can be be resolved arbitrarily as long as the trees are eventually in sync.

What do _you_ do here?

2 comments

[ 3.0 ms ] story [ 18.5 ms ] thread
Something I'm working on on the side is a way to run my sandbox in a Docker container inside a Linux desktop environment without any VM at all.

If I can get this working, my source code will just be a bind mount that's accessable on both sides of the barrier.

The last major hitch I need to sort out is that our MySQL configuration is massively slower when run inside a Docker container. I haven't figured out why yet.

I hate Vagrant, but the rsync-auto command built into Vagrant gives me sub 100ms sync times on a tree of 6,000 files. rsync is fine with the right settings.