※ MacOS(ゲストOSはcentos)
vagrant 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 3000 is already in use on the host machine. To fix this, modify your current project's Vagrantfile to use another port. Example, where '1234' would be replaced by a unique host port: config.vm.network :forwarded_port, guest: 3000, 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. You could try 'vagrant reload' (equivalent of running a halt followed by an up) so vagrant can attempt to auto-correct this upon booting. Be warned that any unsaved work might be lost.
もともとのvagrantfileは次のようになっております。
config.vm.network :forwarded_port, guest: 3000, host: 3000
エラー内容の通り、hostを 1234にするとうまくいきましたが、なぜ3000ではダメなのかがわからず困っております。
ちなみに、別のMacで同じようにvagrant upをすると、hostは3000のままで上手くいきました。
そのため、vagrantfileの設定というよりかは、現在使っているPCの他の環境が干渉しているのではないかと思いました。
しかし、それを調べるために、何をして原因調査していけば良いのかがわかりません。
$ netstat
とかして調査しているのをみたことがありますが、こういうふうに調査すればいいのかがわかりません。
宜しくお願いします。
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/08/22 13:32