vagrant - Vagrant ssh 在成功启动主机后挂起
问题描述
下面是我的 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
解决方案
推荐阅读
- javascript - 使用条件过滤项目(vue.js)
- javascript - 云功能触发时子集合 Firestore 获取文档 ID
- reporting-services - SSRS 将分钟更改为日、小时和分钟
- c++ - 尝试使用 switch 和 if 语句创建日历来检查用户输入,然后输出日期
- java - Gradle 在编译任务中使用 jar-with-dependencies
- clojure - 如何在 clojure 中记住 api 响应?
- pentaho - Pentaho 数据集成为列中每个分隔值的新行
- function - 为什么 ocaml 忽略一个功能而其余的都做?
- sql - 有没有办法在sql中将varchar转换为int值?
- c - 如何在C中复制空字符串中的字符?