Question

How to install Ubuntu with GUI

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 x86_64 Ubuntu Current Operating System: Linux tinzors 4.4.0-38-generic #57-Ubuntu SMP Tue Sep 6 15:42:33 UTC 2016 x86_64 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!


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

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,

  1. 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:

  1. 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 :)

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?

Thanks!

alexdo
Site Moderator
Site Moderator badge
October 5, 2022

Hello there,

If you’re getting a blank/grey/black screen you can do this. Add the following snippet to the xstartup which is mentioned in step 1 - /home/sammy/.vnc/xstartup and try again.

https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-vnc-on-ubuntu-18-04

  1. #!/bin/sh
  2. unset SESSION_MANAGER
  3. unset DBUS_SESSION_BUS_ADDRESS
  4. dbus-launch xfce4-session

Hope that this helps!

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel