Forgot how to portforward

This is for discussing general topics about how to use VirtualBox.
Post Reply
Slayer00
Posts: 6
Joined: 29. Nov 2010, 15:51
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Windows XP, Ubuntu

Forgot how to portforward

Post 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


Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Forgot how to portforward

Post 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"
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
Slayer00
Posts: 6
Joined: 29. Nov 2010, 15:51
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Windows XP, Ubuntu

Re: Forgot how to portforward

Post by Slayer00 »

Where do I write that command into?
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Forgot how to portforward

Post 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.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
Slayer00
Posts: 6
Joined: 29. Nov 2010, 15:51
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Windows XP, Ubuntu

Re: Forgot how to portforward

Post by Slayer00 »

It only asks for OS, hard drive, RAM when I create new one.. No commandline or rules anywhere.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Forgot how to portforward

Post 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.
Slayer00
Posts: 6
Joined: 29. Nov 2010, 15:51
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Windows XP, Ubuntu

Re: Forgot how to portforward

Post by Slayer00 »

Instead of forwarding me into guides... Could you just tell me where I write the commands into? :roll:
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Forgot how to portforward

Post 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?
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
Slayer00
Posts: 6
Joined: 29. Nov 2010, 15:51
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Windows XP, Ubuntu

Re: Forgot how to portforward

Post 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.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Forgot how to portforward

Post 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.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
Slayer00
Posts: 6
Joined: 29. Nov 2010, 15:51
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Windows XP, Ubuntu

Re: Forgot how to portforward

Post 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?
Post Reply