2

在 Mac OS X 上,当尝试按照 Vagrant 教程使用厨师进行配置时,我收到以下错误。如果我改用 puppet,会出现同样的问题,如果我使用 lucid32,也会出现同样的问题。帮助?

[default] Importing base box 'lucid64'...
[default] The guest additions on this VM do not match the install version of
VirtualBox! This may cause things such as forwarded ports, shared
folders, and more to not work properly. If any of those things fail on
this machine, please update the guest additions and repackage the
box.

Guest Additions Version: 4.1.16
VirtualBox Version: 4.1.18
[default] Matching MAC address for NAT networking...
[default] Clearing any previously set forwarded ports...
[default] Forwarding ports...
[default] -- 22 => 2222 (adapter 1)
[default] Creating shared folders metadata...
[default] Clearing any previously set network interfaces...
[default] Booting VM...
[default] Waiting for VM to boot. This can take a few minutes.
[default] VM booted and ready for use!
[default] Mounting shared folders...
[default] -- v-root: /vagrant
[default] Running provisioner: Vagrant::Provisioners::ChefSolo...
[default] Generating chef JSON and uploading...
[default] Running chef-solo...
stdin: is not a tty
[Mon, 30 Jul 2012 08:55:18 +0200] INFO: *** Chef 0.10.10 ***
[Mon, 30 Jul 2012 08:55:18 +0200] INFO: Setting the run_list to ["recipe[vagrant_main]"] from JSON
[Mon, 30 Jul 2012 08:55:18 +0200] INFO: Run List is [recipe[vagrant_main]]
[Mon, 30 Jul 2012 08:55:18 +0200] INFO: Run List expands to [vagrant_main]
[Mon, 30 Jul 2012 08:55:18 +0200] INFO: Starting Chef Run for lucid64
[Mon, 30 Jul 2012 08:55:18 +0200] INFO: Running start handlers
[Mon, 30 Jul 2012 08:55:18 +0200] INFO: Start handlers complete.
[Mon, 30 Jul 2012 08:55:18 +0200] INFO: Processing execute[apt-get update] action run (apt::default line 20)
[default] Destroying VM and associated drives...
/Library/Ruby/Gems/1.8/gems/net-ssh-2.2.2/lib/net/ssh/ruby_compat.rb:33:in `select': closed stream (IOError)
    from /Library/Ruby/Gems/1.8/gems/net-ssh-2.2.2/lib/net/ssh/ruby_compat.rb:33:in `io_select'
    from /Library/Ruby/Gems/1.8/gems/net-ssh-2.2.2/lib/net/ssh/ruby_compat.rb:32:in `synchronize'
    from /Library/Ruby/Gems/1.8/gems/net-ssh-2.2.2/lib/net/ssh/ruby_compat.rb:32:in `io_select'
    from /Library/Ruby/Gems/1.8/gems/net-ssh-2.2.2/lib/net/ssh/transport/packet_stream.rb:73:in `available_for_read?'
    from /Library/Ruby/Gems/1.8/gems/net-ssh-2.2.2/lib/net/ssh/transport/packet_stream.rb:85:in `next_packet'
    from /Library/Ruby/Gems/1.8/gems/net-ssh-2.2.2/lib/net/ssh/transport/session.rb:171:in `poll_message'
    from /Library/Ruby/Gems/1.8/gems/net-ssh-2.2.2/lib/net/ssh/transport/session.rb:166:in `loop'
    from /Library/Ruby/Gems/1.8/gems/net-ssh-2.2.2/lib/net/ssh/transport/session.rb:166:in `poll_message'
    from /Library/Ruby/Gems/1.8/gems/net-ssh-2.2.2/lib/net/ssh/connection/session.rb:451:in `dispatch_incoming_packets'
    from /Library/Ruby/Gems/1.8/gems/net-ssh-2.2.2/lib/net/ssh/connection/session.rb:213:in `preprocess'
    from /Library/Ruby/Gems/1.8/gems/net-ssh-2.2.2/lib/net/ssh/connection/session.rb:197:in `process'
    from /Library/Ruby/Gems/1.8/gems/net-ssh-2.2.2/lib/net/ssh/connection/session.rb:161:in `loop'
    from /Library/Ruby/Gems/1.8/gems/net-ssh-2.2.2/lib/net/ssh/connection/session.rb:161:in `loop_forever'
    from /Library/Ruby/Gems/1.8/gems/net-ssh-2.2.2/lib/net/ssh/connection/session.rb:161:in `loop'
    from /Library/Ruby/Gems/1.8/gems/net-ssh-2.2.2/lib/net/ssh/connection/channel.rb:269:in `wait'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/communication/ssh.rb:213:in `shell_execute'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/communication/ssh.rb:53:in `execute'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/communication/ssh.rb:110:in `connect'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/communication/ssh.rb:52:in `execute'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/communication/ssh.rb:72:in `sudo'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/provisioners/chef_solo.rb:196:in `run_chef_solo'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/provisioners/chef_solo.rb:189:in `times'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/provisioners/chef_solo.rb:189:in `run_chef_solo'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/provisioners/chef_solo.rb:96:in `provision!'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/vm/provision.rb:34:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/vm/provision.rb:31:in `each'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/vm/provision.rb:31:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/vm/forward_ports.rb:24:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/vm/check_port_collisions.rb:42:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/env/set.rb:16:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/vm/clear_forwarded_ports.rb:13:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/vm/clean_machine_folder.rb:17:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/vm/check_accessible.rb:18:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/general/validate.rb:13:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/general/check_virtualbox.rb:23:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/vm/match_mac_address.rb:16:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/vm/default_name.rb:17:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/vm/check_guest_additions.rb:33:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/vm/import.rb:31:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/vm/check_box.rb:28:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/vm/check_accessible.rb:18:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/general/validate.rb:13:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/general/check_virtualbox.rb:23:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/builder.rb:92:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/runner.rb:49:in `run'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/util/busy.rb:19:in `busy'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/runner.rb:49:in `run'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/vm.rb:192:in `run_action'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/vm.rb:145:in `up'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/command/up.rb:31:in `execute'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/command/base.rb:116:in `with_target_vms'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/command/base.rb:111:in `each'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/command/base.rb:111:in `with_target_vms'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/command/up.rb:24:in `execute'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/cli.rb:42:in `execute'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/environment.rb:167:in `cli'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/bin/vagrant:43
    from /usr/bin/vagrant:23:in `load'
    from /usr/bin/vagrant:23
4

2 回答 2

2

https://github.com/mitchellh/vagrant/issues/516上有一张公开的票

对我有用的是以下内容:

  1. 更新到VirtualBox 4.1.20(从 4.1.18 在 Ubuntu 12.04 主机上运行)
  2. 更新了所有gem(我使用 rbenv。值得注意的是我的net-ssh gem 已经过时了)
  3. 使用https://github.com/jedi4ever/veewee/blob/master/doc/vagrant.md上的说明创建了一个新的 basebox

我不再遇到“关闭的流(IOError)”问题,并且可以毫无问题地进行多 VM vagrant 部署。

于 2012-08-30T10:57:18.557 回答
0

见:https ://github.com/dcarley/vbox_natbug

config.vm.define :ubuntu_amd do |c|
  c.vm.box = "lucid64"
  c.vm.customize(["modifyvm", :id, "--nictype1", "Am79C973"])
end

也许它可以帮助...

于 2013-01-20T15:06:30.640 回答