XFCE is a lightweight, responsive desktop environment ideal for remote graphical management on headless CentOS 7 servers without consuming excessive RAM. However, launching an XFCE session inside RealVNC Server (vncserver-virtual) on CentOS 7 often fails or displays a blank screen because default Xsession startup scripts target GNOME.
Environment: CentOS 7 • XFCE Desktop • RealVNC Server
1. Installing XFCE and RealVNC
yum groupinstall "Xfce" -y
yum install tigervnc-server -y # Or install RealVNC Server RPM
2. Configuring the VNC Virtual Session (/etc/vnc/xstartup.custom)
To ensure RealVNC launches the XFCE desktop environment properly, create or edit /etc/vnc/xstartup.custom:
#!/bin/sh
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
startxfce4 &
Make the script executable and launch the VNC virtual display:
chmod +x /etc/vnc/xstartup.custom
vncserver-virtual :1