Page 1 of 1

NAT Forwarding to Ubuntu guest system

Posted: 26. Jul 2009, 21:09
by kefear
Hello,
I'm experiencing problems with ssh'ing to Ubuntu guest system from Windows XP. I've setup everything according to documentation, src and dst ports equal to 2222. However when I do 'netstat -na | grep 2222' on Windows host it reports that there is no port opened. I've googled for the solution for a while but I haven't found a right one yet.
Any help will be appreciated

Output of getextradata:

C:\Program Files\Sun\xVM VirtualBox>vboxmanage getextradata "Ubuntu" enumerate
VirtualBox Command Line Management Interface Version 3.0.2
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

Key: GUI/SaveMountedAtRuntime, Value: yes
Key: GUI/ShowMiniToolBar, Value: yes
Key: GUI/LastCloseAction, Value: powerOff
Key: GUI/LastWindowPostion, Value: 5,25,720,440
Key: GUI/Fullscreen, Value: off
Key: GUI/Seamless, Value: off
Key: GUI/AutoresizeGuest, Value: on
Key: GUI/MiniToolBarAutoHide, Value: on
Key: Vbox Internal/Devices/pcnet/0/LUN#0/Config/guestssh/Protocol, Value: TCP
Key: Vbox Internal/Devices/pcnet/0/LUN#0/Config/guestssh/HostPort, Value: 2222
Key: Vbox Internal/Devices/pcnet/0/LUN#0/Config/guestssh/GuestPort, Value: 2222

PS: I can provide some more information about systems,hardware,configuration etc. if needed.

Re: NAT Forwarding to Ubuntu guest system

Posted: 26. Jul 2009, 21:18
by Perryg
I think you have a configuration error. See the output of my NAT forward below

Code: Select all

Key: VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/HostPort, Value: 2222
Key: VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/GuestPort, Value: 22
Key: VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/Protocol, Value: TCP

Re: NAT Forwarding to Ubuntu guest system

Posted: 26. Jul 2009, 21:42
by kefear
You're right , but changes didn't help.

C:\Program Files\Sun\xVM VirtualBox>VBoxManage getextradata Ubuntu enumer
VirtualBox Command Line Management Interface Version 3.0.2
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

Key: GUI/SaveMountedAtRuntime, Value: yes
Key: GUI/ShowMiniToolBar, Value: yes
Key: GUI/LastCloseAction, Value: powerOff
Key: GUI/LastWindowPostion, Value: 24,40,720,440
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/ssh/Protocol, Value: TCP
Key: VboxInternal/Devices/pcnet/0/LUN#0/Config/ssh/GuestPort, Value: 3333
Key: VboxInternal/Devices/pcnet/0/LUN#0/Config/ssh/HostPort, Value: 3333

C:\Program Files\Sun\xVM VirtualBox>netstat -na | grep 3333

Re: NAT Forwarding to Ubuntu guest system

Posted: 26. Jul 2009, 21:48
by vbox4me2
Firewall?

Re: NAT Forwarding to Ubuntu guest system

Posted: 26. Jul 2009, 22:07
by kefear
Nope, it is disabled.

Re: NAT Forwarding to Ubuntu guest system

Posted: 26. Jul 2009, 22:09
by Perryg
I don't profess to be the best at port forwarding but having the host and guest port set to the same thing just does not look right to me.

Re: NAT Forwarding to Ubuntu guest system

Posted: 26. Jul 2009, 22:51
by kefear
I've changed that as well ,but it doesn't work either.

Re: NAT Forwarding to Ubuntu guest system

Posted: 26. Jul 2009, 22:52
by Sasquatch
Whatever the case now, there is one thing I wonder and the TS failed to mention: Is the VM actually running? If it isn't, how do you think it can open a port if the process that's supposed to listen to it isn't running?

Re: NAT Forwarding to Ubuntu guest system

Posted: 26. Jul 2009, 22:55
by kefear
Of course it is running with sshd listening. I can connect to it inside VM.

Re: NAT Forwarding to Ubuntu guest system

Posted: 26. Jul 2009, 23:00
by Sasquatch
So you ran the netstat command while the VM was running? Ok, that's strange. Now, you installed openssh-server in the guest since sshd is running, did you also try to connect to localhost with an SSH client like Putty from the Host? And how can you use grep on the Host? Did you install cygwin?

Re: NAT Forwarding to Ubuntu guest system

Posted: 27. Jul 2009, 09:11
by kefear
Yup. I have tried to connect with either ssh command line client and putty. And , yes, I have cygwin installed on my Windows Host system. As I said, there is no needed port opened on host so there is nothing ssh client can bound to.