Windows – SSH from host machine Win7 to guest Fedora Machine in VirtualBox

fedorasshsshdvirtualboxwindows 7

I'm using VirtualBox on Windows 7 to run Fedora 7. I seem to have my SSH on, as /sbin/service sshd status tells me. When I do an /sbin/ifconfig, I get this:

eth0   Link encap:Ethernet  HWaddr 08:00:27:CF:5A:0B
       inet addr:  Bcast:  Mask:

I do an ssh from inside Fedora, and connect back to the guest machine.

When I do an ipconfig on my Windows machine, I get this information:

Ethernet adapter VirtualBox Host-Only Network:

    Connection-specific DNS Suffix  . :
    Link-local IPv6 Address . . . . . : fe80::b42c:a852:a0e8:1636%19
    IPv4 Address. . . . . . . . . . . :
    Subnet Mask . . . . . . . . . . . :

When I now use PuTTY, to connect to, it says connection refused. Connection to times out.

SSH service is running. I have disabled SELinux. Also, I have allowed ssh as a trusted service in system-configure-securitylevel. I have tried to switch the firewall completely, but it turns back on automatically.

Best Answer

Found the solution. The manual contains it all. Thanks Bender.

VBoxManage setextradata "Linux Guest"
"VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/Protocol" TCP
VBoxManage setextradata "Linux Guest"
"VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/GuestPort" 22
VBoxManage setextradata "Linux Guest"
"VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/HostPort" 2222