dotless-de / vagrant-vbguest

A Vagrant plugin to keep your VirtualBox Guest Additions up to date
MIT License
2.88k stars 206 forks source link

Vagrant still falls back to rsync with VBox 5.0.12 Guest Additions installed ok #195

Closed FractalizeR closed 8 years ago

FractalizeR commented 8 years ago
d:\PHPProjects\ootalks\vagrant-php-bootstrap>vagrant reload
==> default: Attempting graceful shutdown of VM...
==> default: Checking if box 'centos/7' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Adapter 2: hostonly
==> default: Forwarding ports...
    default: 80 (guest) => 8080 (host) (adapter 1)
    default: 5432 (guest) => 5432 (host) (adapter 1)
    default: 6379 (guest) => 6379 (host) (adapter 1)
    default: 5672 (guest) => 5672 (host) (adapter 1)
    default: 15672 (guest) => 15672 (host) (adapter 1)
    default: 9300 (guest) => 9200 (host) (adapter 1)
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Warning: Remote connection disconnect. Retrying...
==> default: Machine booted and ready!
GuestAdditions 5.0.12 running --- OK.
==> default: Checking for guest additions in VM...
==> default: Configuring and enabling network interfaces...
==> default: Rsyncing folder: /cygdrive/d/PHPProjects/ootalks/vagrant-php-bootst
rap/ => /home/vagrant/sync
There was an error when attempting to rsync a synced folder.
Please inspect the error message below for more info.

Host path: /cygdrive/d/PHPProjects/ootalks/vagrant-php-bootstrap/
Guest path: /home/vagrant/sync
Command: rsync --verbose --archive --delete -z --copy-links --chmod=ugo=rwX --no
-perms --no-owner --no-group --rsync-path sudo rsync -e ssh -p 2222 -o ControlMa
ster=auto -o ControlPath=C:/Users/Vlad/AppData/Local/Temp/ssh.954 -o ControlPers
ist=10m -o StrictHostKeyChecking=no -o IdentitiesOnly=true -o UserKnownHostsFile
=/dev/null -i 'd:/PHPProjects/ootalks/vagrant-php-bootstrap/.vagrant/machines/de
fault/virtualbox/private_key' --exclude .vagrant/ /cygdrive/d/PHPProjects/ootalk
s/vagrant-php-bootstrap/ vagrant@127.0.0.1:/home/vagrant/sync
Error: rsync: Failed to exec ssh: No such file or directory (2)
rsync error: error in IPC code (code 14) at pipe.c(85) [sender=3.1.0]
rsync: safe_read failed to read 4 bytes [sender]: Resource temporarily unavailab
le (11)
rsync error: error in rsync protocol data stream (code 12) at io.c(251) [sender=
3.1.0]

d:\PHPProjects\ootalks\vagrant-php-bootstrap>
    if OS.windows?
      config.vm.synced_folder project_folder_local, project_local_vm
    else
      config.vm.synced_folder project_folder_local, project_local_vm, type: "nfs", mount_options: ['nolock,vers=3,udp,noatime,actimeo=1']
    end
vinnyrose commented 8 years ago

You haven't provided enough information for me to be sure but it's likely the box has a vagrantfile packaged with it. The load order of configurations prefers a vagrantfile packaged with the box. So, if the box does have a packaged vagrantfile, you will always have to specify a type in your own configuration, you can't rely on default values.

FractalizeR commented 8 years ago

Opps! You are right! This is a vagrant file of the box:

Vagrant.configure("2") do |config|
  config.vm.base_mac = "525400d3eba4"
  config.vm.synced_folder ".", "/home/vagrant/sync", type: "rsync"
end

Should this be reported as a bug? Why rsync type is hardcoded here? This causes problem for Windows users.

vinnyrose commented 8 years ago

This causes problems with all users, not just Windows. I've seen this trend recently with other distributions packing vagrantfiles in the boxes and it caused much confusion when one of our boxes worked one week but not the next. We now have to specify type: "virtualbox" in our VagrantFile, and though that type doesn't seem to be documented anywhere, it works fine.

They are using rsync because they don't have a license to distribute the guest additions iso.

fnordfish commented 8 years ago

Thanks for helping out @vinnyrose!