Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The host operating system is Windows 7, the guest operating system is ubuntu 10.04(openssh installed). I have internet access on Ubuntu but I also want to access it from the same computer throught SHH. What should I do?

share|improve this question

migrated from Jan 2 '11 at 9:55

This question came from our site for professional and enthusiast programmers.

migrate it to superuser !? – Michel Gokan Jan 1 '11 at 12:07
you might get better answer if you could ask it on – Vikas Patidar Jan 1 '11 at 12:08

This guide should help you VirtualBox + Ubuntu + SSH + x11

share|improve this answer

You your virtual machine uses NAT networking you should forward SSH connection from your host to guest. You can do it by executing such command on host:

VBoxManage setextradata <guestname> "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/HostPort" 22222
VBoxManage setextradata <guestname> "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/GuestPort" 22
VBoxManage setextradata <guestname> "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/Protocol" TCP

It allows you to forward all connection to port 22222 on host machine to port 22 on guest machine.

Then you can execute SSH on your host:

ssh -p 22222 username@localhost

You have to connect to your localhost to port 22222 and these connection will be forwarded to the guest machine.

share|improve this answer

Not quite a programming question, but anyways, to connect to your Linux host via SSH from Windows, you can use PuTTY. Login to the virtual machine manually and run ifconfig command in the terminal to find out the IP address of the VM.

share|improve this answer
thanks for the answer, but unfortunately PuTTY just can't connect. On VirtualBox, the network adapter is attached to NAT if this is going to help somehow. – mrtksn Jan 1 '11 at 12:14
why don't u use a bridge to connect? – wliao Jan 1 '11 at 12:17

In the virtualbox manager, create a 2nd virtual network card for the Ubuntu guest and set its type to host only (not NAT nor Bridged).

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .