Accessing localhost on a host machine inside a guest in VirtulaBox

ie. Host(ubuntu) and Guest(Win8) in VirtualBox

  • Host is where I am developing and writing code
    • Host has been set up with a webserver and edited '/etc/hosts' file for local testing (ie. local.jabeuy.notedock.com)
  • Guest needs access to local.jabeuy.notedock.com to test it in IE11

How?

To access something like local.jabeuy.notedock.com on the Guest, need to edit the hosts file in the guest (Win8), so that 'local.jabeuy.notedock.com' points to the IP of the host.

ie. Host's IP is 192.168.1.34, so in the guest, need to set a line in 'hosts' like:

192.168.1.34 	local.jabeuy.notedock.com

so that going to local.jabeuy.notedock.com in the IE11 Guest browser, routes to 192.168.1.34.

The Host machine receives the request for local.jabeuy.notedock.com serves it.

Why?

Was deploying every minor change to a staging machine, so that I could test stuff from IE11 on Win8.

Instead of having to commit changes, pushing and deploying all the small changes, can just get access to the dev machine from a VirtualBox (or pretty much any machine on the intranet).



Posted by JB Uy on November 21, 2013 at 07:00 PM UTC
Edited on December 13, 2013 at 08:42 PM UTC
Public Comments
comments powered by Disqus