Page 1 of 1

Forgot how to portforward

Posted: 29. Nov 2010, 15:55
by Slayer00
About year ago or so I had Apache under Windows XP virtualbox portforwaded to port 8080 and now I'm trying to do the same on Ubuntu but... I forgot where I'm supposed to enter the commands into.. Also forgot what the name was for Apache to be used in the command.

I found these on the net but.. Don't know if they are correct;

Code: Select all

VBoxManage setextradata nameofyourguest "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/HostPort" 2222
VBoxManage setextradata nameofyourguest "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/GuestPort" 22
VBoxManage setextradata nameofyourguest "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/Protocol" TCP


VBoxManage setextradata nameofyourguest "VBoxInternal/Devices/pcnet/0/LUN#0/Config/postgresql/HostPort" 5432
VBoxManage setextradata nameofyourguest "VBoxInternal/Devices/pcnet/0/LUN#0/Config/postgresql/GuestPort" 5432
VBoxManage setextradata nameofyourguest "VBoxInternal/Devices/pcnet/0/LUN#0/Config/postgresql/Protocol" TCP
VBoxManage setextradata nameofyourguest "VBoxInternal/Devices/pcnet/0/LUN#0/Config/http/HostPort" 8080
VBoxManage setextradata nameofyourguest "VBoxInternal/Devices/pcnet/0/LUN#0/Config/http/GuestPort" 80
VBoxManage setextradata nameofyourguest "VBoxInternal/Devices/pcnet/0/LUN#0/Config/http/Protocol" TCP



Re: Forgot how to portforward

Posted: 29. Nov 2010, 16:10
by Sasquatch
They are no longer correct for recent versions. In case you forget again, they are always in the User Manual. It's currently set to this:

Code: Select all

VBoxManage modifyvm "VM name" --natpf1 "guestssh,tcp,,2222,,22"

Re: Forgot how to portforward

Posted: 29. Nov 2010, 16:36
by Slayer00
Where do I write that command into?

Re: Forgot how to portforward

Posted: 29. Nov 2010, 17:06
by Sasquatch
You know how you created the first rules, did you not? It is in the manual. It's a command line thing. Make sure you're in the VB install folder or have it added to your path variable.

Re: Forgot how to portforward

Posted: 29. Nov 2010, 17:13
by Slayer00
It only asks for OS, hard drive, RAM when I create new one.. No commandline or rules anywhere.

Re: Forgot how to portforward

Posted: 29. Nov 2010, 17:17
by Perryg
See Chapter 6.3.1. Configuring port forwarding with NAT in your VirtualBox users guide.

Press F1 in the main VirtualBox program or click help -> contents.

Re: Forgot how to portforward

Posted: 29. Nov 2010, 17:21
by Slayer00
Instead of forwarding me into guides... Could you just tell me where I write the commands into? :roll:

Re: Forgot how to portforward

Posted: 29. Nov 2010, 17:25
by Sasquatch
Instead of complaining, why not read the replies here?
Sasquatch wrote:It's a command line thing. Make sure you're in the VB install folder or have it added to your path variable.
Maybe that's big enough for you to read?

Re: Forgot how to portforward

Posted: 29. Nov 2010, 17:30
by Slayer00
What command line "thing"?
Where do I make sure I have added VB install folder/path? The command?
Where do I write this command into?


The guide only tells me what the command is, it doesn't tell where I need write it into.

Re: Forgot how to portforward

Posted: 29. Nov 2010, 17:32
by Sasquatch
It appears you can't use Google to search for "command line windows" or something. Just press the windows logo key + r, then type cmd. Voila, a command line.

Re: Forgot how to portforward

Posted: 29. Nov 2010, 17:40
by Slayer00
Aha... Finally.

I was unsure if it was cmd.exe or something built-in to VirtualBox.


Thanks for (finally) telling me where to write the commands into.
I got it working now.

EDIT: Whats the (new?) command for apache?