Installing / Removing GUI on Centos 7, RedHat 7 (RHEL) Minimal Install and Enable Remote Desktop

Typically I perform minimal installations when I install any distro of Linux.  Occasionally, albeit very rarely – it can be useful to have access to the X-Windows / Gnome desktop GUI.  From a bare metal install, the following will add a GUI to your server (or desktop!).  This will also install XRDP which emulates windows terminal services and will make your desktop available via an msrdp client on any windows machine. Assuming root access otherwise, precede each command with sudo.

1
2
3
4
5
6
7
8
9
yum install -y epel-release
yum groupinstall -y "X Window System"
yum install -y xrdp
yum install -y gnome-classic-session gnome-terminal nautilus-open-terminal control-center liberation-mono-fonts
systemctl enable xrdp
systemctl start xrdp
unlink /etc/systemd/system/default.target
ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target
reboot

After rebooting, you should be greeted with a GUI login screen.  The link commands update your startup parameters to enable this.

Should you decide you want to remove the GUI:

1
2
3
4
5
6
7
sudo yum groupremove 'X Window System' 'GNOME' 'gnome-classic-session' 'gnome-terminal' 'nautilus-open-terminal' 'control-center liberation-mono-fonts'
sudo yum groupremove "GNOME Desktop"
sudo yum groupremove -y "MATE Desktop"
#few additional commands for lingering components:
sudo yum remove xorg* -y
sudo yum remove gnome* -y
sudo yum autoremove -y
Lima

About the author

Lima is the visual nautical indicator for "stop instantly."

Comments

  1. Ah, the familiar linux-bleeding edge-tech: commandline… Abandoned by everybody else in 1990. Still indispensible for this sorry excuse for an operating system.

    So you copied everything required to an HTML document.
    Why?
    So that crappy backward OS can use ME as a script interpreter?
    Copy this to a shellscript. Call it an isntaller. Make that jump to the twenty-first century.

    Humans are not preprocessors for backward incomplete operating systems.
    Computers were created to do dumb repetitive tasks.

Leave a Reply

%d bloggers like this: