https://unix.stackexchange.com/question ... er-log-out
that restarts the server one minute after it's been killed. Since the guides on the Internet provide systemd code to start the server during reboot there doesn't seem to be any reason not to have it running on "stand by", so to speak. Or is that a bad idea, altogether?
My desktop of choice is, however, Mate and it took some trial and error with the xstartup file to make it work. This is what I have:
Code: Select all
#!/bin/sh
# unset SESSION_MANAGER #tweak
unset DBUS_SESSION_BUS_ADDRESS
# /etc/X11/xinit/xinitrc #tweak
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
vncconfig -iconic &
#dbus-launch --exit-with-session gnome-session & #tweak
mate-session & #tweak
# Assume either Gnome or KDE will be started by default when installed
# We want to kill the session automatically in this case when user logs out. In case you modify
# /etc/X11/xinit/Xclients or ~/.Xclients yourself to achieve a different result, then you should
# be responsible to modify below code to avoid that your session will be automatically killed
#if [ -e /usr/bin/gnome-session -o -e /usr/bin/startkde ]; then #tweak
# vncserver -kill $DISPLAY #tweak
#fi #tweak
where changes from the default are marked with #tweak at the end of the line.
This gives me a Mate desktop on the viewer but in order to make it work I had to comment out the killing lines at the end. Note that these lines serve to kill the instance of Xvnc that the server fires up but they don't kill the server. That's taken care of by the systemd script. So logging out in the viewer leaves a stale window which has to be manually removed by:
Code: Select all
vncserver kill :displaynumber
One thing is annoying and that is that I have Xpad in the Mate panel and apparently vnc creates a new empty note window every time it is started. These don't appear in the viewer but on the ordinary desktop. Is there any way to get rid of that except uninstalling Xpad?
BTW it's frequently mentioned that Selinux gets in the way and the advice is to issue setenforce=0 to run it in permissive mode but that doesn't stop it from giving me alerts. The troubleshooting doesn't help so for now I have setenforce=1 and just delete the alerts when they show up.
Cheers,
gostal