Skip to content

Instantly share code, notes, and snippets.

@tosin2013
Last active May 15, 2024 15:41
Show Gist options
  • Save tosin2013/b3a10160db2d1ff2a944ab669cffbbd2 to your computer and use it in GitHub Desktop.
Save tosin2013/b3a10160db2d1ff2a944ab669cffbbd2 to your computer and use it in GitHub Desktop.
GNOME GUI and xrdp on RHEL
#!/bin/bash
# Install GNOME GUI
sudo yum groupinstall "Server with GUI"
# Enable EPEL repository
sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm -y
# Install xrdp and dependencies
sudo yum install tigervnc-server xrdp firewalld -y
# Enable and start the xrdp service
sudo systemctl enable xrdp
sudo systemctl start xrdp
# Enable and start the firewalld service
sudo systemctl enable firewalld
sudo systemctl start firewalld
# Open firewall port for xrdp
sudo firewall-cmd --permanent --add-port=3389/tcp
sudo firewall-cmd --reload
echo "GNOME GUI and xrdp have been installed and enabled."
echo "You can now connect to this system using Remote Desktop from another machine."
@tosin2013
Copy link
Author

tosin2013 commented Mar 6, 2024

The key steps are:

  1. Install the GNOME desktop environment using yum groupinstall "Server with GUI"[1]

  2. Enable the EPEL repository which contains the xrdp package[2]

  3. Install xrdp and the tigervnc-server dependency with yum install tigervnc-server xrdp[2][4]

  4. Enable and start the xrdp service using systemctl[2][4]

  5. Open port 3389 in the firewall for Remote Desktop connections[2][4]

After running this script, the RHEL 8 server will have the GNOME GUI installed and will accept Remote Desktop connections on the standard port 3389. You can connect from a Windows machine using the built-in Remote Desktop Connection application.[2][6]

The script automates the manual steps required to set this up on RHEL 8. It provides a quick way to enable remote GUI access to the server.

Links:

[1] https://www.tecmint.com/install-gui-on-rhel-8/
[2] https://www.ucartz.com/clients/knowledgebase/1560/How-To-Install-xrdp-on-Red-Hat-Enterprise-Linux-8.html
[3] https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/using_the_desktop_environment_in_rhel_8/accessing-the-desktop-remotely_using-the-desktop-environment-in-rhel-8
[4] https://docs.e2enetworks.com/guides/centos_xrdp.html

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