I am using Ubuntu Server 14.04 LTS. How can I tell whether it has a graphical user interface installed?


Look at /usr/share/xsessions/ directory to see if there are any X sessions available on your Ubuntu:

$ ls /usr/share/xsessions/

which says I've got "openbox" on my machine, it can be "Unity", "Gnome" or anything else for you. If you get nothing, so nothing has been installed.

Extra step:

You can run something like this on that file to see if its binary really exist on your machine and it's not a leftover file:

file $(grep -Po "(?<=^Exec=).*" /usr/share/xsessions/openbox.desktop)
  • grep -Po "(?<=^Exec=).* returns something similar to: /usr/bin/openbox
  • file will check if that really exist.
| improve this answer | |
  • I got ubuntu.desktop. – GoingMyWay May 23 '17 at 12:20
  • cat it's content it will tell you which DE it is, I guess it's unity ;) – Ravexina May 23 '17 at 12:23
  • Yes, Unity, [Desktop Entry] Name=Ubuntu Comment=This session logs you into Ubuntu Exec=gnome-session --session=ubuntu TryExec=unity Icon= Type=Application X-LightDM-DesktopName=Unity X-Ubuntu-Gettext-Domain=gnome-session-3.0 – GoingMyWay May 23 '17 at 12:26
  • Yeah, it's unity. – Ravexina May 23 '17 at 12:26

you can also use the package manager to search for installed packages. Try looking for the main window managers, or the actual X server package

To see if any KDE packages are installed (kde-baseapps is the meta packages for the absolute minimum for a KDE install, I have kde-full which is a meta to install everything interesting, if kde-baseapps-bin isn't installed, then you don't have KDE at any level), use dpkg -l kde*

apt-cache search unity shows unity8 is the main shell there, it doesnt show up when I run dpkg -l unity* as I don't have it installed.

apt-cache search gnome shows gnome is the main shell there. dpkg -l gnome* shows I don't have that either.

For a more basic setup, you might want to try looking for the package that provides the X server directly: dpkg -l xorg or dpkg -l xserver-xorg or dpkg -l xserver* generally (I have xorg installed).

If /usr/bin/X exists, then you have an X server available, and can run gui apps, locally. There are some very small windows managers (twm, tinywm and others) which don't do much, but are handy if you occasionally need gui facilities (If you don't have a window manager then you cannot resize/maximise or minimise and apps running on X and the window will always sit aligned to the top left most corner of the screen).

Mostly you start a gui (if it's not setup as a daemon) on linux, with the startx or xstartup commands. There are variants kdeinit was the one I remember for kde, you could search for those (probably in /usr/bin or /usr/sbin or use whereis).

However remember you don't need to run X applications locally, you can run X applications over the network, from a remote X terminal (I use cygwin's x-server on Windows for this). For example, I had thunderbird installed on my server farm hosted linux server, without X, simply so I could have it run remotely, to move huge amounts of emails between folders, and only the traffic needed to update the X screen needed leave the server. I've since discovered mutt, but it can be done.


I would add that whilst most packages containing an X based application will require packages which amount to expecting you to have X and a windows manager installed with it, they're not essential. For example, I support a number of Linux Servers, without any gui, on which I have qgit installed. It's a graphical tool for reviewing git heirarchy. I can forward my X session to the servers, and run the app on the servers, and it'll display on my desktop. However as discussed you'll not find any of the above stuff installed on the servers (no X, no windows managers). So bear in mind just because you don't have an X server setup on a host, doesn't mean it can't run a gui (it'd just have to be remote).

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.