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 ( in the browser .

Is there any way to solve this problem ?

  • 2
    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.: Bcast: Masc:, endereço inet6: fe80::a00:27ff:fe0b:7fee/64 Escopo:Link" but the 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 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

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 (or you can leave it if you want)

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

  • 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

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.