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.

I'm emulating Ubuntu on my mac and I want to use it as local server to test websites.

I'm using wmware tools for emulation.

How can I visit to the localhost in the emulated Ubuntu from the browser in osx ? I've installed Apache on the virtual machine but I would like to access to the websites even from osx

thanks

share|improve this question
    
Your virtual machine has an IP address - assuming that you have set up networking. Just enter that IP address in your OS X browser. That's how such things worked out for me, at least. –  slhck Nov 2 '10 at 15:51
add comment

1 Answer 1

up vote 1 down vote accepted

http://localhost in a browser is the same as http://127.0.0.1. 127.0.0.1 is the IP address of what is called the loopback device. To access the web page from another computer that is on the same network:

example: http://192.168.0.10

replace 192.168.0.10 with whatever the IP address is of your virtual ubuntu machine.

Also, you may be able to call up the web page on the ubuntu vm by using the name of the ubuntu machine.

example: http://ubuntu-pc

share|improve this answer
    
Ok thanks, the virtual machine ip works, but how can I assign a name to the virtual machine or how can I know the correct one ? THe one I can read in vm library (Ubuntu) doesn't work –  Patrick Nov 2 '10 at 17:04
    
I guess the name is ubuntu since I can read this in the terminal : patrick@ubuntu:~$ –  Patrick Nov 2 '10 at 17:06
    
Yep that's right, ubuntu would be the machine name. If ubuntu does not work, then I would take a look at how your networking is set up. Bridged/NAT... but not a big deal as you can use the IP address. This will only work on your internal network of course. If you wanted to access the site from the public internet, then you would need to do some port forwarding on your firewall/router. –  lysdexic Nov 2 '10 at 20:00
add comment

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.