xrdp for CentOS 7

Gnome for CentOS 7 require direct access to Graphics Hardware, and that makes remote access protocol like xdmcp or remote desktop fails. However, changing the default Gnome Desktop to KDE Desktop will fix the problem.

Create /etc/yum.repos.d/xrdp.repo:

[xrdp]
name=xrdp
baseurl=http://li.nux.ro/download/nux/dextop/el7/x86_64/
enabled=1
gpgcheck=0

Installation of xrdp and tigervnc-server

# yum -y install xrdp tigervnc-server xorg-x11-fonts-Type1 xinetd

Create /etc/xinetd.d/vncserver:

service vncserver
{
disable = no
socket_type = stream
protocol = tcp
group = tty
wait = no
user = nobody
server = /usr/bin/Xvnc
server_args = -inetd -query localhost -geometry 1024*768 -depth 16 -once -fp /usr/share/X11/fonts/misc -securitytypes=none
}

Edit /etc/services as follows

...
vncserver       6911/tcp                # VNC and GDM

If SELinux is enabled, corresponding SELinux attribute needed to be updated:

# chcon -t bin_t /usr/sbin/xrdp
# chcon -t bin_t /usr/sbin/xrdp-sesman
# semanage fcontext -a -t bin_t  /usr/sbin/xrdp
# semanage fcontext -a -t bin_t  /usr/sbin/xrdp-sesman
# restorecon  -Rv  /usr/sbin/xrdp-sesman
# restorecon  -Rv  /usr/sbin/xrdp

Restart xinetd.service and xrdp.service

# systemctl restart xinetd.service
# systemctl start xrdp.service

Verify xrdp.service is running :

# netstat -antup | grep xrdp

Enable xrdp.service:

# systemctl enable xrdp.service

Disable Gnome Desktop rather than uninstalling it as it is required by lots of other utilities:

# cd /usr/share/xsessions
# mv gnome-classic.desktop gnome-classic.desktop.backup
# mv gnome.desktop gnome.desktop.backup
# mv gnome-custom-session.desktop gnome-custom-session.desktop.backup

Edit /etc/xrdp/xrdp.ini and let vnc handle authentication:

.....
[xrdp1]
name=sesman-Xvnc
lib=libvnc.so
username=ask
password=ask
ip=127.0.0.1
port=-1

Restart xrdp.service

# systemctl restart xrdp.service
# systemctl status xrdp.service

Start remote desktop (mstsc.exe) in Windows 7 client for connecting to linux host

xrdp1

xrdp2

xrdp3

You may also like...