Page 1 of 1
Port Forwarding
Posted: 7. Mar 2011, 20:39
by U2XS
I've read the documentation on port forwarding & I'm not sure how to make that work in Windows. Right now, the command that I have for my Linux guest is
"C:\Program Files\Oracle\VirtualBox\VBoxHeadless.exe" --startvm Ubuntu
Would I then run the command again & type something like this?
VBoxManage modifyvm "Ubuntu" --natpf1 "guestssh,tcp,,2222,,22"
Or would I somehow concatenate it into one line?
Re: Port Forwarding
Posted: 7. Mar 2011, 20:55
by Perryg
VBoxManage modifyvm "Ubuntu" --natpf1 "guestssh,tcp,,2222,,22"
Is a command to modify the guest and saves the information to the guest.xml or guest.vbox depending on your version and only needs to be run once (per guest).
Re: Port Forwarding
Posted: 7. Mar 2011, 21:04
by U2XS
That's easy enough. Thanks
Re: Port Forwarding
Posted: 9. Mar 2011, 00:07
by U2XS
I ran the following four commands to open up my FTP, SSH, Telnet & SMTP ports. However when I went to test Telnet & SSH with ports 2222 & 2323 it didn't work. Each command did create a command window which speedily processed some infromation & closed itself.
My guest is Ubuntu 11.04 (Alpha) & I did install OpenSSH Server. Did I miss a step?
Code: Select all
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" --modifyvm "Ubuntu" --natpf1 "GuestFTP,tcp,,2121,,21"
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" --modifyvm "Ubuntu" --natpf1 "GuestSSH,tcp,,2222,,22"
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" --modifyvm "Ubuntu" --natpf1 "GuestTelnet,tcp,,22323,,23"
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" --modifyvm "Ubuntu" --natpf1 "GuestSMTP,tcp,,2525,,25"
Re: Port Forwarding
Posted: 9. Mar 2011, 00:33
by Perryg
Did you try giving the forwards their own number?
natpf1,natpf2,natpf3,natpf4 instead of all of them trying to use the same name?
Re: Port Forwarding
Posted: 9. Mar 2011, 19:30
by U2XS
Perryg wrote:Did you try giving the forwards their own number?
natpf1,natpf2,natpf3,natpf4 instead of all of them trying to use the same name?
Hmm, so I tried a few things. I did rename them to 1,2,3,4,etc. I also realized that the "--" before modifyvm was incorrect. However even when the command prompt was accepting the command, it still didn't work. Finally, I realized that the version of Virtualbox I have
does have a GUI for this! So it was easy enough then & now it works. I do still wonder why it didn't work with the command line though. Thanks for the help!