Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I created a virtual machine on Virtualbox with Ubuntu 12.04 only to install a LAMP solution and use it with my host machine, but I can't access the localhost using the ip (10.0.2.15) in the browser .

Is there any way to solve this problem ?

share|improve this question
1  
Run ifconfig | grep inet on VM and browse using that ip from your Host. –  penreturns Oct 3 '12 at 22:41
    
It gives me this : "inet end.: 10.0.2.15 Bcast:10.0.2.255 Masc:255.255.255.0, endereço inet6: fe80::a00:27ff:fe0b:7fee/64 Escopo:Link" but the 10.0.2.15 don't work, and ping to this ip only results on a 100% lost packages. –  aliasbody Oct 3 '12 at 22:48
    
From your VM, can you access 10.0.2.15? Does UFW enable? Did you allow port? –  penreturns Oct 3 '12 at 22:53
    
This is something I didn't have tested actually (only localhost). But yes it works perfectly on the VM. –  aliasbody Oct 4 '12 at 0:23

1 Answer 1

up vote 7 down vote accepted

First you should change the Network adapater to Bridged (It seems you are choosing NAT)

enter image description here

Then you can give an ip to your guest machine other than 10.0.2.15 (or you can leave it if you want)

then open a browser from your host machine and type: ip-address-of-your-guest-machine/...

share|improve this answer
    
Thank you for your help. But, when I select Bridged Adapter I loose the connection, and even after restarting (when Virtualbox doesn't give me any error), I can't connect at all (on the guest machine) to the network. How can I solved this ? –  aliasbody Oct 4 '12 at 14:07
    
are you sure that you give an ip of same range of your network?! –  user61928 Oct 4 '12 at 14:11
    
be sure to give ip similar to your host with same dns and same gateway –  user61928 Oct 4 '12 at 14:11
    
I can't enable my virtual machine with the Bridged Adapter because it crashes and keep asking be about the vboxdrv (that is started), when I switch to NAT it loads without any problem. I will try to change from NAT to Bridged and then make they use the same ip to see if it works. –  aliasbody Oct 4 '12 at 21:22
    
Sorry my fault ! I messed up with the modules :S... But now I activated normally and everything is working :D (I just need to remember to not mess manually with the modules like I do on Arch Linux). Thank you very much for you help :D –  aliasbody Oct 4 '12 at 22:52

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.