How to access localhost on Virtualbox host machine
76,608
First you should change the Network adapater to Bridged (It seems you are choosing NAT)
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/...
Related videos on Youtube
Author by
aliasbody
Updated on September 18, 2022Comments
-
aliasbody over 1 year
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 ?
-
penreturns over 11 yearsRun ifconfig | grep inet on VM and browse using that ip from your Host.
-
aliasbody over 11 yearsIt 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.
-
penreturns over 11 yearsFrom your VM, can you access 10.0.2.15? Does UFW enable? Did you allow port?
-
-
aliasbody over 11 yearsThank 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 ?
-
Admin over 11 yearsare you sure that you give an ip of same range of your network?!
-
Admin over 11 yearsbe sure to give ip similar to your host with same dns and same gateway
-
aliasbody over 11 yearsI 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 over 11 yearsSorry 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
-
Admin over 11 yearsYou are welcome but please mark as answer to help others later