Mac上对外壳配置程序的无所适从失败

时间:2018-09-16 19:19:59

标签: vagrant vagrantfile vagrant-provision

我在ubuntu 18.04中有一个无所事事的(bento / ubuntu-18.04)虚拟盒子,效果很好(https://github.com/rajcspsg/VBoxes/tree/master/Kafka-schema-registry)。

在Mac OS中,同一框出现故障。

错误是-

$ vagrant up
Bringing machine 'zookeeper1' up with 'virtualbox' provider...
==> zookeeper1: Importing base box 'bento/ubuntu-18.04'...
==> zookeeper1: Matching MAC address for NAT networking...
==> zookeeper1: Checking if box 'bento/ubuntu-18.04' is up to date...
==> zookeeper1: Setting the name of the VM: kafka-platform_zookeeper1_1537124362203_1672
==> zookeeper1: Fixed port collision for 22 => 2222. Now on port 2201.
==> zookeeper1: Clearing any previously set network interfaces...
==> zookeeper1: Preparing network interfaces based on configuration...
    zookeeper1: Adapter 1: nat
    zookeeper1: Adapter 2: hostonly
==> zookeeper1: Forwarding ports...
    zookeeper1: 22 (guest) => 2201 (host) (adapter 1)
==> zookeeper1: Running 'pre-boot' VM customizations...
==> zookeeper1: Booting VM...
==> zookeeper1: Waiting for machine to boot. This may take a few minutes...
    zookeeper1: SSH address: 127.0.0.1:2201
    zookeeper1: SSH username: vagrant
    zookeeper1: SSH auth method: private key
    zookeeper1:
    zookeeper1: Vagrant insecure key detected. Vagrant will automatically replace
    zookeeper1: this with a newly generated keypair for better security.
    zookeeper1:
    zookeeper1: Inserting generated public key within guest...
    zookeeper1: Removing insecure key from the guest if it's present...
    zookeeper1: Key inserted! Disconnecting and reconnecting using new SSH key...
==> zookeeper1: Machine booted and ready!
==> zookeeper1: Checking for guest additions in VM...
    zookeeper1: The guest additions on this VM do not match the installed version of
    zookeeper1: VirtualBox! In most cases this is fine, but in rare cases it can
    zookeeper1: prevent things such as shared folders from working properly. If you see
    zookeeper1: shared folder errors, please make sure the guest additions within the
    zookeeper1: virtual machine match the version of VirtualBox you have installed on
    zookeeper1: your host and reload your VM.
    zookeeper1:
    zookeeper1: Guest Additions Version: 5.2.18
    zookeeper1: VirtualBox Version: 5.1
==> zookeeper1: Setting hostname...
==> zookeeper1: Configuring and enabling network interfaces...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

/sbin/ifdown 'eth1' || true
/sbin/ip addr flush dev 'eth1'
# Remove any previous network modifications from the interfaces file
sed -e '/^#VAGRANT-BEGIN/,$ d' /etc/network/interfaces > /tmp/vagrant-network-interfaces.pre
sed -ne '/^#VAGRANT-END/,$ p' /etc/network/interfaces | tac | sed -e '/^#VAGRANT-END/,$ d' | tac > /tmp/vagrant-network-interfaces.post

cat \
  /tmp/vagrant-network-interfaces.pre \
  /tmp/vagrant-network-entry \
  /tmp/vagrant-network-interfaces.post \
  > /etc/network/interfaces

rm -f /tmp/vagrant-network-interfaces.pre
rm -f /tmp/vagrant-network-entry
rm -f /tmp/vagrant-network-interfaces.post

/sbin/ifup 'eth1'

Stdout from the command:

Stderr from the command:

bash: line 4: /sbin/ifdown: No such file or directory
bash: line 20: /sbin/ifup: No such file or directory

如果我评论shell provision,则虚拟框也可以正常工作。 我不确定为什么启动外壳程序时会导致外壳设置失败。

任何建议为何会出现此错误。

0 个答案:

没有答案