I'm trying to sync a folder in my host OSX to a VM running Ubuntu. (laravel/homestead). This is the command I run on my host:

$ unison ssh://vagrant@ ~/unison/www -repeat watch

which produces the following output

Contacting server...
Connected [...]
Looking for changes
  Waiting for changes from server
Fatal error: Server: Unexpected response 'Usage: unison-fsmonitor [options] root [path] [path]...' from the filesystem watcher (expected VERSION)

On my localhost:

$ unison -version
unison version 2.48.3
$ unison-fsmonitor

On my VM:

$ unison -version
unison version 2.48.3
$ unison-fsmonitor
Usage: unison-fsmonitor [options] root [path] [path]...
This program monitors file system changes on all given (relative to root) paths
and dumps paths (relative to root) files to a file. When launched, this file is
recreated. While running new events are added. This can be read by UNISON
to trigger a sync on these files. If root is a valid unison profile, we attempt
to read all the settings from there.

For my localhost, I installed unison via homebrew, and downloaded the unox.py file from github and installed it to /usr/local/bin/unison-fsmonitor.

For my VM, I used ppa:eugenesan/ppa for unison, and downloaded the source for version 2.48.3 from the unison website to get a copy of fsmonitor.py, which I placed under /usr/bin/unison-fsmonitor.

Unison without -repeat watch works without issues.

I get the same output if I try to run the same command (reversing the ssh) form inside the VM. I've read that the unison-fsmonitor should comply with the protocol described in /src/fswatch.ml and this doesn't seem to be the case for the default fsmonitor.py script. Am I missing something? Is there another script that should be used for the unison-fsmonitor executable instead?


When you compile Unison from source, there is a separate executable unison-fsmonitor that is created. When you run this unison-fsmonitor it prints VERSION 1 and then waits as expected. Just compile Unison on your VM and use that executable instead of the fsmonitor.py script.

You can see in the change-log for Unison 2.48.3 that they created a new file-watcher utility. It's not clear to me why fsmonitor.py is included in this release if you are supposed to use the new utility. Or maybe the new utility and the python script actually perform different tasks ... ?

  • Thanks! Compiling from source on the VM solved the issue as you stated. – Martín Peverelli Apr 11 '16 at 20:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.