Recently I wanted to build a virtual machine with Debian 8, PostgreSQL and Python, to import some data. I use Windows as my main operating system, plus VirtualBox for virtualization, and my best option to create the virtual machine recipe (vagrantfile) was Vagrant, because AZK didn’t support Windows (at the moment of writing, still doesn’t). With the recipe, I could deliver to my client a virtual machine ready for development and production environments.

I went through some problems, which were specific to the Vagrant 1.8.1 and Windows (7 and 10) mix, and I would like to share the solutions that I found to solve everything.

The first problem was the “‘rsync’ could not be found on your path. Make sure that rsync is properly installed on your system and available on the PATH” error.

The solution was to install Cygwin, checking the openssh and rsync options. I also had to insert a new environment variable called HOME, with %USERPROFILE% as value.

vagrant-erro2

Finally, I’ve edited the C:\cygwin64\etc\nsswitch.conf file, inserting the line below:

The second problem was the “rsync error: error in rsync protocol data stream (code 12) at io.c(226) [sender=3.1.1]” error, as the image below shows:

vagrant-erro1

The solution was to edit the C:\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.8.1\plugins\synced_folders\rsync\helper.rb file, commenting the lines of the snippet below:

The third error was the “==> default: stdin: is not a tty“, and the solution was to add the snippet below on the vagrantfile:

With all this, my recipe worked normally on Vagrant and the virtual machine was created with everything I wanted. Here is the final recipe:

Leave a Reply

Your email address will not be published. Required fields are marked *

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.