Connect to a remote Linux desktop with x11vnc and Gtk VNC

Jack Wallen
Jan 24, 2010
Updated • Dec 2, 2012
Linux
|
6

Being able to do remote administration is crucial to many system administrators. And there are plenty of tools available for this job. You can use command line tools and full-blown GUI tools. Of course many users prefer to do things as simply as possible. Fortunately Linux has the right tools to make such a task simple. The ability to do graphical remote desktop administration is just a matter of having the vnc server running on the target machine and then running the desktop viewer on the local machine.

In this article I will show you how to take control of a remote Linux desktop with the help of x11vnc, Remote Desktop Viewer, and secure shell. You will, of course, have to have secure shell access to the remote machine. Other than that you have everything you need. So let's get to work.

Installation

You will need the following installed in order to take on this task.

Local machine

  • VNC client (such as gtk vnc)
  • Ssh client (openssh works fine)

Remote machine

  • Ssh server (openssh-server works great)
  • VNC server (x11vnc is my recommdation)

Fire up your package management tool, search for the above applications, and install each. If you do not already have the secure shell server installed on the remote machine, you will need physical access in order to install the tools. If you already have the ssh server installed you can simply ssh to the remote machine and install the VNC server from command line (such as sudo apt-get install x11vnc) Once you have these installed you are ready to start setting up your connection.

x11vnc

The first thing you need to do is secure shell to the remote machine (we'll say the remote machine is at IP address 192.168.1.10) and start up the VNC server. From the command line (on the remote machine) you will enter the command x11vnc. This will start the VNC server but you will not get your bash prompt returned to you. To have your VNC server running at all times you could add the line:

x11vnc &

to the end of your /etc/rc.local

The Client Machine

Figure 1

For the purposes of this tutorial I will use the Gtk VNC Viewer. It is a very simple to use, up to date, client. You will find this tool in Applications > Internet. When you first start it up you will see a fairly straight-forward connection window. You only need enter:

  • IP Address:Port: IP address and port of the remote machine (in the form of 192.168.1.10:5900). NOTE: x11vnc uses port 5900 by default.
  • User name: The user name you will connect with on the remote machine.
  • Password: Password of the user on the remote machine.

If you know the above information is correct (and you know you'll be connecting to this machine again) click the Add button to add the remote machine (as shown in Figure 1).

To connect to the remote machine either enter the information in the text areas and click the Connect button or double click on a saved machine from the list.

Figure 2

When you connect a new, maximized window will open showing your remote desktop (see Figure 2). From this window you can do the following:

  • Disconnect: Disconnect from the remote machine.
  • Send keys: Send key-combinations to the remote machine.
  • Fullscreen: Switch to a full screen window.
  • Screenshot: Take a screen shot of the remote desktop.
  • Make icon on desktop: Create an icon that allows you to connect to this remote desktop with a double-click.

You can now interact with this remote machine as if it were your own desktop.

Final thoughts

Taking advantage of the remote desktop is a great way to train users or trouble shoot problems on a remote machine. I use this exact setup for a number of clients. It works well.

Advertisement

Previous Post: «
Next Post: «

Comments

  1. Fela said on July 1, 2021 at 6:49 am
    Reply

    Hey, in addition to x11vnc and Gtk VNC, one can also use tools like R-HUB remote support servers, logmein, Teamviewer etc. for all online remote desktop needs. These work on all platforms including Linux, Unix etc.

  2. Mohamadreza Rezaee said on July 29, 2011 at 7:37 pm
    Reply

    Anybody I Research for the fastest Browser Unit Global Gear General Grand great Cellular for My phone SonyEricsson j10i2 china k970 on my local Middle East Iran Mazandaran Amol by LiveLandLarge Name “USAMOL”

  3. David Legg said on January 25, 2010 at 10:58 am
    Reply

    If you use something like tigervnc on Fedora, it detaults to making connections using an ssh tunnel, which is rather more secure over the Internet. Using vnc on port 5900 is usually fine for local connections with no security implications, though.

  4. Fabius said on January 25, 2010 at 12:31 am
    Reply

    So! How could I do this from windows xp??

    Thanks,

    Fábio

    1. Jim said on January 25, 2010 at 6:58 am
      Reply

      I’ve used and had good luck with the RealVNC free client/server on XP. http://www.realvnc.com/products/free/4.1/download.html

    2. Shon said on January 25, 2010 at 3:22 am
      Reply

      I am assuming you want to view with Windows…..

      Same steps as outlined above….

      Use a tool like putty to ssh into your server, and a windows version of a vnc client, like ultravnc, to take control of the linux machine.

Leave a Reply

Check the box to consent to your data being stored in line with the guidelines set out in our privacy policy

We love comments and welcome thoughtful and civilized discussion. Rudeness and personal attacks will not be tolerated. Please stay on-topic.
Please note that your comment may not appear immediately after you post it.