我使用VirtualBox在服务器上设置虚拟机。
我设法从我服务器的远程桌面访问虚拟机的远程桌面,但我想将虚拟机的远程桌面转发到外面,这样我可以访问它,就像我访问服务器的远程桌面一样。
服务器的IP配置:
Ethernet adapter Ethernet 2:
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::857:1d78:27de:55ca%13
IPv4 Address. . . . . . . . . . . : 85.194.xxx.xxx
Subnet Mask . . . . . . . . . . . : 255.255.255.255
Default Gateway . . . . . . . . . : 85.194.xxx.xx
Ethernet adapter VirtualBox Host-Only Network:
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::2410:d297:7e8c:e8ab%18
IPv4 Address. . . . . . . . . . . : 192.168.56.1
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :
因此,当我通过远程桌面连接到 85.194.xxx.xxx 时,我可以启动另一个远程桌面到 192.168.56.2:3389 (虚拟机的IP) VirtualBox仅主机网络)但我想直接通过 85.194.xxx.xxx ip连接到它。
所以我使用netsh将 3389 端口从 192.168.56.2 转发到 85.194.xxx.xxx:3395
PS C:\Windows\system32> netsh interface portproxy add v4tov4 listenport=3389 listenaddress=192.168.56.2 connectport=3395 connectaddress=85.194.xxx.xxx
所以看起来像:
Listen on ipv4: Connect to ipv4:
Address Port Address Port
--------------- ---------- --------------- ----------
192.168.56.2 3389 85.194.xxx.xxx 3395
但是当我尝试连接到 85.194.xxx.xxx:3395 上的远程桌面时,它会失败。 我关闭了所有防火墙,以确保这不是问题。
任何想法为什么?
答案 0 :(得分:0)
好的,我找到了解决方案。我以相反的顺序写了IP
PS C:\Windows\system32> netsh interface portproxy add v4tov4 listenport=3389 listenaddress=192.168.56.2 connectport=3395 connectaddress=85.194.xxx.xxx
应该是
PS C:\Windows\system32> netsh interface portproxy add v4tov4 listenport=3395 listenaddress=85.194.xxx.xxx connectport=3389 connectaddress=192.168.56.2
但是知道我无法登录无论我使用哪个帐户都会说“无法登录”