How to Access Your Ubuntu Remotely
June 23, 2007 – 1:20 pmWhen I develop for ThemBid.com I often work remotely. When I was using Windows XP I would use UltraVNC to access my desktop remotely, then when I “upgraded” to Vista I did not take to the time to do that, instead I used the built in Remote Desktop feature. Now that I have truly upgraded to Ubuntu, I want to be able to access my machine remotely. This blog post describes two methods.
First things first. You must make sure you can access your computer through the Internet. If you don’t have a static IP address, this means you must subscribe to a service that can dynamically map your IP to a domain address. I use no-ip.com now and I have used dyndns.com.
Next, you will need to make sure your router and firewall will allow traffic into the ports you will open for remote access.
Finally, you must install the SSH server on your computer. I just typed in “sudo apt-get install openssh-server” and I was good to go.
Following are the two methods I suggest:
- Command Line SSH
- This is nice because I can ssh into the computer via any computer with Putty, and even with my Pocket PC.
- After downloading Putty
- Type in the Host Name and choose ssh
- Under Connection->SSH->X11 check Enable X11 forwarding.
- Under that next to X display location you will type in [your ip or domain]:[display number]
- Find the display number by typing env into a bash prompt and look at the DISPLAY variable.
- Save your configuration by typing in a “Saved Session” name and clicking the save button under the Session Category.
- Double click the saved session and then you are ready to login.
- X through SSH
- Download and install Xming.
- Go to Program Files->Xming->XLaunch
- Choose how you want your display to work.
- For “Display Number”
- Find the display number by typing env into a bash prompt and look at the DISPLAY variable.
- Click Next
- Choose “start a program” and click next
- Choose “Using Putty”, fill out the configuration information (leave the password blank) and click next until you get to the final screen
- I suggest you save your configuration
- Now open up Putty
VNC is another option and it can be secured over SSH. Here is a tutorial for that.
33 Responses to “How to Access Your Ubuntu Remotely”
You might want to consider FreeNX instead of X forwarding; it’s very substantially faster.
By Jeff Goldschrafe on Jun 24, 2007
If you want to get access to the whole desktop, or want to use graphical applications over low-bandwith connections, the by far best solution at the moment is to use NX. Go over to http://www.nomachine.com/ and look.
If you have just one or two users on your machine, download the free server version from Nomachine. If you have more users, get hold of the freenx part of the Seveas’ apt repositories, see e.g. http://mirror.ubuntulinux.nl/.
If you have several users, and they want to disconnect and reconnect using Windows machines as clients, you should seriously consider just paying up for the commercial NX version. It just works better.
By Harald NordgÄrd-Hansen on Jun 24, 2007
Don’t use X through SSH. Use NX. It handles compression, security, and also a proxy server for X so you don’t send as much data in the first place. It’s basically X over SSH, but usable over the internet.
https://help.ubuntu.com/community/FreeNX
By BobPaul on Jun 24, 2007
A hell of a lot of extra work there Jerky.
Why not just enable Remote Desktop
(System/Preferences/Remote Desktop)
and not worry about all your round-about methods?
By Anonymous on Jun 24, 2007
Just for the sake of simplicity, you can type ‘echo $DISPLAY’ (no quotes) to get a one-liner.
Typing env and then looking for the DISPLAY variable amongst all others is kind of disappointing for a newcomer.
By Igor Almeida on Jun 24, 2007
http://nomachine.com/
That is the best I have used for it. SSH built in, compression, and it hauls.
By xamox on Jun 24, 2007
Why not use FreeNX? Secure and faster than VNC.
By FrdPrefct on Jun 24, 2007
I just use X forwarding over ssh. You don’t need any additional software, and with the right options it’s quite fast (to optimize: Use a faster encryption than the default one, and remember the -C option to turn on compression.)
By Joar on Jun 24, 2007
NX (http://nomachine.com) is a fantastic program which compresses the X protocol to make it faster and more responsive. I can actually do GUI work now over a DSL line. The client is free (available for Windows, OS X, Linux, Solaris), the protocol libraries are open source, and the personal server (1 user) is free.
If you need more than one user logged in via NX at a time, you either need FreeNX, which I’ve found to be very fragile and hard to setup, or the multi-user NX server from nomachine, which is easy to setup but costs money.
By Stan on Jun 24, 2007
In almost all ways I much prefer Linux to Windows, but this is the exception. Remote Desktop is simply much better than either X or VNC. For some reason X is painfully slow. Try to do a full desktop export of Linux over the network by starting up the X server and typing in gnome-session. It works but usually takes at least a minute to start up at all.
And even once up it still takes time to do anything.
VNC can be better, but it also is slow. This is because VNC is shipping out mini images of the screen. If you type out the letter ‘q’, VNC doesn’t just tell the client to update the screen by adding a new letter ‘q’, it actually renders the letter ‘q’ on the server and sends out the image of the ‘q’.
Terminal services only sends out a description of the changes (ie- the only traffic in the above example would be the letter ‘q’ with some meta data about where it should be placed).
Someone has to start a similar project in the Linux world.
By Inquirydog on Jun 24, 2007
If you don’t mind using proprietary software then you could also connect using FreeNX. I made a guide about doing this with Mac OSX and Ubuntu but then principal should be the same for Windows.
You can read it at http://rubric-cube.blogspot.com/2007/05/setting-up-home-server-part-one-remote.html
By Richard James on Jun 24, 2007
NX by Nomachine is a great remote access solution.
Its essentially X through SSH, however, it is compressed and accellerated, which makes it much more responsive over slower links. There are clients for Windows, Mac, Linux, and Solaris
The person free, partly open source, is at nomachine.com
By WaffleMatt on Jun 24, 2007
Have you tried xrdp, Works just as well as X11 forwarding and can use the inbuilt windows remote desktop client.
By Adam on Jun 24, 2007
Cygwin also has an ssh package, though it is not installed by default. I prefer it instead of the venerable Putty — the command-line interface is closer to that which with I’m familiar in Linux.
By Keith on Jun 24, 2007
There are so many better ways to do that
By max on Jun 24, 2007
x11vnc tunneled over ssh
By name on Jun 24, 2007
FreeNX is another great option for graphical remote access to a Linux box. Here’s a howto for ubuntu systems. http://ubuntuforums.org/showthread.php?t=97277&highlight=freenx
By Kastyr on Jun 24, 2007
Replace Ubuntu with Ubuntu/Linux. Enjoy!
By ethomas on Jun 24, 2007
you should really look into freenx.. its a remote desktop which is far far faster than vnc, works over ssh, can suspend/resume sessions, is able to pass audio/printers from the server to the client, has windows and linux clients, and is even available via seveas’ ubuntu package repositories.
By steve on Jun 24, 2007
http://www.nomachine.com/ - you will be amazed how fast it is. even on a shitty connection. give it a try, you will surely be impressed
By Christopher Demicoli on Jun 24, 2007
you forgot about FreeNx
By Jessta on Jun 24, 2007
If you’re accessing your machine from another *nix machine or OS X with X11, all you have to do is run:
ssh -X some.remote.machine.dot.com
then any GUI program you run will appear on your local screen even though it’s running remotely
By Paul Betts on Jun 24, 2007
The free NX viewer (@ http://www.nomachine.com) is vastly superior to VNC or X over SSH. It is darn close to being as fast & responsive as Remote Desktop, one of the few things Microsoft really did well. Under the hood I think it is just a tweaked / compressed X connection but it blows away plain X. Install 3 RPMs on Linux (the node, server and NX Free) and then use the Linux or Windows client remotely.
By Tim Miller on Jun 24, 2007
I use XRDP to allow me to access the box via RDP clients. It’s a wrapper for VNC and is not difficult to install at all.
http://xrdp.sourceforge.net/
By Maz on Jun 24, 2007
How about FreeNX ?
It works over ssh and provides a much better experience than pure X over ssh.
Gotta try it, it’s really great.
(I wrote a tutorial - in french, sorry: http://www.commentcamarche.net/faq/sujet-6709-installer-le-serveur-freenx and http://www.commentcamarche.net/faq/sujet-6687-installer-nx-server )
By sebsauvage on Jun 24, 2007
VNC?
vnc over ssh?
X over ssh?
Nevermind.
NX
http://www.nomachine.com
By dietrich on Jun 24, 2007