从不是主机的计算机访问 Virtualbox 来宾

Access Virtualbox guest from computer that is NOT host

我有一台电脑,就叫它linux@home吧。 我有一个专用的远程 linux 服务器,我们称它为 linuxHost@datacenter。 我在专用服务器上有一个virtualbox虚拟机运行ning windows 7,我们称它为windowsGuest@datacenter.

我通过 virtualbox 管理器在 windowsGuest 上设置了一个 NAT 网络接口。

windowsGuest@datacenter 运行ning 需要访问 linuxHost@datacenter 上的 sql 数据库的服务,并且工作正常。 windowsHost 上的相同服务需要侦听 udp 端口​​上的连接,比方说 12345。windowsGuest 可以访问互联网,网页浏览正常(不需要,但工作正常) .

所以,现在我需要 linux@home tu 运行 一个连接到 windowsGuest@datacenter 上的 udp 端口​​ 12345 的客户端应用程序。我所做的是在我用于 windowsGuest :

的 NAT 网络上配置一个端口转发
-host ip : 127.0.0.1
-host port : 12346
-protocol : UDP
-guest ip : 10.0.2.4 (which is windowsGuest@datacenter ip address)
-guest port : 12345

我希望 UDP 端口 12346 上 linuxHost@datacenter 上的任何连接都将转发到 windowsGuest@datacenter UDP 端口 12345,但这似乎没有发生。

更多信息:

- windowsGuest@datacenter's firewall is turned OFF
- linuxHost@datacenter runs iptables and is configured to allow any connection from linux@home, both tcp and udp.
- linuxHost@datacenter 's iptables doesn't log any blocked packets.
- I don't want to turn off iptables since linuxHost@datacenter is running other services and i don't want to expose that.
- I cannot test the client application on linuxHost@datacenter

我做错了什么?我应该手动将连接从 internet 转发到端口 udp 12346 上的 linuxHost@datacenter 到 127.0.0.1:12345 吗?我应该以不同方式配置 NAT 端口转发吗?我是不是完全错了,这不是我应对这种情况的方式?

多亏了this answer,我可以管理我想要的东西。我必须在 virtualbox 管理器首选项中向前修改我的 NAT 端口。 host ip字段可以留空,这样来自任何ip地址的连接都会被转发给guest。