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

On a Windows 7 desktop, I've installed an Ubuntu virtual machine with VirtualBox.

On the virtual machine, I've installed OpenSSH and can connect to it from other 'real' machines on the network through its local 192.168.0.* address.

The question is, how can I set it up, so I can SSH into it over the internet?

My ISP gives me a dynamic address and I've set-up an account with No-IP.

share|improve this question
up vote 1 down vote accepted

If you have your Windows machine behind a home router doing NAT, you can switch the virtual network card into bridged mode in the VirtualBox configuration. This will allow your VM to get an address from the router directly. You can then either set your router to give the VM a reserved address or set Ubuntu up inside the VM with a static address, and set your router to port-forward port 22 to the IP address the VM is using.

share|improve this answer
Some ISPs limit traffic on port 22. If this is the case for you, setup your router to listen on port "x" and forward it to ip_of_ubuntu:22" on the inside of your network. From there you just have to issue "ssh -p port_number" to log into Ubuntu from the outside – matrixx333 Mar 17 '12 at 1:57
Thanks guys, that worked. Sorry I can't upvote, I don't have enough 'reputation points' apprently! – Tony Blundell Mar 19 '12 at 9:36

The one thing that will probably save you more time and efforts than anything would be to use Hamachi from LogMeIn. It will create a zero config VPN. You install it in Ubuntu. Download Hamachi and install it, it will require the lsb package.

sudo apt-get install build-essential lsb

sudo dpkg -i <hamachi.deb file>

Install Hamachi on the other computer that you will be using to access Ubuntu.

Create a network either through Hamachi or LogMeIn's website interface. Join both computers to the newly created network. They will not have a direct tunnel to each other without having to open up any ports on your firewall. Even if your ISP gives you a new IP address, you will still be able to connect to the Ubuntu VM without any reconfigurations.

The other thing to do is to install LogMeIn on your desktop that is hosting the VM. This will allow you to remote into the computer and start the VM if it crashed or if you've forgotten to install it.

I use this setup every day and makes life so much easier.

share|improve this answer
Thanks, will check it out. – Tony Blundell Mar 19 '12 at 9:36

You must log in to answer this question.

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