Install Xnest CentOS 6

Install Xnest CentOS 6

Usually if you are installing Xnest, it’s because you want to view a remote Linux Terminal locally on a Linux Desktop, or other workstation. This blog assumes you used the below, or similar configuration to setup an X terminal server.

http://blog.zwiegnet.com/linux-server/configure-centos-xdmcp-logins/

Xnest is an X server that runs inside a window on your existing desktop. Pointed at a remote machine with -query, it asks that machine’s display manager (GDM on CentOS 6) for a login screen over XDMCP, so you get a complete remote desktop session in a window without logging out of your own.

Prerequisites

  • A CentOS 6 workstation with a graphical desktop running (Xnest needs an X display to draw its window on).
  • A terminal server with XDMCP enabled in its display manager, as in the guide linked above. On GDM that is Enable=true under [xdmcp] in /etc/gdm/custom.conf.
  • UDP port 177 (XDMCP) reachable on the terminal server, and the server able to open X connections back to your workstation.
  • Root access on the workstation to install the package.

Here’s the basic process:

Step 1: become root

login, and su to root

yum search xnest typed at the root bash-4.1 prompt

Step 2: find the package

now do a yum search for “xnest”

yum search xnest
Root prompt running yum search xnest to find the Xnest package

from here you should see the following:

yum search result: xorg-x11-server-Xnest.x86_64, A nested server

The package is called xorg-x11-server-Xnest; the search matches it because the name contains Xnest.

Step 3: install it

install via yum

yum -y install xorg-x11-server-Xnest.x86_64
yum -y install xorg-x11-server-Xnest.x86_64

Step 4: open a remote session

from here we can test an X Session

Xnest :1 -query terminalservername
Xnest :1 -query terminalservername to open an XDMCP session

this is the basic syntax for an X Session

Xnest window showing the CentOS 6.5 graphical login screen from the remote terminal server

That’s it, you have connected to a Linux Terminal Server from Xnest!

What the parts mean:

  • :1 is the display number for the new nested X server. Your own desktop is normally :0, so pick an unused number; use :2, :3 and so on for more sessions.
  • -query terminalservername sends an XDMCP request to that host, which answers with its login screen. -broadcast takes the first XDMCP server that answers on the local network instead.
  • -geometry 1280x800 sets the window size if the default is too small.

Run it as your normal user, not root; only the install needs root.

Troubleshooting

  • Server is already active for display 1: that display number is in use. Try :2.
  • Black or grey window, no login screen: XDMCP is not enabled on the server, GDM was not restarted after enabling it, or UDP 177 is blocked by iptables on the server. Check the server’s /etc/gdm/custom.conf and firewall.
  • Login screen appears and then the session drops: the server cannot open X connections back to your workstation (TCP 6000 plus the display number). Allow it on the workstation’s firewall for the server’s address only.
  • Security: XDMCP and X11 traffic, including your password, is not encrypted. Use it only on a trusted LAN.

Modern equivalents

Xnest is old and has limited extension support. Xephyr (package xorg-x11-server-Xephyr) is the better nested X server and takes the same idea: Xephyr :1 -query terminalservername -screen 1280x800. Red Hat deprecated the Xorg server in RHEL 9 and removed it in RHEL 10, which uses Wayland, so on AlmaLinux and Rocky Linux 9 and 10 remote desktops are normally done with VNC (TigerVNC) or with GNOME’s built-in RDP remote login rather than XDMCP.

Hosted Linux Servers at www.zwiegnet.com/go

Related guides: Configure CentOS XDMCP Logins · Configure SSH Tunneling Mode CentOS

1 Comment

Leave a Reply

Your email address will not be published. Required fields are marked *