Ubuntu – VirtualBox NAT port forwarding on Ubuntu 64

nat;networkingUbuntuvirtualboxvirtualization

I have an Ubuntu 9.04 desktop 64-bit guest OS running on an Ubuntu 9.04 desktop 64-bit host OS (yes, the same OS). I'd like to run a web server on the guest and make it accessible through NAT on the host.

I (think I) followed the VirtualBox port forwarding instructions, but the guest/VM won't start after I do the configuration.

Here's the configuration that I ran:

VBoxManage setextradata "<Guest Name>" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guesthttp/Protocol" TCP
VBoxManage setextradata "<Guest Name>" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guesthttp/GuestPort" 80
VBoxManage setextradata "<Guest Name>" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guesthttp/HostPort" 8080

Where <Guest Name> is the name of the guest VM image.

The error looks like this:

enter image description here

The same error happens regardless of whether I run the configuration while the VM is running, or not running.

Guest additions are installed.

How do I properly configure the NAT port forwarding? What is causing this error?

Best Answer

get all param you did for this WM with command:

VBoxManage.exe getextradata "Name_of_VM" enumerate

You should see all value transmited to VM.

Key: GUI/SaveMountedAtRuntime, Value: yes
Key: GUI/ShowMiniToolBar, Value: yes
Key: GUI/MiniToolBarAlignment, Value: bottom
Key: GUI/LastCloseAction, Value: save
Key: GUI/LastWindowPostion, Value: 345,133,640,522
Key: GUI/Fullscreen, Value: off
Key: GUI/Seamless, Value: off
Key: GUI/AutoresizeGuest, Value: on
Key: GUI/MiniToolBarAutoHide, Value: on
Key: VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/HostPort, Value: 22
Key: VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/GuestPort, Value: 22

Remove all ligne begin with VBoXInternal by Copying and paste the line to command like this

VBoxManage.exe setextradata "Name_of_VM" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guesthttp/HostPort"

with no value to the end. At end you should enumerate again and see no more lines of VBoxInternal.

Now you can make again the NAT rules, with different name for rules.

Key: VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/HostPort, Value: 2222
Key: VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/GuestPort, Value: 22
Key: VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/Protocol, Value: TCP
Key: VBoxInternal/Devices/pcnet/0/LUN#0/Config/guesthttp/Protocol, Value: TCP
Key: VBoxInternal/Devices/pcnet/0/LUN#0/Config/guesthttp/GuestPort, Value: 80
Key: VBoxInternal/Devices/pcnet/0/LUN#0/Config/guesthttp/HostPort, Value: 8080

Under linux you should remind that PORTS <1024 should NOT be redirected. use 2222 for guestssh and 8080 for guesthttp (Example) For ease of use I personnaly use <1014 port under WINDOWS.

Hope this should help you.

(Sorry For English! I'm frenchy :P)

Jacques.guensherian

Related Question