How to configure Gnome to allow remote access using an SSH/X11 connection using Xephyr?

gnome linux
  • AlmaLinux 8, Rocky Linux 8, CentOS 8.
  • GDM
  • Xephyr

You can connect to a Linux Gnome desktop from your local PC without a VNC by implementing the following steps. If GUI (GDM or Gnome desktop manager) is already installed on the server than skip step 1 and follow step 2.

GDM GUI Installation

AlmaLinu 8, 9

If your server has AlmaLinux 8 or 9 than execute these commands on the shell as root.

# yum group install GNOME base-x Fonts
or 
# yum groupinstall "Server with GUI

CentOS 7

# yum groupinstall gnome-desktop x11 fonts
or
# yum groupinstall "Server with GUI"

CentOS 6

# yum groupinstall Desktop "General Purpose Desktop" "Desktop Platform" "X Window System"  "Internet Browser" "Graphical Administration Tools" Fonts

After completing the above steps, change the default systemd boot target to graphical.target. In case of error, try updating the server OS first with ‘yum update’.

# systemctl set-default graphical.target
and
# systemctl isolate graphical.target

Install Xephyr Package and enable XDMCP

Install the xorg-x11-server-Xephyr package.

Configure GDM to enable XDMCP by adding the following lines to /etc/gdm/custom.conf as follows.

  • In the [security] section, add the line DisallowTCP=false.
  • In the [xdmcp] section, add the line Enable=true.
  • AlmaLinux 8 and 9 only: Uncomment the line WaylandEnable=false in the [daemon] section, or add it if the line is missing.

Restart GDM

To apply changes.

# systemctl restart gdm.service

Connect with Xephyr

Run the following command while connected to the server using a client that uses SSH with X11 forwarding.

$ Xephyr :99 -query localhost

Notes

  • Test the SSH X11 connection using an X11 application xclock.
  • Use the command man Xephyr for more information.