Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save achintya-kumar/412fa4b0ed2877df7cbc8d02ce888200 to your computer and use it in GitHub Desktop.
Save achintya-kumar/412fa4b0ed2877df7cbc8d02ce888200 to your computer and use it in GitHub Desktop.
Install XFCE GUI and RDP on CentOS 7 #GUI #RDP #CentOS7

Update the system

yum -y install epel-release
yum -y update
yum clean all

Install minimal X Windows system and XFCE Desktop

yum -y groupinstall 'X Window System'
yum -y groupinstall xfce

Run the following to start XFCE GUI at boot-time

systemctl set-default graphical.target

Update the system and clean the cache

yum -y install epel-release
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.

If XRDP session immediately closes after loggin in:

echo xfce4-session > $HOME/.xsession
chmod +x .xsession
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment