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

Last Updated on

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

Leave a Reply