I been using VirtualBox to deploy virtual machines on my Windowsmachine since a significant memory upgrade. VirtualBox is suprisinglyeasy to used if compared to VMWare and it just fit to my basic needs.
Access the web server from the guest on host is pretty straightforward but not the other way.
In my scenario, my host OS is XP and the guest OS is Ubuntu. First,we go to the XP host and open a command prompt, and configure the portforwarding in the VirtualBox installation directory, as follows:
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
This simply arbitrarily assign port 8888 of our host XP to forwardconnections to the guest Ubuntu’s port 80, which is the default portfor HTTP connections.
Having done that, we now turn on our guest Ubuntu and use our webbrowser on host XP to browse http://localhost:8888/. Alright, now wegot a local web server to play with.
We can also allowing SSH connections from the host OS to the guest OS as follows:
cd C:/Program Files/Sun/xVM VirtualBox VBoxManage setextradata MyUbuntu "VBoxInternal/Devices/pcnet/0 /LUN#0 /Config/ssh/HostPort" 2222 VBoxManage setextradata MyUbuntu "VBoxInternal/Devices/pcnet/0 /LUN#0 /Config/ssh/GuestPort" 22 VBoxManage setextradata MyUbuntu "VBoxInternal/Devices/pcnet/0 /LUN