为什么vagrant up返回与rsync相关的错误?

时间:2016-06-04 22:47:57

标签: debian vagrant virtualbox

我正在尝试修改official rancherOS box中的Vagrantfile以便同步目录。运行vagrant up后,我收到以下错误:

$ vagrant up
Bringing machine 'rancher-01' up with 'virtualbox' provider...
==> rancher-01: Importing base box 'rancherio/rancheros'...
==> rancher-01: Matching MAC address for NAT networking...
==> rancher-01: Checking if box 'rancherio/rancheros' is up to date...
==> rancher-01: Setting the name of the VM: rancherOS_rancher-01_1465080074345_77008
==> rancher-01: Clearing any previously set network interfaces...
==> rancher-01: Preparing network interfaces based on configuration...
    rancher-01: Adapter 1: nat
    rancher-01: Adapter 2: hostonly
==> rancher-01: Forwarding ports...
    rancher-01: 22 (guest) => 2222 (host) (adapter 1)
==> rancher-01: Running 'pre-boot' VM customizations...
==> rancher-01: Booting VM...
==> rancher-01: Waiting for machine to boot. This may take a few minutes...
    rancher-01: SSH address: 127.0.0.1:2222
    rancher-01: SSH username: rancher
    rancher-01: SSH auth method: private key
    rancher-01: Warning: Remote connection disconnect. Retrying...
    rancher-01: 
    rancher-01: Vagrant insecure key detected. Vagrant will automatically replace
    rancher-01: this with a newly generated keypair for better security.
    rancher-01: 
    rancher-01: Inserting generated public key within guest...
    rancher-01: Removing insecure key from the guest if it's present...
    rancher-01: Key inserted! Disconnecting and reconnecting using new SSH key...
==> rancher-01: Machine booted and ready!
==> rancher-01: Setting hostname...
==> rancher-01: Configuring and enabling network interfaces...
==> rancher-01: Rsyncing folder: /tank/sentimens/ => /home/rancher/data
There was an error when attempting to rsync a synced folder.
Please inspect the error message below for more info.

Host path: /tank/sentimens/
Guest path: /home/rancher/data
Command: rsync --verbose --archive --delete -z --copy-links --no-owner --no-group --rsync-path sudo rsync -e ssh -p 2222 -o ControlMaster=auto -o ControlPath=/tmp/ssh.675 -o ControlPersist=10m -o StrictHostKeyChecking=no -o IdentitiesOnly=true -o UserKnownHostsFile=/dev/null -i '/tank/lthibault/Vagrant/rancherOS/.vagrant/machines/rancher-01/virtualbox/private_key' --exclude .vagrant/ /tank/sentimens/ rancher@127.0.0.1:/home/rancher/data
Error: Warning: Permanently added '[127.0.0.1]:2222' (ECDSA) to the list of known hosts.
rsync: This rsync lacks old-style --compress due to its external zlib.  Try -zz.
rsync error: syntax or usage error (code 1) at main.c(1554) [server=3.1.1]
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(226) [sender=3.1.1]

为什么会发生这种情况,我该如何解决? Google最无益。

  • OS:debian jessie
  • Vagrant 1.8.1

Vagrantfile如下:

# -*- mode: ruby -*-
# vi: set ft=ruby :

require_relative 'vagrant_rancheros_guest_plugin.rb'

# To enable rsync folder share change to false
$rsync_folder_disabled = true
$number_of_nodes = 1
$vm_mem = "1024"
$vb_gui = false


# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
  config.vm.box   = "rancherio/rancheros"
  config.vm.box_version = ">=0.4.1"

  config.vm.synced_folder "/tank/sentimens", "/data"

  (1..$number_of_nodes).each do |i|
    hostname = "rancher-%02d" % i

    config.vm.define hostname do |node|
        node.vm.provider "virtualbox" do |vb|
            vb.memory = $vm_mem
            vb.gui = $vb_gui
        end

        ip = "172.19.8.#{i+100}"
        node.vm.network "private_network", ip: ip
        node.vm.hostname = hostname

        # Disabling compression because OS X has an ancient version of rsync installed.
        # Add -z or remove rsync__args below if you have a newer version of rsync on your machine.
        node.vm.synced_folder ".", "/opt/rancher", type: "rsync",
            rsync__exclude: ".git/", rsync__args: ["--verbose", "--archive", "--delete", "--copy-links"],
            disabled: $rsync_folder_disabled

    end
  end
end

0 个答案:

没有答案