2016-07-08 1 views
1

최근에 VirtualBox로 Vagrant 상자를 VM 공급자로 설정하려고했습니다. 첫 번째 시도에서 Vagrant는 가상 박스를 올바르게 생성했지만 일부 요리사 오류로 인해 실패했습니다. 포트를 정리하지 않은 방랑은이 중 VBOX과 관련,Failed Vagrant가 VirtualBox에 대해 다시 실행될 때 오류가 발생했습니다

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

실패시처럼 보인다 무엇 :

나는 요리사가 가리키는 오류를 해결하고 다시 방랑까지 명령을 reran하지만,이 시간이 나는 다음과 같은 오류가 발생했습니다 . 나는 Virtual Directory 디렉토리에서 .vagrant 디렉토리와 머신을 제거하려고 시도했다. 여전히 같은 오류가 발생합니다. 방부 처리 파일에서 포트 포워딩을 변경하여 실행할 수있는 유일한 방법.

오류가 발생하면 방황 제 자동 수정/청소 설정을 강제로 수행 할 수있는 방법이 있는지 알려 주시기 바랍니다. 나는 여러 가지 이유로 일어날 수있는 실패로 인해 방황 파일을 변경하고 싶지 않기 때문에

미리 감사드립니다.

답변

2

는 사용할 수있는 auto_correct 옵션이

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

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.

에서
관련 문제