我想使用vagrant设置网络服务器,并且我对“ vagrant up”命令有疑问:
首先,我在虚拟机(Virtualbox)上工作,我必须在virtualbox中构建我的流浪者项目,所以我创建了Vagrantfile:
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/trusty32"
config.vm.network "private_network", ip: "192.168.68.8"
config.vm.provider "virtualbox" do |vb|
vb.gui = true
end
config.vm.provision :shell, :path => ".provision/bootstrap.sh"
end
然后,当我执行命令“ vagrant up”时,它挂在最后一行:
zakaria@server:~/webserver$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 80 (guest) => 8080 (host) (adapter 1)
default: 80 (guest) => 8080 (host) (adapter 1)
default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> 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
我鼓励您看的一件事是,如果您打开了HyperV,Vagrant文档专门说要禁用它:https://www.vagrantup.com/docs/installation#windows-virtualbox-and-hyper-v