The Computer Oracle

VirtualBox guest OS accessing local server on host OS

--------------------------------------------------
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: Puzzle Game 2

--

Chapters
00:00 Virtualbox Guest Os Accessing Local Server On Host Os
00:28 Answer 1 Score 4
00:46 Accepted Answer Score 217
01:22 Answer 3 Score 2
01:40 Answer 4 Score 6
01:59 Thank you

--

Full question
https://superuser.com/questions/144453/v...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#networking #virtualbox #virtualization

#avk47



ACCEPTED ANSWER

Score 217


Enable ONE network adapter. Set it to NAT and start your machine. Don't need to configure anything.

On guest machine's browser type http://10.0.2.2 which will show you the same content as "localhost" in the host OS.

10.0.2.2 is the "default gateway" for NAT connections and your guest OS' IP is 10.0.2.15

Of course you can set a "HOST-ONLY" or an "Internal Network" which will allow you another advanced configurations. I recommend to stay with NAT.

Enjoy

M.




ANSWER 2

Score 6


Also a point to make when using the ip address of 10.0.2.2 is if you're using MAMP for instance add the port number :8888 so the full address reads http://10.0.2.2:8888




ANSWER 3

Score 4


The easiest way of allow uninterrupted access to your VirtualBox Guest machine is to set the network device as a 'bridge' to your eth0 on to your LAN.

The Guest machine will grab a LAN IP via DHCP from your router.




ANSWER 4

Score 2


What I found fixed the issue for me was making sure that the windows VirtualHost-Only adapter was set to the .1 address for the ip range so my virtual box host only adapter was 192.168.58.20 but the ip for the Windows adapter is 192.168.58.1