Install MATE or XFCE on CentOS 7

Which desktop environment you prefer is very personal. Each of them has its advantages and, unfortunately, also its disadvantages.

Recently, I started to like MATE since it’s lightweight and customizable in a way I personally like. Before, I was a fan of XFCE for similar reasons but somehow I got a little tired and irritated of it’s shortcomings.

With the new release of CentOS 7, it’s interesting to look how to install any of those  on top of a minimal install since this means it can be installed on top of almost every type of installation in regards to package selection and dependencies.

Installation is quite simple since both Desktop environments are available in the EPEL repository. Basically, it comes down to installing the repo, installing the X-window system and then install the desktop environment of your choice. If you want to, you can install multiple environments to decide which one you like less/more.

Installing EPEL and the X window system:

Both XFCE and MATE can be found in the EPEL-repositories. So before we take any action, we need to install the repository.  More information and a recent download-link can be found here: http://fedora.cu.be/epel/7/x86_64/repoview/epel-release.html

To install the repo with the link as it was at the time of writing:

Before we start, we need to install the X-window system. These packages do not require EPEL. Of course it doesn’t bother if it’s already installed.

Now you have a minimally installed X without any desktop environment so let’s change that.

Install MATE

Since we already installed the EPEL-repo, the only thing that’s left to do is a groupinstall for MATE.

To first have a look at what exactly will be installed, we can execute yum with the groupinfo-command:

When you are happy with the result, you can install the group as follows:

Install XFCE

Similar to installing MATE, we can install XFCE:

Starting the graphical environment

After the installation of one or more desktop environments, you need to tell your system to start the graphical components (X window-system and display manager). Since CentOS version 7, this is done by systemd and it’s targets. In the past, this was done by switching runlevels. The target for a graphical system is conveniently called graphical.target and is similar to what runlevel 5 was in the past.

To switch to graphical target, do the following:

This should start all what is needed in order to present you with a GUI on the system. Depending on which display manager was installed (lightdm for MATE and gdm for XFCE), you are presented with one of the following login screens:

GDM: mate_xfce-gdm

LightDM:mate_xfce-lightdm

After login, you should get your familiar desktop and you can start working with the GUI:

MATE:mate_xfce-mate
XFCE:mate_xfce-xfce

Start the GUI on boot

After a reboot, the system will start with it’s default target (multi-user) so in order to make the change permanent and always start your system with a GUI, you can change the default target to the graphical one:

Change the default display manager

When you installed both XFCE and MATE on one system, you can choose which one of them to start for your desktop session on the login screen.

For GDM, this can be done here:

mate_xfce-gdm-session

For LightDM, this can be done here:

mate_xfce-lightdm-session

Depending on which one of them you installed first, your default display manager (lightdm or gdm) is started with the graphical.target. This basically means that you will be presented with a different login screen and some other options.

To see which display manager is started with the grahpical target or the system, do the following:

When lightdm is the default one, you should get something like this:

When gdm is the default one, it should look like this:

To change from one to another, simply disable the current default and enable the one you would like to set as the new default. With systemd, you can do that with the following commands:

To reload the graphical target and activate your changes:

That should be all you need to get going with XFCE or MATE on a fresh CentOS 7 system. As with most of the CEntOS-related stuff, this should work on RHEL 7 as well.

19 thoughts on “Install MATE or XFCE on CentOS 7

  1. Hello, it works fine on a fresh installation of CEntOs 7 with gnome 3

    Bonjour, cela fonctionne parfaitement avec une installation de CEntOs 7 et un environnement graphique Gnome 3.

    Merci, thank’s

  2. Hi
    Thanks for your guide, it works without problem.
    But, can we also install tiger VNC on xfce ?
    I can run it fine on gnome, but witch the same setting on xfce, I cannot log into.. ?
    If you may have tried.. or perhaps it’s another tutorial.
    Thanks

  3. FYI – the epel-release package is in the basic CentOS 7 distribution and can be installed directly. This is not the case for RHEL 7 where you need to use the link you provided.

  4. hi,
    nice article. I’ve just setup centos 7 minimal on my vps. then I tried installing xfce based on your article. I only installed xfce so I skip “MATE desktop”.
    after success installing, I tried to connect via vnc client (tight vnc). the connection is success, but I got error on gdm with error message “Oh no! Something has gone wrong. bla… bla… bla…”.
    any suggestion how to fix it?

    thank you.

    • Hi,

      I assume that you installed a VNC server? TigerVNC or one of it’s alternatives should do.
      Some things you can check:
      – Did you start X before you started the VNC-server or connection?
      – Are the permissions on .Xauthority in your homedir ok?
      – Can you log in with the same userid not over VNC?
      – Check your logfiles and try to disable SELinux for testing.

      If I find some time, I’ll test how to set up VNC on XFCE after following this tutorial.

      • Some things you can check:
        – Did you start X before you started the VNC-server or connection?
        I use tigervnc, in Xorg.0.log I got this message:
        [code]
        sudo tail /var/log/Xorg.0.log
        [ 1.664] (EE)
        [ 1.664] (EE)
        Please consult the The X.Org Foundation support
        at http://wiki.x.org
        for help.
        [ 1.664] (EE) Please also check the log file at “/var/log/Xorg.0.log” for additional information.
        [ 1.664] (EE)
        [ 1.664] (WW) xf86CloseConsole: KDSETMODE failed: Invalid argument
        [ 1.664] (WW) xf86CloseConsole: VT_GETMODE failed: Invalid argument
        [ 1.664] (EE) Server terminated with error (1). Closing log file.
        [/code]
        – Are the permissions on .Xauthority in your homedir ok?
        oke
        – Can you log in with the same userid not over VNC?
        i can
        – Check your logfiles and try to disable SELinux for testing.
        still not sure to do it.

        anyway, is this gdm problem or vncserver problem?
        i’ve also tried installed lightdm, but got the same result.

        thank you.

  5. Pingback: Install the Cinnamon desktop environment on CentOS 7 | Jensd's I/O buffer

  6. Wow …
    Was looking for this solution since eternity.
    Thanks for sharing the article
    It worked like a charm

    Thanks
    -Hemanth

  7. Pingback: CentOS 7 Minimal++ (Virtual) Setup – All the Pages Are My Days

Leave a Reply

Your email address will not be published. Required fields are marked *