Page 1 of 1

NAT w/ Debian Hosts and Guest

Posted: 20. Aug 2009, 19:34
by inetken
Having trouble trying to ssh into a guest. Both host and guest are running Debian Lenny. The host IP is 10.84.1.81 and the guest 192.168.0.10, here is the config of the port forwarding:

Code: Select all

$ VBoxManage getextradata "sageserver" enumerate
VirtualBox Command Line Management Interface Version 3.0.4
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

Key: GUI/SaveMountedAtRuntime, Value: yes
Key: GUI/ShowMiniToolBar, Value: yes
Key: GUI/MiniToolBarAlignment, Value: bottom
Key: GUI/LastWindowPostion, Value: 298,195,720,451
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/sagessh/Protocol, Value: TCP
Key: VBoxInternal/Devices/pcnet/0/LUN#0/Config/sagessh/GuestPort, Value: 22
Key: VBoxInternal/Devices/pcnet/0/LUN#0/Config/sagessh/HostPort, Value: 2222
netstat output on the host

Code: Select all

$ netstat -na | grep 2222
tcp        0      0 0.0.0.0:2222            0.0.0.0:*               LISTEN
netstat output on the guest (copied not cut and paste)

Code: Select all

$ netstat -na | grep 22
tcp        0      0 0.0.0.0:22            0.0.0.0:*               LISTEN
tcp6       0      0 :::22                 :::*                    LISTEN
NIC Info from VBoxManage showvminfo

Code: Select all

NIC 1:   MAC: 08002753879B, Attachment: NAT (192.168/16), Cable connected: on, Trace: off (file: none), Type: Am79C970A, Reported speed: 0 Mbps
I can ssh to the host from anywhere and ssh to the guest when logged into the virtual machine. When I try to ssh in via the host or network it just hangs with no response and eventually times out. I've disabled the firewall on the host, guest has no firewall and the guest accesses the network fine.

Thanks for any help,
Ken

Re: NAT w/ Debian Hosts and Guest

Posted: 20. Aug 2009, 21:19
by baf
From the manual 9.12.1
the following command:
VBoxManage modifyvm "My VM" --natnet1 "192.168/16"
This command would reserve the network addresses 192.168.0.0 ...
192.168.254.254 for the first NAT network instance of “My VM”. The guest IP
would be assigned to 192.168.0.15 and the default gateway could be found at
192.168.0.2.
So try using 192.168.0.15 in your guest instead.