使用VMWare Player 5,如何通过外部计算机访问在VM中运行的Web服务器? [英] using VMWare Player 5, how can I access a web server running in a VM via an external machine?
问题描述
通过VMWare Player在Ubuntu VM中运行Rails的Win7 PC.我正在一个网站上,想把它展示给我网络之外的朋友.
Win7 PC running Rails in an Ubuntu VM via VMWare Player. I'm working on a site and would like to show it to a friend who's outside my network.
我找到了此博客文章,这使我非常接近: http://blog.fardad.com/2012/06/vmware-player-and-custom-nat-port-map.html
I found this blog post, which got me very close: http://blog.fardad.com/2012/06/vmware-player-and-custom-nat-port-map.html
好,所以我有使用NAT的VM.据我了解,这意味着VM看起来与外部流量具有与父计算机相同的IP地址.
OK, so I have the VM that is using NAT. As I understand it, that means that the VM will appear to have the same IP address as the parent machine to outside traffic.
我进入了NAT设置并添加了端口转发功能:
I went into NAT settings and added port forwarding:
Host Port: 8200 Type: UDP Virtual IP Address: 192.168.198.184:3000
好的,所以我的理解是,我现在应该能够转到192.168.1.1xx:8200(真实" PC的IP)并访问在VM中运行的Web服务器.但是当我去那个地址时,我一无所获.我可以从PC ping 192.168.198.184(VM).
OK so my understanding is that I should now be able to go to 192.168.1.1xx:8200 (the IP of my 'real' PC) and access the webserver running in the VM. But when I go to that address, I don't get anything. I can ping 192.168.198.184 (the VM) from the PC.
我想要做的是进入路由器并设置一个端口,该端口最终将转发到VM.
What I want to be able to do is go into my router and set up a port that will eventually forward into the VM.
似乎我缺少了一些很小的东西,但我不知道那是什么.请帮忙.
It seems like I'm missing something very small but I don't know what that is. Help, please.
如果有人好奇如何获取虚拟网络编辑器:
If anyone is curious how to get the Virtual Network Editor:
转到vmware-目录并在提升的cmd.exe-box中运行
go to the vmware-directory and run in elevated cmd.exe-box
rundll32.exe vmnetui.dll VMNetUI_ShowStandalone
rundll32.exe vmnetui.dll VMNetUI_ShowStandalone
http://communities.vmware.com/message/2155960#2155960
推荐答案
-
找到
vmnetnat.conf
文件,通常位于
C:\ProgramData\VMware\vmnetnat.conf
或
C:\Users\Application Data\VMware\vmnetnat.conf
编辑vmnetnat
,在[incomingtcp]
部分中添加类似的行
Edit vmnetnat
, add similar line in the [incomingtcp]
section
8200=192.168.198.184:3000
重新启动VMware NAT Service
.
这篇关于使用VMWare Player 5,如何通过外部计算机访问在VM中运行的Web服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!