Ubuntu – How to run GUI applications remotely on a headless server

firefoxserver

I'm new to Ubuntu – sorry for novice questions. What I have – is Ubuntu server, to which I have access only via ftp and putty. What I would like to do – is to run firefox (or any other browser) from that Ubuntu machine.

I've managed to install firefox , but when I'm trying to run something like this:

x-www-browser http://google.com

It is saying:

Error: no display specified

I don't understand – there is no display at all at Ubuntu sever – it is just computer case on rack, the only display I have – is mine.

Don't know, how to redirect this display output to my machine (if this is possible at all).

Best Answer

This is more than possible using X11 tunneling. The exact instructions for doing this differ depending on the platform you are using to connect to the server.

Windows XP/7/8

You will need to download and install the following tools:

Once you have Xming installed, launch the program. You now have an X11 session running locally on your computer. When you launch PuTTY to connect to the server, expand the "SSH" column on the left and click on "X11":

enter image description here

Now make sure the "Enable X11 forwarding" checkbox is checked:

enter image description here

Connect to the server as you normally would. Now when you run an X11 application (such as Firefox) it will use your local X11 server:

enter image description here

Ubuntu 12.04+

X11 forwarding in Ubuntu is incredibly simple. You don't even need to use PuTTY. Just open a terminal and use the SSH command:

ssh -X myserver.example.com