我在相當長的一段時間(例如2周)第一次重新啓動了iMac。當我試圖通過homestead up
重新啓動我的家園中,我得到這個錯誤:端口80上的端口碰撞
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)
「谷歌」的過程似乎是瀏覽器,因爲它殺死殺死我的瀏覽器。 Apache2也似乎在這個端口上運行。所以,暫停sudo apachectl stop
似乎有所幫助。當我這樣做的時候,我經過了港口碰撞階段。然而,然後我的虛擬箱掛起形成一個連接:
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
我在我的智慧結束在這裏。不到24小時前,我的流浪者箱子運行得很好,沒有問題。我不知道該從哪裏開始。有人知道我下一步該做什麼嗎?
但問題是,它正在到達該訪客端口,試圖轉發它並拋出錯誤。更改主機端口並不能解決任何問題。 –
你能分享你的Vagrantfile嗎?我相信答案就在那裏,因爲你的解決方案看起來有點冒險,而不是真正的解決方案。 –
我正在使用[Laravel Homestead](http://laravel.com/docs/5.0/homestead),它具有我未觸及的預配置VagrantFile。 –