成功启动主机后,Vagrant ssh挂起

时间:2018-09-06 22:32:43

标签: vagrant vagrantfile

下面是我的Vagrantfile,在启动此主机时,它卡在

  ==> sawtoothclient: Waiting for machine to boot. This may take a few minutes...
      sawtoothclient: SSH address: 127.0.0.1:2222
      sawtoothclient: SSH username: vagrant
      sawtoothclient: SSH auth method: private key

无所事事的重载并没有帮助,我不想每次登录虚拟主机时都无所事事。

VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
    config.vm.define "sawtoothclient", primary: true do |sawtoothclient|

        sawtoothclient.vm.box = "ubuntu/xenial64"
        sawtoothclient.vm.hostname ="sawtoothclient"
        sawtoothclient.vm.network :public_network
        #fubuntuone.vm.provision :shell, :privileged => false, :path => "bootstrap_ubuntu.sh"
        sawtoothclient.vm.synced_folder "/home/feynman/Programs/SawtoothClient/", "/home/vagrant/SawtoothClient/"
        sawtoothclient.vm.provider :virtualbox do |vb|
           vb.gui = false
           vb.memory = 2048
           #vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
           #vb.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
        end

    end
end

我的UFW防火墙规则是

  To                         Action      From
  --                         ------      ----
  Anywhere                   ALLOW       192.168.1.0/24 

但是当我添加

 sudo ufw allow 22

vagrant ssh成功了,我不明白为什么,据我所知,vagrant必须一直使用主机IP SSH进入vagrant主机,该主机已被最初添加到ufw防火墙的防火墙规则所涵盖。

 Vagrant 2.1.4

 vboxmanage -v
 output: 5.2.18r124319

0 个答案:

没有答案