Vagrant with VirtualBox on Windows10: "Rsync" could not be found on your PATH

44,369

Solution 1

I found in another forum that the local Vagrant directory is mounted as "/vagrant" via rsync. This is set in the box itself, you can check by opening

C:\Users\{your_username}\.vagrant.d\boxes\debian-VAGRANTSLASH-jessie64\8.2.2\virtualbox\Vagrantfile

and see the setting

  config.vm.synced_folder \
    ".",
    "/vagrant",
    type: "rsync"

to get around this I added the following line in my local Vagrantfile

  config.vm.synced_folder ".", "/vagrant", type: "virtualbox"

and the error was resolved

Solution 2

I have solved this issue as below when use cent/7 at Windows 7.

Check the box synced_folder at C:\Users[username]\.vagrant.d\boxes\centos-VAGRANTSLASH-7\1602.02\virtualbox\Vagrantfile

config.vm.synced_folder ".", "/home/vagrant/sync", type: "rsync"   

Override the defition at project Vagrantfile for directory mapping.

config.vm.synced_folder ".", "/home/vagrant/sync", type: "virtualbox"  

I imagine the box might be prepared at non Windows system, this case can be happened on many boxes, such as fedora/23-cloud-base.

Solution 3

Seems like a bug. You can report it here. But it seems that your bug has been already reported as the issue 6631.

Nevertheless you can try to add rsync to your PATH and check the result. You can do it in 2 ways:

  1. Install Cygwin and then launch vagrant up from its Cygwin Terminal
  2. Download & unpack cwRsync

Solution 4

First of all this is not a bug it is expected behavior on Windows because the rsync is absent on Windows.

If you faced with this problem and want to use the rsync as a mechanism to sync folders you should:

  1. Download the Cygwin from https://mingw-w64.org/doku.php/download/cygwin
  2. Install the Cygwin with rsync + openssh modules. It's important bacause they is basent on a Window (you may select packages to install during installation on the Select packages phase)
  3. Add x:\cygwin\bin, where 'x' is the drive on which you have installed the cygwin distribution, to the SYSTEM PATH.
  4. Reboot your PC (not need on Windows 10)

That's all.

Thank you for your attention and have a nice day :-)

Solution 5

Using Vagrant/VirtualBox (5.06) on Windows7 with centos/7 box from Atlas: could not find rsync on the path. So, I installed via cygwin as suggested (had other stuff to install as well, including openssh). No joy. Tried changing the shared folder config to "virtualbox" rather than "rsync". No joy. Oh, forgot to check if the VirtualBox guest additions were in the box: they were not. Rsync worked bettter, but still chocked at the end (could not chdir to the source directory of the shared folder). However, the "type: virtualbox" config did work!

So the datapoint is: centos/7 with guest additions added and shared folder type set to "virtualbox" (overriding the box setting) on windows 7 works.

Worked out of the box (no changes, no guest additions) on MacOS.

Share:
44,369

Related videos on Youtube

Stefan H
Author by

Stefan H

Updated on July 05, 2022

Comments

  • Stefan H
    Stefan H almost 2 years

    I've used Vagrant for a while on a windows 7 system. Now I've a new PC with windows 10. I installed Oracle Virtual Box and Vagrant and I try to start a machine with the command vagrant up. The Vagrantfile is the same file that I used on my windows 7 system. This is the content of the Vagrantfile:

    Vagrant.configure(2) do |config|
    config.vm.box = "debian/jessie64"
    
    config.vm.provider "virtualbox" do |v|
        v.customize ["modifyvm", :id, "--memory", "768"]
    end
    config.vm.provision :shell, path: "bootstrap.sh"
    
    config.vm.network :private_network, ip: "172.27.146.17"
    config.vm.hostname = "www.delevensstijl.hst1.nl"
    config.hostsupdater.aliases = ["www.thelifestylemethod.hst1.nl"]
    
    end
    

    this is the error i get

    The error I get: "rsync" could not be found on your PATH. Make sure that rsync is properly installed on your system and available on the PATH.

    Why is Vagrant looking for rsync since I use Virtualbox? How can I workaround this error?

    • xverges
      xverges almost 7 years
      Stefan, it would be community friendly to accept an answer that has obviously helped lots of people and that answer your question
  • Stefan H
    Stefan H over 8 years
    I missed this note at the latest debian/jessie vagrant box: switch to rsync as default method for synced folders, because vboxfs requires contrib or non-free packages So, the update to a new version of debian/jessie was the reason I needed rsync
  • Vladislav Rastrusny
    Vladislav Rastrusny over 8 years
    I have the same error message on CentOS official box (centos/7). Cygwin has rsync package inside the installer when it shows you the list of additional packages to install.
  • David
    David over 8 years
    @VladislavRastrusny try bento/centos-7.1, which has the VirtualBox guest additions pre-installed
  • Vladislav Rastrusny
    Vladislav Rastrusny over 8 years
    @David. Yep, switched to it until native image is fixed. If it ever be at all ;)
  • Till Kuhn
    Till Kuhn about 8 years
    Good advise +1, I had the same issue on centos/7 which uses a different path on the guest, so the equivalent line in your local Vagrantfile would be config.vm.synced_folder ".", "/home/vagrant/sync", disabled: true
  • Daniel Watrous
    Daniel Watrous over 7 years
    The latest release of the centos/7 image changed the default sync directory to /vagrant, so you will need to update the folder reference shown in @TillKuhn comment above config.vm.synced_folder ".", "/vagrant", disabled: true seven.centos.org/2016/08/…
  • absurd
    absurd about 7 years
    Most helpful answer if you have installed cygwin or mobaxterm anyway! For mobaxterm default installation, the path to add is C:\Users\<username>\Documents\MobaXterm\slash\bin. For me it's enough to add this to PATH, SYSTEM PATH is not needed.
  • Marcos Regis
    Marcos Regis about 7 years
    This issue can ocourr after a box update. The Vagrantfile file change from current runing box.
  • TomasH
    TomasH over 6 years
    Would like to add that after updating the vagrant box, when vagrant wants to boot the updated version, Vagrantfile in the path mentioned by Rath is what comes with the box (and therefore may contain value not compatible with your environment). Additionally you can simply change the value from rsync to virtualbox (if virtualbox is your VM engine).