SSH a guest server in VirtualBox by port-forwarding.

Come back to Ubuntu server on VirtualBox again… Last week, I joined a training of ‘Internet GIS Technology and Web Map Server Development’ .. So this week I really need to install some software in my server.

Normally, I have installed the VirtualBox in my laptop.. So today, I just download a Ubuntu OS and install it!!

I tried to use a Ubuntu desktop 11.04 first but it was very slow (lacking).. then I decided to re-install Ubuntu OS again by using server version .. Yes, it was better.. !!! ..

I don’t know why it is very slow.. I dedicated 1.5GB of memory .. You know, I’m very impressive the Ubuntu version 9.10.. anyway, the change is normal!!

OK, just come back to main objective of this article…I NEED TO SSH to my guest server. But I can’t because the the type of network interface is NAT..

Finally I got a solution for this problem by using port-forwarding on VirtualBox feature.

First you need to install OpenSSH on your server.

$ sudo apt-get install ssh

Second, go to the network interface.

Then click on “Network Adapters…” and fill name of rule, protocol … Please see in below picture.

Then ssh to the guest server via IP port 22 …

Just try to connect your server again!!!

0 0 votes
Article Rating
Inline Feedbacks
View all comments
momma mia
momma mia
10 years ago

thanks! that saved me!

J.-Y. Park
J.-Y. Park
10 years ago

Thanks a lot. It works nicely. In fact, I would also like to know how to connect a guest OS from other computer. Thanks in advance.