-1

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

KodeFor.Me
  • 209
  • 3
  • 5
  • 14

1 Answers1

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.

kofemann
  • 4,626
  • 1
  • 25
  • 30