Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

I have installed Ubuntu Server on a virtual machine in VirtualBox which runs on Windows 7. How can I connect through ssh to that virtual machine?

I go and type 'ifconfig', and i get this address "". But when I try ssh it can't establish the connection.

share|improve this question
up vote 2 down vote accepted

The easiest way is to set up the network interface of the virtual machine to "Bridged mode" in virtualbox.

You do that by selecting the virtual machine (in VB) then go to settings > network, and change the attached to dropdown from NAT to bridged

After that, you virtual machine should get an IP address of your local network (similar tot he one of the host pc) and you should be able to ssh it with that IP.

share|improve this answer
Actually you don't need to set it up in bridged mode, but bridged mode is the easiest way to solve your issue. If you want to keep your machine in NAT, you have to do a port forward rule in your virtualbox machine NAT settings. – tomodachi Nov 8 '12 at 23:59
thanks tomodachi, i updated the answer to reflect it's the easiest and not the only way – Sam Nov 9 '12 at 1:01

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.