0
儘管閱讀本流浪VirtualBox的名字貼到默認
How to change Vagrant 'default' machine name?
我的主機名是堅持default
這裏是我的Vagrantfile:
Vagrant.configure(2) do |config|
config.vm.box = "hashicorp/precise32"
config.vm.hostname = "web"
config.vm.network :private_network, ip: "10.0.0.10"
config.vm.provider :virtualbox do |vb|
vb.name = "vagrant-web"
end
end
但
$ vagrant status
Current machine states:
default running (virtualbox)
和
$ vagrant ssh web
The machine with the name 'web' was not found configured for
this Vagrant environment.
但
$ vagrant ssh default
工作正常。我做了vagrant halt
和vagrant up
。還有其他建議嗎?
在短短插話。重命名'.vagrant /機/ default'文件夾到'.vagrant/machines/your_custom_name'將會起作用,只要它與'config.vm.define'中的名字一致即可。 – user6616962