如何调试“Vagrant无法转发此VM上的指定端口"信息 [英] How to debug "Vagrant cannot forward the specified ports on this VM" message

查看:22
本文介绍了如何调试“Vagrant无法转发此VM上的指定端口"信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试启动 Vagrant 实例并收到以下消息:

I'm trying to start a Vagrant instance and getting the following message:

Vagrant cannot forward the specified ports on this VM, since they
would collide with another VirtualBox virtual machine's forwarded
ports! The forwarded port to 4567 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.forward_port 80, 1234

我打开了 VirtualBox,但目前我没有任何正在运行的盒子,所以我很难过.如何确定哪个进程正在侦听 4567?有没有办法列出我机器上运行的所有 Vagrant 盒子?

I opened VirtualBox, but I don't have any running boxes at the moment, so I'm stumped. How can I figure out which process is listening on 4567? Is there a way to list all Vagrant boxes running on my machine?

谢谢,凯文

推荐答案

如消息所示,端口与主机发生冲突.我只是将端口更改为主机上的其他值.所以如果我收到错误

As message says, the port collides with the host box. I would simply change the port to some other value on the host machine. So if I am getting error for

config.vm.forward_port 80, 1234

那我就改成

config.vm.forward_port 80, 5656

因为 1234 可能会在我的主机上使用.

As 1234 might be used on my host machine.

为了实际检查任何机器上的端口,我使用该操作系统的 tcpview 实用程序,并了解在何处使用哪个端口.

For actually inspecting ports on any machine, I use the tcpview utility for that OS and get to know which port is used where.

这篇关于如何调试“Vagrant无法转发此VM上的指定端口"信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆