VMware Communities
wdeboer
Contributor
Contributor

Connecting to MacOSX Apache from Windows VM

I am currently trying to connect to the running MaCOSX apache server from inside my Windows XP virtual machine. I am running the Windows XP VM in Bridge mode so that it gets ip address in the same range as my Apple host computer. Only somehow I am unable to connect to the Apache server in the VM using the ip address of the Apple, which is 192.168.100.11.

When I try to connect to the server from a different (seperate) Windows computer within the network it all works fine. How can I fix this problem?

Also I would love to know if it's possible to make this working using NAT mode too. I have the Apple webserver running on port 80 (basically default settings from Apple) and I want to be able to connect to it from this Windows VM. Would that be possible?

0 Kudos
9 Replies
rcardona2k
Immortal
Immortal

I am running the Windows XP VM in Bridge mode so that it gets ip address in the same range as my Apple host computer.

This is a known issue covered in the Fusion Release Notes:

[b]Host-to-guest networking might not work in Bridged mode.[/b]

When the physical host ethernet adapter that VMware Fusion bridges to (usually "en0") supports hardware TCP and UDP checksum offload, any TCP or UDP communication betwen the host and the guest will fail when the guest is configured to use a bridged network adapter.[/b][/i]

>When I try to connect to the server from a different (separate) Windows computer within the network it all works fine. How can I fix this problem?

AFAIK, you can only workaround the solution by switching the guest to NAT networking. This will isolate your VM behind the NAT boundary including from the host. But it does enable your Guest VM to access host services like Apache or on any other host port. Do you need to access the VM from the host or other machines too?

I also tried leaving my VM in bridged mode and turning on NAT in OS X Internet Sharing and that still didn't enable host access from within the VM. This is how I workaround not having bridged mode connectivity over wireless connections.

0 Kudos
wdeboer
Contributor
Contributor

Thanks for you reply!

Well, the main purpose of this is to be able to verify a website to run correctly within Internet Explorer without the requirement to move to reboot or move to a different computer. It would be great if I can connect to the host computer from within this Windows XP VM. That would be perfect. No special need to make it accessible on other computers in the network.

0 Kudos
rcardona2k
Immortal
Immortal

I forgot to mention that's fairly easy to switch between Bridged and NAT networking without rebooting. I have this script on my XP desktop that I use to switch between modes live.

Save this snippet on your XP Desktop or elsewhere, in a file called "SwitchNetworking.cmd"

@echo off

@echo Releasing current DHCP lease...

ipconfig /release

@echo.

@echo.

@echo Press enter to obtain a new DHCP lease...

pause

ipconfig /renew[/code]

Run the script by double-clicking, wait for your NAT/Bridged address to go 0.0.0.0 then switch modes in Virtual Machine > Ethernet > NAT or Bridged. Then hit enter to get a new address in the changed mode. This has been working well for me.

0 Kudos
wdeboer
Contributor
Contributor

Yeah, that's indeed nice. I normally just do it by hand. Only I would love to know how to connect to my MacOSX Personal Webserver from the Windows XP VM, though.

It looks like you need to change a nat.conf file?

0 Kudos
rcardona2k
Immortal
Immortal

>Yeah, that's indeed nice. I normally just do it by hand. Only I would love to know how to connect to my MacOSX Personal Webserver from the Windows XP VM, though.



No, what I wrote above is accurate. If you switch to NAT networking you can open Internet Explorer in your Windows XP guest VM and type http://192.168.100.11/ And this will load your OS X Apache page in the guest VM. I have not missed this point and sorry to throw in other stuff. I just wanted to make the switch easy for you and if you needed to be back on your home network you can switch to bridged easily.



!http://farm1.static.flickr.com/134/349229676_b1c6ecccdf.jpg!


It looks like you need to change a nat.conf file? <br>


Just to clarify further. You would only need to modify nat.conf to go in the opposite direction[/i], e.g. Mac OS X Safari to IIS in XP. You said that wasn't needed. And actually to do both in NAT, you couldn't setup a nat listener on port 80 because that's where Apache is, so you would have to use something like 81 or 8080 to get to IIS. But I disgress.

0 Kudos
wdeboer
Contributor
Contributor

Great it works! Now I only need to get my virtualhost working from within Windows and fix some crazy resolving issue when I try to load phpMyAdmin which tries to open: www.willem-de-boers-computer.local/~weyertdeboer/phpMyAdmin/.

0 Kudos
rcardona2k
Immortal
Immortal

I find for web development at home, I have to litter my /etc/hosts file with the domain names I will publish my sites to. On Windows, for the sake of everyone, that file is in %windir%\system32\drivers\etc\hosts. You can put an entry in there like

192.168.100.11 www.willem-de-boers-computer.local www.willem-de-boers-computer

I find many web package installers resolve your OS X host name and/or it's FQDN and end up with a name like you have above. You usually have to go into their .conf files and put in a more reasonable name. Or if you don't mind what it comes up with, then that's what you put in /etc/hosts.

0 Kudos
number-six
Contributor
Contributor

Groovy. Now I can load pages in IIS on the host and the main web directories in Apache under OSX with the guest.

I have virtual hosting set up on my Mac and serve right out of my subversion working directories with Apache. I'm using name based virtual hosting which works fine on the local machine within OSX, but I'd like to be able to load the pages in those directories from within the Guest OS under Fusion.

I think I need to change to an IP based virtual hosting under Apache, but am a bit fuzzy on the details.

Anybody have any pointers?

TIA,

-S

0 Kudos
rcardona2k
Immortal
Immortal

>I think I need to change to an IP based virtual hosting under Apache, but am a bit fuzzy on the details.

>Anybody have any pointers?

Try: http://httpd.apache.org/docs/1.3/vhosts/ip-based.html

0 Kudos