1

ホームパスにない限り、Vagrantは起動しません。

[ruby-1.9.3-p286] ~ cat Vagrantfile 
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant::Config.run do |config|
  config.vm.box = "precise32"
end
[ruby-1.9.3-p286] ~ vagrant up
[default] Importing base box 'precise32'...
[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.2.0
VirtualBox Version: 4.1.12
[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
[ruby-1.9.3-p286] ~ vagrant destroy
Are you sure you want to destroy the 'default' VM? [Y/N] Y
[default] Forcing shutdown of VM...
[default] Destroying VM and associated drives...
[ruby-1.9.3-p286] ~ 

vagrant upホームパスから実行すると、正常に起動します。しかし、vagrant up別のサブディレクトリから実行すると、起動しません。私が使用するVagrantfileはまったく同じなので、ちょっと奇妙です。

[ruby-1.9.3-p286] ~ 
[ruby-1.9.3-p286] ~ cd dev_vm 
[ruby-1.9.3-p286] ~/dev_vm cat Vagrantfile 
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant::Config.run do |config|
  config.vm.box = "precise32"
end
[ruby-1.9.3-p286] ~/dev_vm vagrant up
[default] VM already created. Booting if it's not already running...
[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.
The VM failed to remain in the "running" state while attempting to boot.
This is normally caused by a misconfiguration or host system incompatibilities.
Please open the VirtualBox GUI and attempt to boot the virtual machine
manually to get a more informative error message.
[ruby-1.9.3-p286] ~/dev_vm 
[ruby-1.9.3-p286] ~/dev_vm 

Virtualbox UI から手動で起動しようとしましたが、空白の画面しか表示されません。私はおそらく何かが欠けていると思います。

4

2 に答える 2

3

export VAGRANT_LOG=debug、これは私に試してみるメッセージを示しましvagrant destroyvagrant up。そして、VM が適切に起動しました。何が問題なのかを理解するのはまだ奇妙です。

于 2012-11-19T18:27:58.600 に答える