Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

So...I have started working as a front-end developer in a shop that does .NET. I use a Mac and have a VMWare image with Visual Studio and the project on it. The project runs great. However, I was talking to a developer here, and someone before I got here, use to be able to point a specific port to their VMWare windows machine. Meaning, they were able to code on their Mac, share the folder to VMWare and then just view it in their browser on the Mac. Basically, using the VMWare image as a server.

So http://localhost:123/ would be redirected to the VMWare machine. I know the Visual Studio project, when compiled, runs at http://localhost:1309/, so basically, my questions is...How do I replicate that environment? I was told there was a program he needed to reroute the port, and that he was using NAT.

Anybody ever done this before?

share|improve this question

migrated from stackoverflow.com Jul 29 '11 at 12:58

This question came from our site for professional and enthusiast programmers.

add comment

1 Answer

up vote 3 down vote accepted

The way to do this is through the nat.conf file in the vmnet configuration:

Turns out its easy - nat.conf is the key. Just add the configuration to

/Library/Application\ Support/VMware\ Fusion/vmnet8/nat.conf

in the incomingtcp configuration.

[incomingtcp]
80 = IP_OF_THE_VMWARE:80

And restart the vmware networking:

sudo /Library/Application\ Support/VMware\ Fusion/boot.sh --restart

EDIT - More details
Once the port is forwarded, be sure that the VM's Windows Firewall is not blocking the internal port. Access the VM using the host IP address. From VMware's site:

The following line shows the format used in this section.

8887 = 192.168.27.128:21

This example creates a mapping from port 8887 on the host to the IP address 192.168.27.128 and port 21. When this mapping is set and an external machine connects to the host at port 8887, the network packets are automatically forwarded to port 21 (the standard port for FTP) on the virtual machine with IP address 192.168.27.128.

share|improve this answer
    
Where you say IP_OF_THE_VMWARE is that same as the ip = field under [host]? –  sublet Jul 29 '11 at 14:37
    
No, that's the NAT gateway IP, i.e. the IP address of VMware Fusion as if it was a router. The IP_OF_THE_VMWARE is the IP of your Windows VM as given by ipconfig, likely between 172.16.127.128 and 172.16.127.254. More details at VMware's site (look under Linux host, same instructions apply). –  fideli Jul 29 '11 at 15:03
    
Seems like it's starting to work. If I type in any address and then put :1308 it just spins. I think I might be hitting a firewall on the VMWare. Does that make sense or is it something else? –  sublet Jul 29 '11 at 16:15
    
Could it be a the Windows Firewall? –  fideli Jul 29 '11 at 16:35
    
That was it, I port mapped...it's just displaying a white screen though. If I hit that port from inside it shows the compiled app, but if I try to access it outside it just displays white. I am new to .NET so I am not sure if the server is running on the PC for outside traffic. –  sublet Jul 29 '11 at 16:54
show 5 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.