How To Configure Remote Access To Your Ubuntu Desktop - Page 3

4 Connecting From An Ubuntu Client

On an Ubuntu client, we don't have to install any software to connect to the remote desktop - it's all there. We can simply use the vncviewer command from chapter two. Open a terminal (Applications > Accessories > Terminal):

Then type in the vncviewer command from chapter two, e.g.


A window opens where you must type in the password for the remote desktop:

Afterwards, the remote Ubuntu desktop opens in a new window:

To stop the connection, simply close the window.


5 Links

Share this page:

23 Comment(s)

Add comment


From: Anonymous at: 2009-05-01 20:13:16

Thanks for the article! I found this works and on Kubuntu too! However, for those that don't want to set all these steps up, there are programs that let you do this without much tinkering. Among these remote control software bundles some are free (like CrossLoop) and others cost money but are typically more robus and more secure.

From: Anonymous at: 2010-01-12 09:09:15


I have already activated the remote desktop on PC - A, now i want to access the PC-A from PC-B, how do i do that.

All the PCs here have Ubuntu installed on them.

Kindly advise

From: at: 2008-02-12 03:09:30

This simple HowTo is great. It is pretty straight forward and works super fast, the built in tools with (LinuxMint)Ubuntu are excellent. I check out your new post daily, HowtoForge is part of my iGoogle home page, so I see the headlines every day. Keep up the good work Falko!

Based on your solid detailed tutorials I have set up an Apache LAMP server, where I test web pages, JavaScript, Ajax, PHP stuff and now I have remote desktop that I can access from a Windows client. I am all set, but keep the tips coming....



From: at: 2008-02-12 15:27:23

If you are looking for something that responds as fast as RDP for Windows does you may want to look into Nomachines NX product.  Very responsive.  However if you want to attach to the console it is only marginally faster than VNC.

Download the Client, Node and Server packages from

Then simply run:

sudo dpkg -i nxclient.<version>

sudo dpkg -i nxnode.<version>

sudo dpkg -i nxserver.<version>

You will also need to make sure that SSH is installed and running on the machine:

sudo apt-get install ssh

Then download and install the client on a remote machine (windows, linux whatever) and point the client to your server's IP on port 22.  It should connect and startup a new X desktop for you.  Keep in mind this is a NEW desktop.  If you want to see the existing (console) desktop then you will need to change the  "Desktop" config to "Shadow" however as I mention this is only marginally faster than VNC.  Nomachine has been working on that feature to improve it.

Any questions please ask in the forum. 

From: Dan at: 2009-03-27 19:12:02

Thanks for this post.  It was very easy to walk another person through the process over the phone using the guide and it I was able to get access within just a few minutes.

From: Anonymous at: 2009-01-26 02:07:26

Does not work ... after following these instructions, have not found any that work, including no machine's.  Wasted hours typing in command lines and looking for solutions on the internet.  Windows remote desktop is great ... the more I use linux the more I like windows ... well not vista.

From: Splitice at: 2009-06-27 00:57:20

Thanks for this guide, really helped me.


From: Adriano1 at: 2009-09-11 02:10:02

Very nice  Site Number One Topic. Based on your solid detailed tutorials I have set up an Apache LAMP server, where I test web pages, JavaScript, Ajax, PHP stuff and now I have remote desktop that I can access from a Windows client. I am all set, but keep the tips coming.... Thanks,Regards

From: Vaibhav Puranik at: 2010-03-04 17:56:30

NX is a much better way to do remote desktop. Here are some simple steps to enable remote desktop via NX server -

From: David at: 2010-12-07 12:08:50

Im not a linux pro, so I use erd which is a JavaFX and browser based solution for this. It runs on Win and Linux (and maybee on OS-X too).

You can find it on:

From: Koowie at: 2011-04-30 21:41:43

Thanks for the info.

From: Matt at: 2012-07-26 04:28:37


Just got this to work with Windows 7 64-bit viewing an Ubuntu 12.04 LTS 64-bit box.

Thanks for the solution! :)

From: Bren at: 2014-01-30 21:24:40

After using the extra commands given this worked nicely. Thanks for your help!

From: Matt at: 2008-11-22 05:27:42

I have read your tutorial 

How To Configure Remote Access To Your Ubuntu Desktop - Page 2

 and I'm successfully connect from a Windows XP system to ubuntu machine.  The problem is i have to logon (locally) first on ubuntu machine, before i could remotely connect via VNC from my XP system. Without logon locally on ubuntu, i got message : Unable to connect to host : Connection refused (10061). This's not happening when i logon on Ubuntu Machine, i can connect smoothly to Ubuntu Machine via VNC Viewer. I'm using Ubuntu 8.04.

From: Robert at: 2010-02-21 12:02:57

Thanks for the tutorial. It works for me as well on CentOS 5.4. However, I had a problem in the beginning because my CentOS firewall didn't allow the VNC client to enter. This was solved by opening port 5900.



From: Anonymous at: 2010-03-08 20:00:34

Thanks for the tutorial esp with the vnc part. It was really easy to figure it out. It works perfectly for me and now I dont have to use a vmware player for linux... I can directly connect my windows to my linux desktop machine and work on it remotely.

From: doglover at: 2011-08-05 16:41:16

This is a really good tutorial, thanks! But can you do the remote access using a mac and a ubuntu?

From: Anonymous at: 2011-12-21 16:07:14

A very good tutorial fast and easy to use and understand. Thanks

From: Vladimir at: 2009-01-02 21:48:15

This description is nice but what about iptables? How do I configure iptables to accept connection from local network?

From: Paul at: 2009-10-04 12:04:50

iptables -I INPUT -s -p tcp --dport 5900 -j ACCEPT

               Where - your local network  (Example: you can get this by reading

 your routing table:

       Win:  Start -> Run -> cmd ->OK -> route print (in the black command propt window that opens )

          Linux : /sbin/route -n (in a terminal console) Look for the row that starts like your IP address

mmm.mmm.mmm.mmm - your netmask (Example:



From: Anonymous at: 2009-08-25 13:01:53


Nice job on this tutorial. You answered 98% of my questions and I have successfully viewed my Ubuntu 9.04 desktop from my Netbook using XP and TightVNC.


From: Anonymous at: 2009-10-12 16:46:36

So I have this all setup and working great, thank you very much, but have come across one issue that I am hoping you can help me with.  If the remote server is not currently logged on then I cannot connect to it.  If somebody is not logged onto the remote server then I get a "failed to connect" error but if somebody is logged onto the remote server then the connecting computer will connect just fine, even if the screen is locked.  I would think there would be a setting for this so the service can  start with the system without a user having to log on, I can't be the only one to have a problem with this.  It is a real problem when I try and work on the remote server over a weekend and need to reboot but nobody is available to log on locally.

From: D.A. at: 2009-10-27 01:00:13

Try setting your target machine's router to also forward 5901 (UDP & TCP) to the local LAN IP address of the target machine attached to it.  Then use display number 1 instead of 0 when connecting to the target with RealVNC or TightVNC or UltraVNC or whatever VNC you like, i.e.,




  - where "" is the dyndns service URL linked to your target PC
  - or where is the external IP address of your router (facing the Internet)
  - where "1" is the display number of your Ubuntu desktop following the local user's display which is usually display 0

- - -

 Important note: passwords for RealVNC and UltrVNC are sent over the LAN/WAN in clear text and could be sniffed by a prowler monitoring your system(s).  It is usually recommended to set up a secure socket layer (SSL) tunnel first when accessing remote PC's via the Internet using VNC.

 - - -

Also of note: I've never set this up with Ubuntu (yet) but have done so many times with Mandriva and OpenSuse.  Both worked fine as described.

Good luck!

-- DA