Skip to content

Instantly share code, notes, and snippets.

@kumar-de
Last active June 19, 2022 00:44
Show Gist options
  • Save kumar-de/ad804d25402cb9544c58ccfcd6cec89e to your computer and use it in GitHub Desktop.
Save kumar-de/ad804d25402cb9544c58ccfcd6cec89e to your computer and use it in GitHub Desktop.
Install GNOME GUI and RDP on CentOS 7 #GUI #RDP #CentOS7

Update the system

sudo yum -y update

Install GUI (GNOME Desktop)

sudo yum -y groupinstall "GNOME Desktop" "Administration Tools"

Run the following to start GNOME at boot-time

sudo ln -sf /lib/systemd/system/runlevel5.target /etc/systemd/system/default.target

Install EPEL repository

sudo yum -y install epel-release

Update the system and clean the cache

sudo yum -y update && sudo yum clean all

Install XRDP

sudo yum -y install xrdp tigervnc-server

Make necessary changes to SELinux (requires more understanding)

sudo chcon -h system_u:object_r:bin_t:s0 /usr/sbin/xrdp
sudo chcon -h system_u:object_r:bin_t:s0 /usr/sbin/xrdp-sesman

If necessary - adjust firewall rules to allow port 3389 (RDP server runs on this port)

sudo systemctl enable firewalld
sudo systemctl start firewalld
sudo firewall-cmd --permanent --zone=public --add-port=3389/tcp
sudo firewall-cmd --reload

Enable XRDP

sudo systemctl enable xrdp

Set password for your default user on the machine

passwd

Create a new user

sudo adduser rdp-user
passwd rdp-user

If necessary - add new user to the sudoers list

sudo usermod -aG wheel username

By default, on CentOS, members of the wheel group have sudo privileges.

Start your favorite RDP client and use the VM's public address to connect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment