Skip to content

Commit

Permalink
v9.1
Browse files Browse the repository at this point in the history
- RealVNC | Support for RealVNC for Raspberry Pi has been removed from Raspberry Pi Ltd. end, who are suggesting to use TigerVNC instead, which we support already: https://www.raspberrypi.com/documentation/computers/remote-access.html#vnc. While the APT packages are still present and generally work with X11 (https://help.realvnc.com/hc/en-us/articles/14110635000221-Raspberry-Pi-5-Bookworm-and-RealVNC-Connect), they depend on legacy GPU API libraries, which have been deprecated and are not provided anymore by the new kernel and firmware packages for RPi. Since we need to migrate to the new kernel/firmware stack for Raspberry Pi 5 support, we need to drop support for RealVNC as well. If you have installed it currently, it will continue to work for now, but we suggest to migrate to TigerVNC. See the following instructions about how to uninstall RealVNC manually: #6881
  • Loading branch information
MichaIng committed Feb 1, 2024
1 parent 9de58e6 commit e6ce445
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 66 deletions.
1 change: 1 addition & 0 deletions .meta/dietpi-survey_report
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,7 @@ shopt -s extglob
aSOFTWARE_NAME9_0[i]=${aSOFTWARE_NAME8_25[i]}
aSOFTWARE_NAME9_1[i]=${aSOFTWARE_NAME9_0[i]}
done
unset -v 'aSOFTWARE_NAME9_1[120]' # RealVNC

# Pre-create software counter array so that we can see also software (available in newest version) with 0 installs
for i in "${aSOFTWARE_NAME9_1[@]}"
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ v9.1

New images:

Removed software:
- RealVNC | Support for RealVNC for Raspberry Pi has been removed from Raspberry Pi Ltd. end, who are suggesting to use TigerVNC instead, which we support already: https://www.raspberrypi.com/documentation/computers/remote-access.html#vnc. While the APT packages are still present and generally work with X11 (https://help.realvnc.com/hc/en-us/articles/14110635000221-Raspberry-Pi-5-Bookworm-and-RealVNC-Connect), they depend on legacy GPU API libraries, which have been deprecated and are not provided anymore by the new kernel and firmware packages for RPi. Since we need to migrate to the new kernel/firmware stack for Raspberry Pi 5 support, we need to drop support for RealVNC as well. If you have installed it currently, it will continue to work for now, but we suggest to migrate to TigerVNC. See the following instructions about how to uninstall RealVNC manually: https://github.com/MichaIng/DietPi/pull/6881

Enhancements:
- DietPi-Software | Domoticz: Enabled for x86_64 Bookworm and Trixie systems, since the latest x86_64 builds were compiled against libssl3.

Expand Down
79 changes: 13 additions & 66 deletions dietpi/dietpi-software
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,6 @@ Available commands:
aSOFTWARE_CATX[$software_id]=1
aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/remote_desktop/#tigervnc-server'
aSOFTWARE_DEPS[$software_id]='desktop'
aSOFTWARE_CONFLICTS[$software_id]='120'
#------------------
software_id=29
aSOFTWARE_NAME[$software_id]='XRDP'
Expand All @@ -306,16 +305,6 @@ Available commands:
aSOFTWARE_DEPS[$software_id]='desktop'
# - RISC-V: No package: https://downloads.nomachine.com/
aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,11]=0
#------------------
software_id=120
aSOFTWARE_NAME[$software_id]='RealVNC Server'
aSOFTWARE_DESC[$software_id]='desktop for remote connection'
aSOFTWARE_CATX[$software_id]=1
aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/remote_desktop/#realvnc-server'
aSOFTWARE_DEPS[$software_id]='desktop'
aSOFTWARE_CONFLICTS[$software_id]='28'
# RPi only (archive.raspberrypi.com repo, libraspberrypi0 dependency, license)
(( $G_HW_MODEL > 9 )) && aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,$G_HW_MODEL]=0

# Media Systems
#--------------------------------------------------------------------------------
Expand Down Expand Up @@ -7075,20 +7064,11 @@ _EOF_
local apackages=()
(( $G_DISTRO > 6 )) && apackages=('tigervnc-tools')
G_AGI tigervnc-standalone-server tigervnc-scraping-server "${apackages[@]}"
fi

if To_Install 120 # RealVNC Server
then
G_AGI realvnc-vnc-server libraspberrypi0 # Depends on libbcm_host.so but does not pull libraspberrypi0 as dependency
fi

# TigerVNC/RealVNC Server - Shared setup
if (( ${aSOFTWARE_INSTALL_STATE[28]} == 1 || ${aSOFTWARE_INSTALL_STATE[120]} == 1 ))
then
# Service
cat << '_EOF_' > /etc/systemd/system/vncserver.service
[Unit]
Description=VNC Server (DietPi)
Description=TigerVNC Server (DietPi)
Before=xrdp.service xrdp-sesman.service
Wants=network-online.target
After=network-online.target
Expand All @@ -7106,29 +7086,10 @@ WantedBy=multi-user.target
_EOF_
aSTART_SERVICES+=('vncserver')

# RealVNC: Assure that its services are disabled when ours is enabled
(( ${aSOFTWARE_INSTALL_STATE[120]} == 1 )) && G_EXEC systemctl --no-reload disable vncserver-virtuald vncserver-x11-serviced

# Startup script
cat << '_EOF_' > /usr/local/bin/vncserver
#!/bin/dash

if [ -f '/usr/bin/vncserver-virtual' ]
then
echo '[ OK ] RealVNC detected'
FP_BINARY='/usr/bin/vncserver-virtual -Authentication VncAuth'
FP_SHARED='exec /usr/bin/vncserver-x11 -service -Authentication VncAuth'

elif [ -f '/usr/bin/tigervncserver' ]
then
echo '[ OK ] TigerVNC detected'
FP_BINARY='/usr/bin/tigervncserver'
[ -f '/usr/bin/X0tigervnc' ] && FP_SHARED='/usr/bin/X0tigervnc' || FP_SHARED='/usr/bin/x0tigervncserver'
FP_SHARED="$FP_SHARED -display :0 -rfbauth $HOME/.vnc/passwd"
else
echo '[FAILED] No supported VNC server installed'
exit 1
fi

case "$1" in

start)
Expand All @@ -7140,7 +7101,7 @@ case "$1" in
do
until pgrep '^X' > /dev/null 2>&1; do sleep 1; done
echo '[ INFO ] Connecting to shared desktop'
$FP_SHARED
/usr/bin/X0tigervnc -display :0 -rfbauth "$HOME/.vnc/passwd"
sleep 2
pgrep '^X' > /dev/null 2>&1 && exit 1
echo '[ INFO ] X server stopped, waiting for next session...'
Expand All @@ -7152,9 +7113,9 @@ case "$1" in
WIDTH=$(sed -n '/^[[:blank:]]*SOFTWARE_VNCSERVER_WIDTH=/{s/^[^=]*=//p;q}' /boot/dietpi.txt)
HEIGHT=$(sed -n '/^[[:blank:]]*SOFTWARE_VNCSERVER_HEIGHT=/{s/^[^=]*=//p;q}' /boot/dietpi.txt)
DEPTH=$(sed -n '/^[[:blank:]]*SOFTWARE_VNCSERVER_DEPTH=/{s/^[^=]*=//p;q}' /boot/dietpi.txt)
echo "[ INFO ] Starting virtual desktop at display :${DISPLAY:-1} in ${WIDTH:-1280}x${HEIGHT:-720}x${DEPTH:-16}"
echo "[ INFO ] Starting virtual desktop at display :${DISPLAY:=1} in ${WIDTH:=1280}x${HEIGHT:=720}x${DEPTH:=16}"
export SHELL='/bin/bash'
exec $FP_BINARY ":${DISPLAY:-1}" -geometry "${WIDTH:-1280}x${HEIGHT:-720}" -depth "${DEPTH:-16}"
exec /usr/bin/tigervncserver ":$DISPLAY" -geometry "${WIDTH}x$HEIGHT" -depth "$DEPTH"
fi
;;

Expand All @@ -7163,13 +7124,13 @@ case "$1" in
if grep -q '^[[:blank:]]*SOFTWARE_VNCSERVER_SHARE_DESKTOP=1' /boot/dietpi.txt
then
echo '[ INFO ] Disconnecting from shared desktop'
killall -qw vncserver-x11-core x0tigervncserver X0tigervnc
killall -qw X0tigervnc

# Virtual desktop mode
else
DISPLAY=$(sed -n '/^[[:blank:]]*SOFTWARE_VNCSERVER_DISPLAY_INDEX=/{s/^[^=]*=//p;q}' /boot/dietpi.txt)
echo "[ INFO ] Stopping virtual desktop at display :${DISPLAY:-1}"
$FP_BINARY -kill ":${DISPLAY:-1}"
echo "[ INFO ] Stopping virtual desktop at display :${DISPLAY:=1}"
/usr/bin/tigervncserver -kill ":$DISPLAY"
fi
;;

Expand All @@ -7184,28 +7145,18 @@ exit 0
_EOF_
G_EXEC chmod +x /usr/local/bin/vncserver

# TigerVNC: Permit remote connections which implies TLSVnc authentications being enabled additionally
# Permit remote connections which implies TLSVnc authentications being enabled additionally
# shellcheck disable=SC2016
GCI_PRESERVE=1 G_CONFIG_INJECT '\$localhost[[:blank:]]*=' '$localhost = "no";' /etc/tigervnc/vncserver-config-defaults

# TigerVNC: Set control + read-only passwords
if [[ ${aSOFTWARE_INSTALL_STATE[28]} == 1 && ! -f '/root/.vnc/passwd' ]]
# Set control + read-only passwords
if [[ ! -f '/root/.vnc/passwd' ]]
then
G_EXEC mkdir -p /root/.vnc
tigervncpasswd -f <<< "$GLOBAL_PW
$GLOBAL_PW" > /root/.vnc/passwd
G_EXEC chmod 600 /root/.vnc/passwd
fi

# RealVNC: Set virtual + shared desktop passwords, repeat virtual password command two times: https://github.com/MichaIng/DietPi/pull/4679#issuecomment-908196511
if [[ ${aSOFTWARE_INSTALL_STATE[120]} == 1 && ! -s '/root/.vnc/config.d/Xvnc' ]]
then
vncpasswd -virtual <<< "$GLOBAL_PW
$GLOBAL_PW"
vncpasswd -service <<< "$GLOBAL_PW
$GLOBAL_PW"
[[ -f '/root/.vnc/config.d/.Xvnc-v5-marker' ]] || > /root/.vnc/config.d/.Xvnc-v5-marker
fi
fi

if To_Install 73 fail2ban # Fail2Ban
Expand Down Expand Up @@ -13097,13 +13048,9 @@ If no WireGuard (auto)start is included, but you require it, please do the follo
Remove_Database freshrss
fi

if To_Uninstall 28 || To_Uninstall 120 # TigerVNC/RealVNC
if To_Uninstall 28 # TigerVNC
then
# RealVNC services
Remove_Service vncserver-x11-serviced
Remove_Service vncserver-virtuald

G_AGP 'tigervnc-*' x11vnc realvnc-vnc-server
G_AGP 'tigervnc-*' x11vnc

Remove_Service vncserver
[[ -f '/usr/local/bin/vncserver' ]] && G_EXEC rm /usr/local/bin/vncserver
Expand Down

0 comments on commit e6ce445

Please sign in to comment.