repair vm
Azure Linux – troubleshooting the “no boot/no ssh” scenario
January 22, 2020
Show all

How to add a GUI on CentOS 7 and connect to it via xRDP – step by step instructions

Mate desktop

Mate desktop

How to add a GUI on CentOS 7 and connect to it via xRDP – step by step instructions

 

In this tutorial we’ll cover the steps to install different Desktop Environments on your remote CentOS 7 machine and the steps to install xRDP on your remote CentOS 7 machine. We’ll also show you how to connect to your Centos 7 machine via Remote Desktop Connection.

xRDP is a a free and open source Remote Desktop Protocol Server that allows other operating systems, other than Windows, to provide a fully functional remote desktop experience. xRDP is fully compatible with rdesktop, FreeRDP and even Microsoft’s Remote Desktop Client.

Prerequisites

  • Recommended (but not required): a sudo user when proceeding to make any major changes to your system.
  • A machine running CentOS 7 with recommended (not mandatory) 2GB of RAM.

1. Install the GUI of your choice

1.1. XFCE Desktop

$ sudo yum install -y epel-release
$ sudo yum groupinstall -y "Xfce"
$ sudo ln -sf /lib/systemd/system/runlevel5.target /etc/systemd/system/default.target
$ sudo reboot

Create ~/.Xclients

$ echo "xfce4-session" > ~/.Xclients
$ chmod a+x ~/.Xclients

1.2. MATE Desktop

$ sudo yum install -y epel-release
$ sudo yum groupinstall -y "MATE Desktop"
$ sudo ln -sf /lib/systemd/system/runlevel5.target /etc/systemd/system/default.target
$ sudo reboot

Create ~/.Xclients

$ echo "mate-session" > ~/.Xclients
$ chmod a+x ~/.Xclients

1.3 GNOME 3 Desktop

$ sudo yum groupinstall "GNOME Desktop" "Graphical Administration Tools"
$ sudo ln -sf /lib/systemd/system/runlevel5.target /etc/systemd/system/default.target
$ sudo reboot

1.4. KDE Desktop

$ sudo yum groupinstall -y "KDE Plasma Workspaces"
$ sudo ln -sf /lib/systemd/system/runlevel5.target /etc/systemd/system/default.target
$ sudo reboot

Create ~/.Xclients

$ echo "startkde" > ~/.Xclients
$ chmod a+x ~/.Xclients

2. Install xRDP server on your CentOS 7 box

$ sudo yum install -y epel-release
$ sudo yum install -y xrdp
$ sudo systemctl enable xrdp
$ sudo systemctl start xrdp

3. Open xRDP port in firewall

$ sudo firewall-cmd --add-port=3389/tcp --permanent
$ sudo firewall-cmd --reload

Finaly, now you can connect to your Linux desktop environment via xRDP.

Marin Nedea
Marin Nedea
I'm passionate about open source software and technologies. In my spare time I build simple and functional websites from scratch, using PHP+HTML5+CSS3+MySQL and when I'm bored, I write simple PHP_CLI or bash scripts to play around on my Linux machine.

Comments are closed.

Hire us!