VMware Communities
gollas
Contributor
Contributor

LAMP virtual host and port forwarding

Hello,

This is my setup:

Host: Windows XP with address 172.16.28.121

Guest: Ubuntu Linux 9.10 with NAT and address 192.168.225.131 running an Apache Server listening on port 80

From the guest OS I can access the server using "localhost" or the loopback address.

From the Host os I can access de server using 192.168.225.131

The question is how can I configure VMPlayer or Windows XP so that other addresses on the 172.16.28.* range (the other computers on my network) can access the server as well?

In Sun VirtualBox the solution was to forward ports 80, 8800, 21 etc from the Host to the guest which sounds reasonable, is this the way it should be done in VMPlayer as well? how do I do that?

I assume this is a common question but I wasn't able to find anything detailed in the forums or google.

Thankyou

Daniel.

0 Kudos
6 Replies
gollas
Contributor
Contributor

Really? nobody else has a situation like mine?

How do you run your virtualized servers??

Thank you.

0 Kudos
purduecjs
Enthusiast
Enthusiast

I'm not sure that VMPlayer is the right choice for what you're trying to do. Have you looked at VMWare Server or ESXi?

The easiest way to get others on your 192.x.x.x network to access your VM (regardless of hypervisor choice) is to actually place the VM on the same network as your other machines (ie. give it a 192.x.x.x address).

Cameron J. Smith

System Administrator, Purdue University

-- Cameron
admin
Immortal
Immortal

Player can certainly run a virtualized Apache Server. Of course, you'd have to host that VM and leave the host running all the time, etc etc, but that's all up to you.

As for the networking, you do want to expose the server to the subnet. Thus, you should configure your VM to use bridged networking. Do that through VM Settings, and everything should work like butter on a Thanksgiving dinner roll... sorry, I'm still eating leftovers.

gollas
Contributor
Contributor

Thankyou for your answers.

I actually found the answer I was looking for in this post: http://communities.vmware.com/message/1413996#1413996

Apparently, before version 3.0, VMWare Player came with a tool called vmnetcfg.exet that did exactly what I wanted to do.

It is actually included in the installation file, but is not installed with the rest of the tools.

To manually extrat it, you run the installation file to extract to a specific directory with the /e parameter:

e.g. VMware-player-3.0.0-203739.exe /e some_directory

Then within the some_directory, you will find the network.cab , uncompress it with winRAR or 7zip and within it you will find the much desired vmnetcfg.exe tool.

It needs a lot of other files so just copy it into your Player installation directory next to the other tools.

Once you run it, it scans your virtual machines to find the network settings for each. Select the one you want to configure and click NAT Settings. (if your connection is NAT, which is the case of this post).

From there you can configure the port forwarding, in my case I forwarded the Host Port 80 TCP to my virtual machines IP address.

That works like butter on a warm roll to!... with a little gravy... mmm....

0 Kudos
admin
Immortal
Immortal

Thankyou for your answers.

Not a problem.

Once you run it, it scans your virtual machines to find the network settings for each.

Nope, the virtual network editor doesn't know what a virtual machine is. That UI exposes configurable options for things that run on the host.

There is the dialog that shows up the first time you launch the application which makes you wait for a while. That throbber sure makes it seem like it is doing something important. It isn't. It's just wasting your time for a few seconds.

Select the one you want to configure and click NAT Settings. (if your connection is NAT, which is the case of this post).

From there you can configure the port forwarding, in my case I forwarded the Host Port 80 TCP to my virtual machines IP address.

That works like butter on a warm roll to!... with a little gravy... mmm....

Yes, that gets the job done in a different way, but really all use cases such as yours should be addressed with bridged networking. Does using bridged networking for your VM not actually work? That would be useful to know, cause there may be bugs in the gravy... or something.

0 Kudos
qwertzguy
Contributor
Contributor

Hello,

Thank a lot gollas.

I could not find the Manage virtual networks tools anymore in vmware Player 3.0.

The only thing is that it didn't work with /e but it worked with -e.

0 Kudos