Oct 29, 2009
Virtualbox How To: Accessing Guest Apache from Host
For Virtualbox users, here’s a useful article on how to access Apache running on your guest OS from within your host OS.
In brief, assign port 8888 on host OS (Windows XP for me) to forward to Apache’s port 80 in the guest OS (Ubuntu for me) with these commands:
cd C:\Program Files\Sun\xVM VirtualBox VBoxManage setextradata MyUbuntu "VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache/HostPort" 8888 VBoxManage setextradata MyUbuntu "VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache/GuestPort" 80 VBoxManage setextradata MyUbuntu "VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache/Protocol" TCP
Shutdown Virtualbox completely, not just the guest OS, but the Virtualbox application too. Start Virtualbox back up, start the guest OS, open a browser in your host OS, and go to the URL http://localhost:8888/ to see your Apache home page.
Remember to change “pcnet” into the name of your network device if different, otherwise an error like this: “verr_cfgm_value_not_found” will occoure