how to ssh my virtualbox linux FROM a linux server ?

Discussions related to using VirtualBox on Windows hosts.
Post Reply
graziano68
Posts: 18
Joined: 5. Sep 2008, 17:23
Location: Rome, Italy

how to ssh my virtualbox linux FROM a linux server ?

Post by graziano68 »

Hello

I installed opensuse 11 on my windows xp using virtualbox. It works well/acceptable.

I have only a problem . I can't find a way to ssh FROM my
remote linux server CENTOS 4 TO my opensuse 11 (running via virtual box on Windows)

if my internet ip on linux vitualbox is 151.122.123.123 when I execute

ssh 151.122.123.123

..from my remote centos 4 linux server) I receive this..

ssh: connect to host 151.122.123.123 port 22: Connection refused

I think that ssh running on virtualbox is not visible at all .

Any idea to make it visible please ?

p.s. I think I am receiving this
ssh: connect to host 151.122.123.123 port 22: Connection refused
becuase on windows I have no openssh . Howeve with virtualbox running I have openssh running and I would connect with it from remote linux server. Is it possible ?
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: PUEL
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Post by Sasquatch »

How did you set your VM network settings? If you use NAT, see the manual for Port Forwarding. If you use Host Interface Networking with a Bridge, use the actual IP of the VM.
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.
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

Since use port redirection. Read the relevant section on the User Guide on NAT or google NAT guestport hostport site:forums.virtualbox.org. You redirect host:2222 to guest:22 and then ssh to host:2222.

You can also download and use PuTTY on windows as an ssh client. It's a good package. I use it all the time.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
graziano68
Posts: 18
Joined: 5. Sep 2008, 17:23
Location: Rome, Italy

Post by graziano68 »

it seems failry complicated , however I will try and update here , thank you for now

BTW currently I am using NAT . I have a router , atlantis land , and using port forwarding I allowed port SSH 22 .

Regarding PuTTY on windows as an ssh client , it will not be enough because I need also rsync on windows . However I did some try some time ago (back from linux to windows) and it was not never good because I was always losing permissions , owners and gropus . So I am trying with VM .
graziano68
Posts: 18
Joined: 5. Sep 2008, 17:23
Location: Rome, Italy

Post by graziano68 »

I did a search on this forum as you suggested.

I understood that to use SSH on port 2222 (instead of default 22) I need to do this.

Code: Select all

VBoxManage setextradata open "VBoxInternal/Devices/pcnet/LUN#0/Config/sshguest/Protocol" TCP 
VBoxManage setextradata open "VBoxInternal/Devices/pcnet/0/LUN#0/Config/sshguest/GuestPort" 22 
VBoxManage setextradata open "VBoxInternal/Devices/pcnet/0/LUN#0/Config/sshguest/HostPort" 2222 
I'm trying ( I understood the command above should be entered on terminal as root right ?)
Last edited by graziano68 on 6. Sep 2008, 12:41, edited 1 time in total.
graziano68
Posts: 18
Joined: 5. Sep 2008, 17:23
Location: Rome, Italy

Post by graziano68 »

I'm really lost where should I enter above commands ?

I always read (on forum and help section) that I should enter it , ok but exactly where and how please ?

Thank you
graziano68
Posts: 18
Joined: 5. Sep 2008, 17:23
Location: Rome, Italy

Post by graziano68 »

ok I found

I open a windows dos window, then

Code: Select all

cd C:\Programmi\Sun\xVM VirtualBox
then

Code: Select all

VBoxManage setextradata open "VBoxInternal/Devices/pcnet/LUN#0/Config/sshguest/Protocol" TCP 
VBoxManage setextradata open "VBoxInternal/Devices/pcnet/0/LUN#0/Config/sshguest/GuestPort" 22 
VBoxManage setextradata open "VBoxInternal/Devices/pcnet/0/LUN#0/Config/sshguest/HostPort" 2222 
where open is my virtual machine. I did it with the virtual machine open was running...

I restarted openSuse.

Then I tried

Code: Select all

 ssh -p 2222 localhost
it does not work/connect ...

Any help please ?
graziano68
Posts: 18
Joined: 5. Sep 2008, 17:23
Location: Rome, Italy

Post by graziano68 »

I succeded :P :P :P

I disabled opensuse firewall and I was able to connect from
remote linux to my virtual linux :D
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

I am glad that you sorted it out. I apologise for not getting back to you but I decided to have an early night (I am on GMT).

PuTTY is fine for a terminal session and for pscp. I don't really need rsync between my Windows environments and my VMs.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
graziano68
Posts: 18
Joined: 5. Sep 2008, 17:23
Location: Rome, Italy

Post by graziano68 »

no problem , Thank you !
Post Reply