A web developer's blog. PHP, MySQL, CakePHP, Zend Framework, Wordpress, Code Igniter, Django, Python, CSS, Javascript, jQuery, Knockout.js, and other web development topics.

MAMP and VMWare Fusion with WindowsXP: http://localhost:8888 access impossible?

I have been trying to figure out how to setup my VMware Fusion so that it will be able to access http://localhost:8888 on my Mac.
I have editted: c:WINDOWSsystem32driversetchosts to something like this:      localhost

But still it won’t resolve to the MAMP pages. After doing some reading, I found out that I can’t use “localhost”. SO I re-editted the hosts file to something like this:      mylocalhost

Now, http://mylocalhost:8888 works! BUT I am not totally satisfied. In my applications, I have set a “cofig” variable for the web URL. Something like:

$web_url = "http://localhost:8888/myapp/index";

This would suck for me because I have VMWare Fusion to test CSS between browsers. By the looks of it, I would have to change my variable in order for my web app to work properly.

Do you guys have any ideas on how to use http://localhost from WindowsXP(VMWare) – so that my MAMP Pages will be accessible?

This entry was posted in General and tagged , , , . Bookmark the permalink.

9 Responses to MAMP and VMWare Fusion with WindowsXP: http://localhost:8888 access impossible?

  1. I am currently looking for the same solution. I have mamp set up with virtual host so I can use names like site.dev and testing.dev. I would like to access them the same in xp via vmware.

  2. Wenbert says:

    Michael, when you find the solution post it here ;)

    I’ll continue to ask around during the weekend. Very busy at the moment :(

  3. Pharalia says:

    Couldn’t you use the following:

    $base_url = “http://”.$_SERVER['HTTP_HOST'].”:”.$_SERVER['SERVER_PORT'].”/myapp/index”;

    That way no matter where you’re page is called from, those SERVER variables will change autonomously.

  4. Wenbert says:

    @Pharalia: thanks ^_^

  5. Just thought I would share a solution I found a while back. http://communities.vmware.com/thread/125707
    the third comment down by brianriceca. This worked perfectly for me. Hope it helps.

  6. I also have mamp setup so that apache is using port 80 not 8888 and added virtual hosts in httpd.conf and edited /etc/hosts to include my virtual hosts at localhost.

  7. Wenbert says:

    Thanks for sharing Michael!

  8. Lars says:

    http://XXX.XXX.XXX.XXX:8888/ where “XXX.XXX.XXX.XXX” is the IP address of my Mac works fine for me.

  9. Craig says:

    The solution I found is quite simple, but may require the latest version (3) of Fusion:
    1. In the VM settings for the Windows VM, make network mode NAT
    2. figure out what name you laptop is. In my case it’s craigs-macbook.local
    3. in Windows, with NAT turned on, you should be able to access the host OS with that name.

    This method works regardless of the currently assigned ip address of the host…

Leave a Reply to Wenbert Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>