Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

As I describe in the title of this question, I like to allow my guest computer access the internet, and allow my host computer access via HTTP the guest computer.

In depth, I have a Windows 7 OS installed in my host computer, and I have installed the Latest Ubuntu Server version as a guest computer in a VirtualBox.

At the time, I have the option either to get access to the internet from my guest host, either allow the access to my guest host via the HTTP.

In my guest host, I have installed a LAMP stack, in combination with the WebMin. In my case, If I need to install a new software or updates in my guest host server, I have to shut down the guest computer and then change the connection settings from "Host-only Adapter" to "Bridge Adapter". Then if I like to use the WebMin, I have to shutdown again the guest PC and change the connection type from, "Bridge Adapter" to "Host-only Adapter".

Note that also I have used and a second adapter in network options of the guest host, with the alternative value, but no luck.

Any idea please on how to configure the VirtualBox for that porpose ?

Kind regards

share|improve this question

1 Answer 1

Let say your guest VM calles vm1. You need to define port forwarding. Open command line prompt and type (yes, have a fun with windows)

# set the guest port
VBoxManage setextradata "vm1" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/sshd/GuestPort" 80

# set the host port (the port where the VirtualBox-process listens on behalf of the VM)
VBoxManage setextradata "vm1" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/sshd/HostPort" 2080

# set the protocol
VBoxManage setextradata "vm1" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/sshd/Protocol" TCP

Now, if you connect to host on port 2080 it will redirect to guest port 80.

BDW, you don't need to shutdown guest to change network adapter properties.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.