1. intro

we will use VNC and OpenBox as the window manager.

2. installation

yum -y install tigervnc-server openbox liberation-mono-fonts xterm # tint2
curl -s http://d01cid.ddns.net/sharel/pic/xbm.tgz | tar xz -C /usr/share/backgrounds/

3. configuration

 echo "#" > /etc/X11/xinit/xinitrc
 echo "exec openbox-session" >> /etc/X11/xinit/xinitrc
 echo "xsetroot -bitmap /usr/share/backgrounds/xbm/Brick.xbm &" >> /etc/xdg/openbox/autostart
// echo "tint2 &" >> /etc/xdg/openbox/autostart

3.1. logon via VNC

vi /lib/systemd/system/vncserver-ronny.service
#
[Unit]
Description=Remote Desktop for user ronny
After=syslog.target network.target

[Service]
Type=forking
User=ronny

ExecStartPre=-/usr/bin/vncserver -kill :9
ExecStart=/usr/bin/vncserver :9
PIDFile=/home/ronny/.vnc/%H:9.pid
ExecStop=-/usr/bin/vncserver -kill :9

[Install]
WantedBy=multi-user.target
getent passwd ronny || adduser ronny
su - ronny -c "id"
runuser -l ronny -c "mkdir .vnc"
runuser -l ronny -c "echo Passw0rd | vncpasswd -f > .vnc/passwd"
runuser -l ronny -c "chmod 600 .vnc/passwd"
runuser -l ronny -c "vncserver :9"
systemctl daemon-reload
systemctl enable vncserver-ronny.service
systemctl start vncserver-ronny.service

3.2. logon via DM

cube /etc/default/grub vga=771 with vga=791
grub2-mkconfig -o /boot/grub2/grub.cfg
yum -y install lightdm
systemctl set-default graphical.target
echo "#" > /etc/lightdm/lightdm.conf.d/cid.conf
echo "[XDMCPServer]" >> /etc/lightdm/lightdm.conf.d/cid.conf
echo "enabled=true"  >> /etc/lightdm/lightdm.conf.d/cid.conf
vi /etc/xinetd.d/vncserver
#
service vnc
 {
  type = unlisted
  disable = no
  flags = REUSE
  socket_type = stream
  port = 5900
  wait = no
  user = nobody
  protocol = tcp
  server = /usr/bin/Xvnc
  server_args = -desktop VNC-Remote-Access -inetd -query localhost -once -depth 16 -geometry 800x600 -securitytypes none
  log_on_failure += USERID
 }
systemctl daemon-reload
systemctl restart xinetd.service
systemctl enable lightdm.service

4. debugging

rm -fr /tmp/.X11-unix/*

5. references