Connect from Windows to Ubuntu-on-VirtualBox using Putty through SSH

So, here are some steps you need to take for connecting from Windows to Ubuntu-onVirtualBox using putty through SSH:

1- before running the Ubuntu inside the virtual box check this setting:

Setting > Network >  Adaptor 1 > Attached to> Bridge Connection

You can try using the Bridge Connection with option:

Intel Centrino Wireless-N 1030
or
Realtek PCIe GBE family Controller

2- Start the Ubuntu inside the virtual box

3- Open a Console (Ctrl + Alt + T)

4- Enter : ifconfig and check your virtual-box ubuntu IP. It should be in the same range as your main OS, for example both should be something like: 192.168.x.x (not: 10.2.x.x)
You may try different options for the Adapter in step.1 After each change, if you do not see any changes in the connection inside the VirtualBox, you can use the following commands to refresh the network connection:

~$ nmcli nm enable false
~$ nmcli nm enable true

5- In Windows run Putty (double-click)

6- Enter the IP address (from ubuntu) + select port 22 + check SSH —-> press OK

7- you should see a console asking for your username/password. Enter the information and hit enter. That’s it.

the default port for SSH connection is 22, but maybe it is different in your system, so you can check it  if you are not sure:

~$ netstat -tpln

it will show the port 22 , if it is listening, otherwise you need to set your ssh port / or maybe your firewall is blocking it.

About machinelearning1

This weblog is about Machine Learning and all related topics that one needs to challenge real world with artificial intelligence.
This entry was posted in Linux, Robotics, Ubuntu and tagged , , , , , , , , , , , , , . Bookmark the permalink.

6 Responses to Connect from Windows to Ubuntu-on-VirtualBox using Putty through SSH

  1. Reblogged this on machinelearning1 and commented:

    Updated post.

  2. borgulas says:

    This worked for me! Thanks a lot 🙂

  3. yacoder says:

    Thanks! Worked for me after installing openssh-server as described here: http://www.unixtutorial.org/2009/05/ubuntu-ssh-how-to-enable-secure-shell-in-ubuntu/

  4. Sai Prasad says:

    After doing lot of research from different websites, finally this article helped me.
    Thanks a lot.

  5. TacksamSnubbe says:

    Thanks!!!!! After trying dozens of times I finnaly got it to work!

  6. Douglas G Oechsler says:

    Hello, I did this config! Ok! By inside my network works, but from Internet no! We have a Pfsense, and other server (no VM), can be access from Internet (static public IP – to Nat – internal IP ssh, and works fine) How to config when the machine is a VM?
    Thanks attention and Help

Leave a comment