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

put on hold as off-topic by Jenny D, Florin Asăvoaie, Ward, Michael Hampton Nov 28 at 18:19

This question appears to be off-topic. The users who voted to close gave these specific reasons:

  • "Questions on Server Fault must be about managing information technology systems in a business environment. Home and end-user computing questions may be asked on Super User, and questions about development, testing and development tools may be asked on Stack Overflow." – Michael Hampton
  • "Questions should demonstrate reasonable business information technology management practices. Questions that relate to unsupported hardware or software platforms or unmaintained environments may not be suitable for Server Fault - see the help center." – Jenny D, Florin Asăvoaie, Ward
If this question can be reworded to fit the rules in the help center, please edit the 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

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