SSH – Simplest Way to Have Remote GUI Access to Ubuntu 16.04 Server

guiremotessh

I'm trying to figure out what is "lightweight" way to configure my Ubuntu 16.04 LTS server to have access via GUI (over SSH as option). I would like to reach it from my Ubuntu 16.04 workstation. I have really poor knowledge about how those techniques work. I read about X11 and it seems it's possible to just install Xorg server and enable X11 forwarding and it's it.

But in other articles I read that it's just enough to install desktop common packages and it's not necessary to install all the GUI related stuff. So I'm really confused. I also see there are several methods like VNC, "plain" X11 forwarding, xRDP. They can be combined. I read different resources and as I realized the most preferable way to do this is to use xRDP? May be I'm wrong?

This article (one of I've read) http://c-nergy.be/blog/?p=8952 describes the xRDP installation and doesn't consider SSH. Here is the ssh forwarding How to forward X over SSH from Ubuntu machine?

The questions are:

  1. Is the xRDP most preferable way achieve the goal?
  2. What steps should I do to have xRDP provide the remote GUI to me (What packages should I install to server and desktop)? I would like to have mate desktop. Should I install it to workstation or server or both?*
  3. How to enable xRDP over SSH tunnel?*

* – If the xRDP is not an option the last two questions relate to that one (VNC or something else) you suggest, please.

Best Answer

ssh -X

In the server you need an ssh server, for example openssh-server and at least some basic X tools, for example xinit and fluxbox (and the programs and libraries that they need). You must also install the application programs that you want to run, I suggest xterm and the graphical application programs that you want to run.

In the client computer you need ssh to log in and sftp to transfer files or some other tool, that can perform the same tasks, for example filezilla.

Then you can log in remotely with graphics,

ssh -X user@ip-address
# for example
ssh -X sudodus@192.168.0.2

and then you can start graphical application programs, for example

xterm
libreoffice file.odt
evince file.pdf
eog file.png
virtualbox

See this link: Service - OpenSSH | Server documentation | Ubuntu

Using ssh directly like this is simple, but maybe not as elegant as RDP or VNC. But you should also consider learning the necessary command line tools, and manage your server that way or via a web interface.

Related Question