I tried VNC Server. It works great. The following is not officially supported, but steps taken to installing VNC Server on Clear Linux.
Download VNC Server (Generic script x64) from https://www.realvnc.com/.
cd ~/Downloads
tar xf VNC-Server-7.0.1-Linux-x64-ANY.tar.gz
cd VNC-Server-7.0.1-Linux-x64
I created a wrapper script named cl_vncinstall.sh
. That modifies vncinstall
and vncinitconfig
for compatibility on Clear Linux. Be sure, you’re in the VNC-Server-7.0.1-Linux-x64 folder. In a nutshell, this sets paths to /usr/local, disables automatic VNC updates (that will not work), removes selinux bits, and replaces xterm with gnome-session.
tee "cl_vncinstall.sh" >/dev/null <<'EOF'
#!/bin/bash
# Make backups.
[[ -f vncinstall.orig ]] || cp -a vncinstall vncinstall.orig
[[ -f vncinitconfig.orig ]] || cp -a vncinitconfig vncinitconfig.orig
# Vncviewer is not included in the VNC Server tar file.
# Disable SELinux installation bits.
# Update paths.
sed -i \
-e 's!vncviewer vncserver-x11!vncserver-x11!' \
-e 's!installSELinux=1!installSELinux=0!' \
-e 's!dst=/usr/bin!dst=/usr/local/bin!' \
-e 's!lib=/usr/lib!lib=/usr/local/lib!' \
-e 's!mandst=/usr/share/man!mandst=/usr/local/share/man!' \
-e 's!cupsdst=/usr/lib/cups!cupsdst=/etc/cups!' \
-e 's!share=/usr/share!share=/usr/local/share!' \
vncinstall
# Update vncinitconfig.
sed -i \
-e 's!cups_backend_dir=/usr/lib/cups/backend!cups_backend_dir=/etc/cups/backend!' \
-e 's!init_updates=1!init_updates=0!' \
-e 's!init_firewalld=1!init_firewalld=0!' \
-e 's!init_seLinux=1!init_seLinux=0!' \
-e 's!libvnc=/usr/lib/vnc!libvnc=/usr/local/lib/vnc!' \
-e 's!libsecurity=.*$!libsecurity=/usr/lib64/security!' \
-e 's!share=/usr/share!share=/usr/local/share!' \
-e 's!/usr/lib/systemd/system!/etc/systemd/system!' \
-e 's!ExecStart=/usr/bin!ExecStart=/usr/local/bin!' \
-e 's!XTERM_COMMAND=.*$!gnome-session!' \
-e '/Notice: the installed init template/d' \
-e '/^$1 is not installed in $bin/d' \
-e '/pam_selinux\.so/d' \
vncinitconfig
# Remove sed backups.
rm -f vncinstalle vncinitconfige
# Make installation paths.
sudo mkdir -p /etc/cups/backend
sudo mkdir -p /etc/pam.d
sudo mkdir -p /etc/systemd/system
sudo mkdir -p /usr/local/bin
sudo mkdir -p /usr/local/lib
sudo mkdir -p /usr/local/share/man/man1
sudo mkdir -p /usr/local/share/vnc
sudo ln -sf /usr/local/share/vnc /usr/share/
# Install x11-server x11-tools bundles if missing.
installed_bundles=$(sudo swupd bundle-list | grep '^ - ' | sed 's/$/ /g')
add_list=""
for bundle_name in x11-server x11-tools; do
if [[ ! ${installed_bundles} == *" ${bundle_name} "* ]]; then
add_list+=" ${bundle_name}"
fi
done
if [[ -n ${add_list} ]]; then
echo "Installing $add_list..."
sudo swupd bundle-add --quiet $add_list || exit $?
fi
# Install VNC Server.
sudo ./vncinstall
EOF
Run the wrapper script to install VNC Server.
bash cl_vncinstall.sh
How to use VNC Server is beyond the scope of this thread. This topic was created for folks familiar with VNC Server. You will need VNC Viewer on the client machine.
VNC Server has two modes (Service and Virtual). No further action is needed for VNC Service mode. Simply start the service. You will need to create an account at realvnc.com to get set up. The trial period last two weeks.
systemctl start vncserver-x11-serviced.service
Running Virtual mode requires additional software xorg-x11-drv-dummy and xorg-x11-drv-void. I had to build these, which required a dependency xorg-x11-util-macros and Clear Linux bundles c-basic, package-utils, devpkg-elfutils, devpkg-libpciaccess, devpkg-xorgproto, and devpkg-xorg-server.
I obtained Fedora 37 xorg-x11-drv-dummy, xorg-x11-drv-void source RPMs (src.rpm) from pkgs.org. Also, Fedora 37 xorg-x11-util-macros (noarch.rpm).
a. sudo swupd bundle-add c-basic package-utils devpkg...
b. sudo rpm -ivh --nodeps xorg-x11-util-macros*noarch.rpm
c. (as user) rpm -ivh xorg-x11-drv-dummy*src.rpm xorg-x11-drv-void*src.rpm
d. change folder to ~/rpmbuild/SPECS
e. delete `BuildRequires` and `Requires` lines inside *.spec files
f. rpmbuild -bb xorg-x11-drv-dummy.spec
g. rpmbuild -bb xorg-x11-drv-void.spec
h. cd ../RPMS/x86_64
i. rm *debug*.rpm
j. sudo rpm -ivh --nodeps xorg-x11-drv-dummy*rpm xorg-x11-drv-void*rpm
Running Virtual mode requires applying an offline license to VNC Connect. See also, Beginner’s guide to Virtual Mode.
That’s about all. I am not affiliated with realvnc.com. This is something I tried, wondering if possible on Clear Linux. Yes, indeed. VNC Server works wonderfully. Run VNC Viewer on the client machine.