您的位置:首页 > 产品设计 > UI/UE

Web Server Access on a VirtualBox Guest

2011-07-26 11:27 381 查看

Web Server Access on a VirtualBox Guest

In: Computing 数码编程7Oct2008I 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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: