ssh to linux guest using NAT virtual interface

This is for discussing general topics about how to use VirtualBox.
Post Reply
malayo
Posts: 3
Joined: 15. Mar 2011, 15:51
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Debian, Windows, CentOS

ssh to linux guest using NAT virtual interface

Post by malayo »

hi,
how do i would be able to connect to linux guest via ssh client that is using NAT virtual interface? This could be achieved easily without any configuration on vmware player but i'm not sure about vbox.

i'm using vbox 4.0.4 on debian squeeze
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: ssh to linux guest using NAT virtual interface

Post by Perryg »

Chapter 6.3.1 Configuring port forwarding with NAT in your VirtualBox users manual.
malayo
Posts: 3
Joined: 15. Mar 2011, 15:51
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Debian, Windows, CentOS

Re: ssh to linux guest using NAT virtual interface

Post by malayo »

so i tried

Code: Select all

$ VBoxManage modifyvm "centos5-64bit iredmail" --natpf1 "guestssh,tcp,127.0.0.1,2222,,22"
but maybe i did it wrongly

Code: Select all

$ ssh -p 2222 root@127.0.0.1
ssh: connect to host 127.0.0.1 port 2222: Connection refused
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: ssh to linux guest using NAT virtual interface

Post by Perryg »

Have you set up the guest to accept ssh connections?
malayo
Posts: 3
Joined: 15. Mar 2011, 15:51
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Debian, Windows, CentOS

Re: ssh to linux guest using NAT virtual interface

Post by malayo »

silly me, i forgot to start the guest :mrgreen:
Post Reply