What is the simplest way to have remote GUI access to Ubuntu 16.04 “server” from Ubuntu 16.04 “desktop”?

259,789

Solution 1

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 [email protected]

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.

Solution 2

I installed xrdp

sudo apt-get install xrdp

If you are connecting from Ubuntu then ssh -X username@server

If you are connecting from windows, then you can use Remote desktop connection

enter image description here

enter image description here

Solution 3

1.

It depends, but I would say yes. I myself, have come across this same problem and arrived at xrdp. I too have a ubuntu server that has xrdp installed on it and I'd say it works very well.

2.

While I was looking for a solution myself, I came across this article here, which I found very helpful. Also, as @mikewhatever has also pointed out, you don't need the same desktop environment on the connecting computer. The only reason why you need a different desktop environment in the server is because XRDP doesn't support the default environment.

3.

It's automatic*, you just need to enable the ssh tunnel option in your remote desktop client.

*I didn't need to do anything fancy, I just followed the steps in the linked article.

Hope this helps you!

Solution 4

I know its been some time since this question was active however I'd recommend x2go. This is client and server software so x2go server needs to be installed on the server and x2go client needs to be installed on the client side. It seems to work fairly well.

I've unfortunately not had the best of luck with tunneling an X server. Yes I can get various X windows on the client to open, but as far as tunneling a desktop, that seems to be a little bit more buggy.

Share:
259,789

Related videos on Youtube

4xy
Author by

4xy

Updated on September 18, 2022

Comments

  • 4xy
    4xy almost 2 years

    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.

    • user68186
      user68186 over 7 years
    • mikewhatever
      mikewhatever over 7 years
      It doesn't make very much sense to run GUI on a server, just to login remotely from a desktop. Desktop have GUIs, what's wrong with that? But, since you want Mate, then you have to install Mate on the server, it doesn't matter what GUI is on the desktop.
    • 4xy
      4xy over 7 years
      I have ssh access to the server and this is quite enough. But I need to render web page on the local machine from the local service I wouldn't like and seems can't share on the Internet.
    • pzkpfw
      pzkpfw over 7 years
      @4xy you might want to look into ssh tunnels. You can forward the "server port 80" to localhost on your client machine.
    • 4xy
      4xy over 7 years
      @pzkpfw I realize that there is ssh tunneling. What can I do with it? I can forward RDP via ssh. Could you please share more details on this? I have http & https services run on the server located in private network scope. I can access them via 192.168.1.10:5555 or 192.168.1.10 from within same network. It's possible to make ssh tunnel to those as I guess... But I don't realize how exactly to do this and how to use it on client side? Thanx.
  • 4xy
    4xy over 7 years
    It's really cool, it seems it will resolve my issue. Just simple and works!
  • sudodus
    sudodus over 7 years
    I think it will work well for you. Good luck :-)
  • 4xy
    4xy over 7 years
    xRDP works like a charm too!
  • Homero Esmeraldo
    Homero Esmeraldo over 4 years
    Works like a charm. Thanks. Simple test with libreoffice: $ libreoffice --writer opens a Writer, you can save the new document and afterwards you will be able to see it in the directory.
  • GENIVI-LEARNER
    GENIVI-LEARNER over 3 years
    i have installed xterm but when i do ssh -X i dont get the GUI (only commandline access). Should virtualbox command be issued after i login?
  • sudodus
    sudodus over 3 years
    @GENIVI-LEARNER, I think your case can be different from what is described here (because VirtualBox is involved). So I suggest that you create an own question, where you describe your case with as many details as possible. That way you have a much better chance to get help (and not only from me). If you wish you can post a link to that question in a new comment here.
  • GENIVI-LEARNER
    GENIVI-LEARNER over 3 years
    @sudodus i figured out that I was perhaps doing it wrong! I followed you answer again and got the GUI up and running! +1
  • Homayoon Ahmadi
    Homayoon Ahmadi almost 3 years
    Make sure you have installed a Desktop like KDE or GNOME before