我目前有一个vagrant环境,每个VM都有一个端口转发规则从主机设置到客户。但是,这个转发规则的问题是,我不能让多个VM同时通过游走器运行,同时具有类似的端口转发规则。
似乎我需要某种端口代理来处理这个问题。有什么东西已经被烤成了迷途/虚拟盒,可以支持这一点吗?
Traceback from Vagrant when I try running another VM with the same forwarding rules:
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 8000 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.发布于 2013-12-11 21:27:30
您可以将:auto_correct参数用于端口定义,然后Vagrant将查找另一个(未使用的)端口:
Vagrant.configure("2") do |config|
config.vm.network "forwarded_port", guest: 80, host: 8080, auto_correct: true
end有关更多细节,请参见documentation。
https://stackoverflow.com/questions/20530203
复制相似问题