Solved Fedora VNC blank screen issue
-
Hi,
I am trying to setup VNC using the below steps on Fedora 26, and I can connect to the machine but seeing a blank screen:
nano /etc/selinux/config = disabled
dnf -y install tigervnc-server
firewall-cmd --add-service=vnc-server --permanent
firewall-cmd --reload
su - medo
vncpasswdcp /lib/systemd/system/[email protected] /etc/systemd/system/[email protected]
or
nano /etc/systemd/system/[email protected]
replace User=<USER> with User=medo twiceAnyone have an heads up ?
-
Solved, depending on your Desktop Environment you need to adjust this file:
~/.vnc/xstartup
#!/bin/sh
exec startlxqtthe above is for Fedora LXQT 26 edition.
Solution found here:
https://wiki.archlinux.org/index.php/TigerVNCMy file is contains:
#!/bin/sh unset SESSION_MANAGER unset DBUS_SESSION_BUS_ADDRESS exec startlxqt
Previously it was:
#!/bin/sh unset SESSION_MANAGER unset DBUS_SESSION_BUS_ADDRESS exec /etc/X11/xinit/xinitrc
otherwise you will get gray screen.
-
Have you seen this - https://www.server-world.info/en/note?os=Fedora_25&p=desktop&f=6 guide by any chance? Looks liek they managed to get it working.
-
Solved, depending on your Desktop Environment you need to adjust this file:
~/.vnc/xstartup
#!/bin/sh
exec startlxqtthe above is for Fedora LXQT 26 edition.
Solution found here:
https://wiki.archlinux.org/index.php/TigerVNCMy file is contains:
#!/bin/sh unset SESSION_MANAGER unset DBUS_SESSION_BUS_ADDRESS exec startlxqt
Previously it was:
#!/bin/sh unset SESSION_MANAGER unset DBUS_SESSION_BUS_ADDRESS exec /etc/X11/xinit/xinitrc
otherwise you will get gray screen.
-
With a fresh installation of F26 worktation with lxqt, I found two issues:
1 - SELinux prevents the vncserver daemon to run. This is bug (on buzilla) #1412468. The solution is to run as root:
ausearch -c 'systemd' --raw | audit2allow -M my-systemd
semodule -i my-systemd.pp
After rebooting, you can run: (as user, for display #3 with SELinux enforcing)
sudo systemctl start vncserver@:3.service
2 - After fixing SELinux, you can connect with vncviewer but the screen is dark blue. I tested it on the same computer running vncserver with:
vncviewer :3 (easier to debug)
It executes ~/.vnc/xstartup, which executes /etc/X11/xinit/xinitrc
xinitrc executes /etc/X11/xinit/Xclients which, in the fresh installation, does not support lxqt. The solution appears to be to add lxqt support in that file. It requires two things:
a) create /etc/sysconfig/desktop as root. the file content is:
DESKTOP="LXQT"
set the permissions , as root: chmod 644 /etc/sysconfig/desktop
b) modify /etc/X11/xinit/Xclients to add lxqt. Here is the content of the modified file:
#!/bin/bashCopyright (C) 1999 - 2004 Red Hat, Inc. All rights reserved. This
copyrighted material is made available to anyone wishing to use, modify,
copy, or redistribute it subject to the terms and conditions of the
GNU General Public License version 2.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
GSESSION="$(type -p gnome-session)"
MSESSION="$(type -p mate-session)"
STARTKDE="$(type -p startkde)"
STARTLXDE="$(type -p startlxde)"
STARTLXQT="$(type -p startlxqt)" # Added for LXQTcheck to see if the user has a preferred desktop
PREFERRED=
if [ -f /etc/sysconfig/desktop ]; then
. /etc/sysconfig/desktop
if [ "$DESKTOP" = "GNOME" ]; then
PREFERRED="$GSESSION"
elif [ "$DESKTOP" = "MATE" ]; then
PREFERRED="$MSESSION"
elif [ "$DESKTOP" = "KDE" ]; then
PREFERRED="$STARTKDE"
elif [ "$DESKTOP" = "LXDE" ]; then
PREFERRED="$STARTLXDE"
elif [ "$DESKTOP" = "LXQT" ]; then # Added for LXQT
PREFERRED="$STARTLXQT" # Added for LXQT
fi
fiif [ -n "$PREFERRED" ]; then
exec "$PREFERRED"
finow if we can reach here, either no desktop file was present,
or the desktop requested is not installed.
if [ -n "$GSESSION" ]; then
# by default, we run GNOME.
exec "$GSESSION"
elif [ -n "$STARTKDE" ]; then
# if GNOME isn't installed, try KDE.
exec "$STARTKDE"
elif [ -n "$STARTLXDE" ]; then
# if neither GNOME nor KDE then LXDE
exec "$STARTLXDE"
elif [ -n "$STARTLXQT" ]; then # Added for LXQT
# if neither GNOME nor KDE nor LXDE then LXQT # Added for LXQT
exec "$STARTLXQT" # Added for LXQT
fiWe should also support /etc/X11/xinit/Xclients.d scripts
XCLIENTS_D=/etc/X11/xinit/Xclients.d
if [ "$#" -eq 1 ] && [ -x "$XCLIENTS_D/Xclients.$1.sh" ]; then
exec -l $SHELL -c "$SSH_AGENT $XCLIENTS_D/Xclients.$1.sh"
fiFailsafe.
these files are left sitting around by TheNextLevel.
rm -f $HOME/Xrootenv.0
Argh! Nothing good is installed. Fall back to twm
{
# gosh, neither fvwm95 nor fvwm2 is available;
# fall back to failsafe settings
[ -x /usr/bin/xsetroot ] && /usr/bin/xsetroot -solid '#222E45'if [ -x /usr/bin/xclock ] ; then /usr/bin/xclock -geometry 100x100-5+5 & fi if [ -x /usr/bin/xterm ] ; then /usr/bin/xterm -geometry 80x50-50+150 & fi if [ -x /usr/bin/firefox -a -f /usr/share/doc/HTML/index.html ]; then /usr/bin/firefox /usr/share/doc/HTML/index.html & fi if [ -x /usr/bin/twm ] ; then exec /usr/bin/twm fi
}
After these changes, I rebooted the system and vncviewer worked fine.