Port forwarding to ubuntu guest os

Discussions related to using VirtualBox on Mac OS X hosts.
Post Reply
kkarad
Posts: 1
Joined: 12. Jul 2008, 17:54

Port forwarding to ubuntu guest os

Post by kkarad »

Hello all

I am new to VB.

I installed Ubuntu 8.x succesfully but I fail to configure NAT port forwarding.

I issue the following commands from my mac command line:

Code: Select all

VBoxManage setextradata "dev-center" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/GuestPort" 22

VBoxManage setextradata "dev-center" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/Protocol" TCP

VBoxManage setextradata "dev-center" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/HostPort" 2222
then I restart the Ubuntu guest VM and I run ssh from my host (macosx) command line:

Code: Select all

ssh -l <username> -p 2222 localhost
the error I get is:

Code: Select all

ssh_exchange_identification: Connection closed by remote host
Do you know if I miss any configuration in either host or quest OS?

how can I check if my ssh command is actually refused by the quest os and not from the host?

Thank you in advance,

Kostas
h1d
Volunteer
Posts: 170
Joined: 3. Jul 2008, 02:10

Post by h1d »

type

"netstat -Lan"

on Mac OS and see that port 2222 is actually open (as in LISTEN) and also check that no other application is opening port 2222 before running VirtualBox.

Then also, obviously, on guest, check that you can do "ssh localhost" and it works.

You can actually write down those configuration on the client configuration XML file to be kept permanent. You might want to try that.

I've written down the XML lines on another post.
kleiko
Posts: 1
Joined: 19. Dec 2008, 05:54

ubuntu desktop lacks openSSH

Post by kleiko »

I had the same problem as the original poster.

The obvious test of checking for 'ssh localhost' on the guest OS was not obvious to me until I saw that suggestion.

Lack of openssh on the desktop ubuntu installation was indeed the problem, and easily fixed with "sudo apt-get install openssh-server".

thanks!
Post Reply