I also didn’t work with TigerVNC so far, but just what I found:
The vncpasswd command should create: /home//.vnc/passwd
as WarHawk mentioned, then you need to add: /home//.vnc/xstartup
This file needs to be executable by the user, so: chmod +x /home//.vnc/xstartup
Following this guide: https://linuxize.com/post/how-to-install-and-configure-vnc-on-debian-9/
the content is:
#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
exec startxfce4
But this is only true for XFCE desktop. Using exec startx as last line should work for any Xserver based desktop, AFAIK.
xrdb $HOME/.Xresources seems to be optional again to apply consistent configs.
I am not 100% sure about the last line. Appending & will start the desktop as separate process, while exec will not spawn a child.
I just checked the steps we do in DietPi-Software:
local cmd_launch_desktop=''
#DESKTOP_LXDE
if (( ${aSOFTWARE_INSTALL_STATE[23]} >= 1 )); then
cmd_launch_desktop='/usr/bin/lxsession -s LXDE &'
#DESKTOP_MATE
elif (( ${aSOFTWARE_INSTALL_STATE[24]} >= 1 )); then
cmd_launch_desktop='/usr/bin/mate-session &'
#DESKTOP_GNUSTEP
elif (( ${aSOFTWARE_INSTALL_STATE[26]} >= 1 )); then
cmd_launch_desktop='x-window-manager &'
#DESKTOP_XFCE
elif (( ${aSOFTWARE_INSTALL_STATE[25]} >= 1 )); then
cmd_launch_desktop='/usr/bin/xfce4-session &'
fi
cat << _EOF_ > $HOME/.vnc/xstartup
#!/bin/bash
export SHELL='/bin/bash'
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r /root/.Xresources ] && xrdb /root/.Xresources
xsetroot -solid grey
vncconfig -iconic &
$cmd_launch_desktop
_EOF_
chmod +x $HOME/.vnc/xstartup
Equivalent for a new user it should be:
cat << _EOF_ > /home/<username>/.vnc/xstartup
#!/bin/bash
export SHELL='/bin/bash'
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r /home/<username>/.Xresources ] && xrdb /home/<username>/.Xresources
xsetroot -solid grey
vncconfig -iconic &
$cmd_launch_desktop
_EOF_
chmod +x /home/<username>/.vnc/xstartup
Replace $cmd_launch_desktop by the correct command for your desktop (check the values assigned to this variable in code above) and as this is non-root user, perhaps xsetroot -solid grey needs to be removed, currently not sure what it does.