How to install Ubuntu with GUI

October 12, 2016 111 views
Linux Basics Ubuntu 16.04

Hi - Can someone help me setup a GUI on a fresh Ubuntu 16.04 server? I've taken the following steps:

1) Setup droplet
2) sudo apt-get update
3) sudo apt-get install ubuntu-desktop
4) sudo apt-get install ubuntu-gnome-desktop
5) sudo apt-get install gnome-core
6) reboot

I re-ssh into the server but the GUI does not appear. So I run 'startx' and I get the following message:

X.Org X Server 1.18.4
Release Date: 2016-07-19
X Protocol Version 11, Revision 0
Build Operating System: Linux 3.13.0-95-generic x8664 Ubuntu
Current Operating System: Linux tinzors 4.4.0-38-generic #57-Ubuntu SMP Tue Sep 6 15:42:33 UTC 2016 x86
Kernel command line: BOOT_IMAGE=/boot/vmlinuz-4.4.0-38-generic root=UUID=d39864c2-d249-4a0c-b885-5c72ef360b3f ro console=tty1 root=LABEL=DOROOT notsc clocksource=kvm-clock net.ifnames=0
Build Date: 14 September 2016 03:33:24PM
xorg-server 2:1.18.4-0ubuntu0.1 (For technical support please see http://www.ubuntu.com/support)
Current version of pixman: 0.33.6
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.1.log", Time: Wed Oct 12 18:15:28 2016
(==) Using system config directory "/usr/share/X11/xorg.conf.d"

Can someone help?

Thanks in advance!

2 Answers
xMudrii October 12, 2016
Accepted Answer

Hi @jtn1490 ,
You can't just SSH into server and type startx to get Ubuntu with GUI.
You should use X11 Forwarding or VNC to get what you want.

First solution will not get you a full GUI, but you when you launch any GUI app, it will forward it to you.
Second solution will get you full GUI, so you can go with it.

How to enable X11 Forwarding
To use it, it needs to be enabled on server-side. Open SSH config,

  • sudo nano /etc/ssh/sshd_config

and try to locate X11Forwarding line.
You need to make sure it is not commented (there is no # on beginning of line), and it is set to yes.
Basicly, it should look like

X11Forwarding yes

Now you can try to SSH with following command:

  • ssh -X your-user@droplet_IP

It will show you normal prompt, but if you try to run any GUI app (e.g. libreoffice).
You will see apps GUI just like when you run on your local machine.

Problems troubleshooting:
If you get into any problem while SSH-ing, make sure you have installed xauth on your local machine!

How to install and configure VNC
How to Install and Configure VNC on Ubuntu 16.04 should help you learn more about it and how to install. With this solution, you are getting full GUI, just like on normal machine.

If you get into any problem, feel free to ask :)

In this guide, we will be setting up VNC on a Ubuntu 16.04 server and connecting to it securely through an SSH tunnel. The VNC server we will be using is TightVNC, a fast and lightweight remote control package. This choice will ensure that our VNC connection will be smooth and stable even on slower internet connections.

Hi - I followed the 'How to install and configure VNC' guide verbatim. However, in Step3 - Testing the VNC Desktop, I keep getting the error "The connection was refused by the host computer". I am using VNC Viewer. I typed in the same IP address that I SSH into (which works).. Do you know what might be going on?


Have another answer? Share your knowledge.