我希望有人能帮忙,因为我不知道如何解决这个问题!
我正在使用Vagrant和VirtualBox来运行Chef配方。基本上,该配方将在Windows 2012计算机上创建用户。
然而,我的问题是当我输入vagrant reload --provision(或除了停止之外的任何其他vagrant命令)时,
主机执行以下操作: -
D:\cookbook-core>vagrant reload --provision
==> default: Loading Berkshelf datafile...
==> default: Sharing cookbooks with VM
==> default: Attempting graceful shutdown of VM...
==> default: Forcing shutdown of VM...
==> default: Clearing any previously set forwarded ports...
==> default: Updating Vagrant's Berkshelf...
==> default: Resolving cookbook dependencies...
==> default: Fetching 'core' from source at .
==> default: Using apt (2.6.1)
==> default: Using chef-client (4.2.4)
==> default: Using chef_handler (1.1.6)
==> default: Using chocolatey (0.2.1)
==> default: Using core (0.0.1) from source at .
==> default: Using cron (1.6.1)
==> default: Using hipchat (0.4.0)
==> default: Using hostsfile (2.4.5)
==> default: Using logrotate (1.8.0)
==> default: Using minitest-handler (1.3.2)
==> default: Using ms_dotnet2 (1.0.0)
==> default: Using ms_dotnet4 (1.0.2)
==> default: Using ms_dotnet45 (2.0.0)
==> default: Using ohai (2.0.2) from git@github.com:JustGiving/cookbook-ohai.git (at master)
==> default: Using powershell (3.0.7)
==> default: Using sudo (2.7.1)
==> default: Using sysctl (0.6.2)
==> default: Using users (1.7.0)
==> default: Using windows (1.36.6)
==> default: Vendoring apt (2.6.1) to c:/Users/aebirim/.berkshelf/vagrant-berkshelf/shelves/berkshelf20150312-3420-1mj6gii-default/apt
==> default: Vendoring chef-client (4.2.4) to c:/Users/aebirim/.berkshelf/vagrant-berkshelf/shelves/berkshelf20150312-3420-1mj6gii-default/chef-client
==> default: Vendoring chef_handler (1.1.6) to c:/Users/aebirim/.berkshelf/vagrant-berkshelf/shelves/berkshelf20150312-3420-1mj6gii-default/chef_handler
==> default: Vendoring chocolatey (0.2.1) to c:/Users/aebirim/.berkshelf/vagrant-berkshelf/shelves/berkshelf20150312-3420-1mj6gii-default/chocolatey
==> default: Vendoring core (0.0.1) to c:/Users/aebirim/.berkshelf/vagrant-berkshelf/shelves/berkshelf20150312-3420-1mj6gii-default/core
==> default: Vendoring cron (1.6.1) to c:/Users/aebirim/.berkshelf/vagrant-berkshelf/shelves/berkshelf20150312-3420-1mj6gii-default/cron
==> default: Vendoring hipchat (0.4.0) to c:/Users/aebirim/.berkshelf/vagrant-berkshelf/shelves/berkshelf20150312-3420-1mj6gii-default/hipchat
==> default: Vendoring hostsfile (2.4.5) to c:/Users/aebirim/.berkshelf/vagrant-berkshelf/shelves/berkshelf20150312-3420-1mj6gii-default/hostsfile
==> default: Vendoring logging (0.0.1) to c:/Users/aebirim/.berkshelf/vagrant-berkshelf/shelves/berkshelf20150312-3420-1mj6gii-default/logging
==> default: Vendoring logrotate (1.8.0) to c:/Users/aebirim/.berkshelf/vagrant-berkshelf/shelves/berkshelf20150312-3420-1mj6gii-default/logrotate
==> default: Vendoring minitest-handler (1.3.2) to c:/Users/aebirim/.berkshelf/vagrant-berkshelf/shelves/berkshelf20150312-3420-1mj6gii-default/minitest-handler
==> default: Vendoring ms_dotnet2 (1.0.0) to c:/Users/aebirim/.berkshelf/vagrant-berkshelf/shelves/berkshelf20150312-3420-1mj6gii-default/ms_dotnet2
==> default: Vendoring ms_dotnet4 (1.0.2) to c:/Users/aebirim/.berkshelf/vagrant-berkshelf/shelves/berkshelf20150312-3420-1mj6gii-default/ms_dotnet4
==> default: Vendoring ms_dotnet45 (2.0.0) to c:/Users/aebirim/.berkshelf/vagrant-berkshelf/shelves/berkshelf20150312-3420-1mj6gii-default/ms_dotnet45
==> default: Vendoring ohai (2.0.2) to c:/Users/aebirim/.berkshelf/vagrant-berkshelf/shelves/berkshelf20150312-3420-1mj6gii-default/ohai
==> default: Vendoring powershell (3.0.7) to c:/Users/aebirim/.berkshelf/vagrant-berkshelf/shelves/berkshelf20150312-3420-1mj6gii-default/powershell
==> default: Vendoring sudo (2.7.1) to c:/Users/aebirim/.berkshelf/vagrant-berkshelf/shelves/berkshelf20150312-3420-1mj6gii-default/sudo
==> default: Vendoring sysctl (0.6.2) to c:/Users/aebirim/.berkshelf/vagrant-berkshelf/shelves/berkshelf20150312-3420-1mj6gii-default/sysctl
==> default: Vendoring users (1.7.0) to c:/Users/aebirim/.berkshelf/vagrant-berkshelf/shelves/berkshelf20150312-3420-1mj6gii-default/users
==> default: Vendoring windows (1.36.6) to c:/Users/aebirim/.berkshelf/vagrant-berkshelf/shelves/berkshelf20150312-3420-1mj6gii-default/windows
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 22 => 2222 (adapter 1)
==> 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: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
==> default: Machine booted and ready!
GuestAdditions versions on your host (4.3.12) and guest (4.3.8) do not match.
The guest's platform is currently not supported, will try generic Linux method...
Downloading VirtualBox Guest Additions ISO from http://download.virtualbox.org/virtualbox/4.3.12/VBoxGuestAdditions_4.3.12.iso
Progress: 100% (Rate: 20.5M/s, Estimated time remaining: --:--:--)
Copy iso file C:/Users/aebirim/.vagrant.d/tmp/VBoxGuestAdditions_4.3.12.iso into the box /tmp/VBoxGuestAdditions.iso
/bin/sh: sudo: command not found
Installing Virtualbox Guest Additions unknown - guest version is 4.3.8
/bin/sh: sudo: command not found
/bin/sh: sudo: command not found
Cleaning up downloaded VirtualBox Guest Additions ISO...
bash.exe: warning: could not find /tmp, please create!
==> default: Checking for guest additions in VM...
==> default: Mounting shared folders...
default: /tmp/vagrant-chef/7ceb72d4e097eb60d8a5bb90970df99d/cookbooks => C:/Users/aebirim/.berkshelf/vagrant-berkshelf/shelves/berkshelf20150312-3420-1mj6gii-default
这是我的流浪文件: -
Vagrant.configure(2) do |config|
config.vm.box = "win2012"
config.vm.box_url = "http://box.dev.ju.service/win2012.box"
config.winrm.username = "vagrant"
config.winrm.password = "vagrant"
config.vm.guest = :windows
config.windows.halt_timeout = 15
config.ssh.insert_key = false
config.vm.provider :virtualbox do |vb|
vb.gui = true
end
config.vm.provision :chef_zero do |chef|
chef.log_level = :info
chef.data_bags_path = 'data_bags'
#chef.provisioning_path = '/tmp/vagrant-chef-2'
#chef.environment = 'dev'
chef.encrypted_data_bag_secret_key_path = "D:/tmp/vagrant-chef-2/encrypted_data_bag_secret"
chef.run_list = [
"recipe[users]",
"recipe[core::default]"
]
end
end
VM已启动,但正如您从输出中看到的那样,Vagrant会永久挂起安装共享文件夹(即使我根据文档禁用了安装)并且没有超过此部分,因此未配置chef-solo我的厨师食谱没有运行。我正在使用VirtualBox 4.3.12运行Vagrant 1.7.2。我正在尝试创建的VM是Windows 2012的一个盒子。