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

廉价感情. 提交于 2019-12-02 13:57:28

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

user6131640

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.

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

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 :-)

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.

I was facing same issue on Windows 10. Removing the below line helped me to fix the issue

Directory: C:\Users\xxxxxxxxxxxxx.vagrant.d\boxes\manageiq-VAGRANTSLASH-euwe\5.1.0\virtualbox

File: VagrantFile

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

Next Steps:

Save the file Open cygwin terminal Go to vagrant directory Run "vagrant up"

I was able to fix this problen using another bos from C:\Users{your_username}.vagrant.d\boxes\box\subfolder\virtualbox\Vagrantfile

And adding

# Load include vagrant file if it exists after the auto-generated
# so it can override any of the settings

include_vagrantfile = File.expand_path("../include/_Vagrantfile", __FILE__)

load include_vagrantfile if File.exist?(include_vagrantfile)

I've tried the advises above but it didn't help. I use Windows 7, vagrant 1.9.1 As vm box I use centos 7 without guest addition installed.

vm.box = "centos/7"

To resolve this issue change clean 'vm.box' to box with preinstalled guest addition, for example

vm.box = "geerlingguy/centos7"

And also make sure there is no vbguest plugin installed because another error appears

vagrant plugin list

vagrant plugin uninstall vagrant-vbguest

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!