【发布时间】:2015-06-02 14:48:28
【问题描述】:
很长一段时间以来(大约 2 周),我第一次重新启动了 iMac。当我尝试通过homestead up 重新启动我的宅基地箱时,我收到了这个错误:
Vagrant cannot forward the specified ports on this VM, since they
would collide with some other application that is already listening
on these ports. The forwarded port to 80 is already in use
on the host machine.
To fix this, modify your current projects Vagrantfile to use another
port. Example, where '1234' would be replaced by a unique host port:
config.vm.network :forwarded_port, guest: 8000, host: 1234
Sometimes, Vagrant will attempt to auto-correct this for you. In this
case, Vagrant was unable to. This is usually because the guest machine
is in a state which doesn't allow modifying port forwarding.
我没有其他虚拟盒子在运行。我跑了sudo lsof -i :80,得到了以下列表:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
Google 391 jamesspence 85u IPv4 0xe9a8a2357c33587 0t0 TCP 192.168.1.84:49665->ord08s12-in-f28.1e100.net:http (ESTABLISHED)
Google 391 jamesspence 86u IPv4 0xe9a8a235682a727 0t0 TCP 192.168.1.84:49666->ord31s22-in-f6.1e100.net:http (ESTABLISHED)
Google 391 jamesspence 249u IPv4 0xe9a8a234f7d0247 0t0 TCP 192.168.1.84:49215->ec2-54-82-95-91.compute-1.amazonaws.com:http (ESTABLISHED)
httpd 1240 root 5u IPv6 0xe9a8a234f7e08a7 0t0 TCP *:http (LISTEN)
httpd 1241 _www 5u IPv6 0xe9a8a234f7e08a7 0t0 TCP *:http (LISTEN)
“Google”进程似乎是 Chrome,因为杀死它会杀死我的浏览器。 Apache2 似乎也在这个端口上运行。所以,用sudo apachectl stop 停止它似乎有帮助。当我这样做时,我通过了端口冲突阶段。但是,然后我的虚拟盒子在形成连接时挂断了:
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
我已经无计可施了。不到 24 小时前,我的 vagrant box 运行良好,没有问题。我不知道从哪里开始。有人知道我接下来应该做什么吗?
【问题讨论】: