VMWare: Web server on guest OS, accessed from Host?
September 26, 2008 10:40 AM   Subscribe

VMWare Fusion as dev server: How can I set things up so I can access a web server running under the guest OS (Red Hat Enterprise Linux 5) from the host machine? Bonus points if it can be done without plugging into an ethernet network.

I've got a web app that will eventually be deployed under Red Hat Enterprise Linux 5, and the client sent me a VMWare image of the production machine so I could test in an environment as similar to theirs as possible (I usually just run the AMP stack under OS X, but they're using older versions of each piece of software, and are unlikely to upgrade soon because of some legacy apps, and we all know php installations vary wildly anyway, so this seems to make sense).

Since I've got VMWare Fusion, I figured this'd be a snap, but there appear to be two challenges:

1) Red Hat Enterprise Linux appears to be expecting an wired Ethernet connection by default. I'm primarily doing work on a MacBook Pro with connectivity done by WiFi. Having to plug in would suck... but this might be the part where getting WiFi to work under Linux would suck more.

2) I'm not sure what tack to take for the general network settings for VMWare (probably "Bridged" or "Host Only"?) and corresponding appropriate TCP/IP settings for the guest OS.

I'd love it if someone could post or point to a comprehensive explanation for making this work, but if you can help with either point #1 or point #2 (or offer any other advice), that'd be great too.

posted by weston to Computers & Internet (3 answers total) 1 user marked this as a favorite
I don't know vmware fusion specifically, but vmware client side hosting generally does the following types of networking:

Note in all cases, the redhat server never sees your real network card, only the virtual one in VMware, so it doesn't care what network card you're actually using. Vmware handles the stuff in the middle.

Bridged. You assign the network card on your red hat enterprise guest as bridged. It will then have whatever access your real network card does. It shouldn't matter whether you use wireless or wired on your real network, the bridged network gets access to whatever your laptop does. So if you have DHCP handing out IPs to your real card, the RHES server can use DHCP too, and get an IP in the same range. Then you access it via it the assigned IP from the DHCP server. Or, give it a fixed IP appropriate for the rest of your real network, and it should be available from the rest of the network (firewall in redhat permitting, of course). Note, bridged networking does not always work with all real network cards, though it is pretty good.

Host Only: This sets up a fake network entirely on your laptop. Vmware runs a mini DHCP server for the guest redhat OS, and assigns a non-routed fixed IP to the fake network card on your laptop. The guest server can use DHCP again, or again given a fixed IP appropriate to the fake network setup (vmware will pick a range not in use when it's setup, so there's no way to know in advance what range it will be) You, in the host OS can access the redhat server using it's fake fixed IP. Nothing in the rest of the world can see the server.

NAT: Same as Host only, but it also sets the host up as a routing server. So your redhat guest gets a fake IP on your fake inside network card, but can also use your laptops fake fixed IP as a gateway to see the rest of the world through your real network card, but not be accessible by it. Useful for guests you want to give access to the real world, but not too much.
posted by ArkhanJG at 11:16 AM on September 26, 2008

ArkhanJG has it, though Bridged mode pretty much just works on OS X (it can be iffy otherwise for the reason stated on other OSes - OS X itself only supports a few kinds of NICs, and some NICs don't really deal with multiple MACs very well).

Bridged mode is what you want; as far as the RHEL system is concerned, it's a computer in its own right on the network, and RHEL talks to the network through the VMWare network driver (and not to any physical hardware in your computer). You could also do Host-only mode, which works in the same manner, but only OS X on your MacBook Pro will be able to talk to the VM. You'll probably need to change the network settings in RHEL itself though, because they're probably set up for the hosting environment.
posted by mrg at 12:42 PM on September 26, 2008

" Bridged mode pretty much just works on OS X"

The current version of Fusion has a bug that causes the bridge not to come up if there are no active interfaces. If you want the bonus points for not having any interfaces up, you're probably going to wind up setting it to Host-Only mode.
posted by majick at 2:08 PM on September 26, 2008

« Older No matter how many times it's explained to me, I'm...   |   Explain NetApp to me Newer »
This thread is closed to new comments.