NAT Forwarding to Ubuntu guest system

Discussions related to using VirtualBox on Windows hosts.
Post Reply
kefear
Posts: 6
Joined: 26. Jul 2009, 21:00
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: Ubuntu

NAT Forwarding to Ubuntu guest system

Post 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.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: NAT Forwarding to Ubuntu guest system

Post 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
kefear
Posts: 6
Joined: 26. Jul 2009, 21:00
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: Ubuntu

Re: NAT Forwarding to Ubuntu guest system

Post 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
kefear
Posts: 6
Joined: 26. Jul 2009, 21:00
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: Ubuntu

Re: NAT Forwarding to Ubuntu guest system

Post by kefear »

Nope, it is disabled.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: NAT Forwarding to Ubuntu guest system

Post 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.
kefear
Posts: 6
Joined: 26. Jul 2009, 21:00
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: Ubuntu

Re: NAT Forwarding to Ubuntu guest system

Post by kefear »

I've changed that as well ,but it doesn't work either.
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: NAT Forwarding to Ubuntu guest system

Post 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?
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.
kefear
Posts: 6
Joined: 26. Jul 2009, 21:00
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: Ubuntu

Re: NAT Forwarding to Ubuntu guest system

Post by kefear »

Of course it is running with sshd listening. I can connect to it inside VM.
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: NAT Forwarding to Ubuntu guest system

Post 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?
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.
kefear
Posts: 6
Joined: 26. Jul 2009, 21:00
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: Ubuntu

Re: NAT Forwarding to Ubuntu guest system

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