2016-07-08 5 views
1

最近、VMプロバイダとしてVirtualBoxでVagrantボックスをセットアップしようとしました。 私の最初の試みで、Vagrantはバーチャルボックスを正しく作成しましたが、シェフのエラーのために失敗しました。VirtualBoxで失敗したVagrantを再実行するとエラーが発生する

私はシェフが指し示すエラーを解決し、再び放浪アップコマンドをreranが、私はエラー以下しまったこの時間:

Vagrant cannot forward the specified ports on this VM, since they would collide with some other application that is already listening on these ports.

障害発生時のように思える何が、浮浪者は、それがVBoxのに関連付けられているポートをクリーンアップしませんでした。私はそれが作成したVirtual Boxesディレクトリから.vagrantディレクトリとマシンを削除しようとしました。まだ同じエラーが発生しています。私は迷惑メールファイルのポート転送を変更することでそれを実行できました。

障害発生時に迷惑メール自動修正/消去設定を強制的に行う方法がある場合は教えてください。私は多くの理由で起こる可能性のある失敗時には、悪影響ファイルを変更したくありません。

ありがとうございます。

答えて

2

あなたはhttps://www.vagrantup.com/docs/networking/forwarded_ports.html

It is common when running multiple Vagrant machines to unknowingly create forwarded port definitions that collide with each other (two separate Vagrant projects forwarded to port 8080, for example). Vagrant includes built-in mechanism to detect this and correct it, automatically.

Port collision detection is always done. Vagrant will not allow you to define a forwarded port where the port on the host appears to be accepting traffic or connections.

Port collision auto-correction must be manually enabled for each forwarded port, since it is often surprising when it occurs and can lead the Vagrant user to think that the port was not properly forwarded. Enabling auto correct is easy:

The final :auto_correct parameter set to true tells Vagrant to auto correct any collisions. During a vagrant up or vagrant reload, Vagrant will output information about any collisions detections and auto corrections made, so you can take notice and act accordingly.

から

Vagrant.configure("2") do |config| 
    config.vm.network "forwarded_port", guest: 80, host: 8080, 
    auto_correct: true 
end 

を使用することができauto_correctオプションがあります

関連する問題