cd /etc/X11/Sessions
mv ./Xsession Xsession_bkp
And restart the vncserver.
i.e. some stuff and junk about Python, Perl, Matlab, Ruby, Mac X, Linux, Solaris, ...
cd /etc/X11/Sessions
mv ./Xsession Xsession_bkp
session=startfluxbox
securitytypes=none
geometry=2000x1200
localhost
alwaysshared
session=startfluxbox
securitytypes=none
geometry=1800x1100
localhost
alwaysshared
Host myserver
HostName serverip
User ubuntu
IdentityFile ~/.ssh/private.pem
LocalForward 5903 localhost:5901
$session = "startfluxbox";
$SecurityTypes = "none";
$geometry = "2000x1200";
$localhost = "yes";
$AlwaysShared = "yes";
sudo systemctl enable --now tigervncserver@:1
cd /etc/X11/Sessions
mv Xsession Xsession.backup
ln -s fluxbox Xsession
set -e XDG_RUNTIME_DIR
set -e DBUS_SESSION_BUS_ADDRESS
unset XDG_RUNTIME_DIR
unset DBUS_SESSION_BUS_ADDRESS
exec fluxbox
[Unit]
Description=My VNC
[Service]
Type=simple
ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
ExecStart=/usr/bin/vncserver %i
ExecStop=/usr/bin/vncserver -kill %i
[Install]
WantedBy=default.target
Then
systemctl --user start myvnc@\:1.service
and
systemctl --user enable myvnc@\:1.service
and
securitytypes=none
[Unit]
Description=My VNC
[Service]
Type=simple
ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
ExecStart=/usr/bin/vncserver -geometry 1920x1080 :%i -xstartup /home/mwo2/.vnc/xstartup -SecurityTypes None -fg
ExecStop=/usr/bin/vncserver -kill :i
[Install]
WantedBy=default.target
vncviewer -QualityLevel=7 -FullColor=0 -LowColorLevel=2 -CompressLevel=3 :3
sudo apt-get install xtightvncviewer to use it vncviewer with ssh tunnel: vncviewer -via remoteusername@vncserverip localhost:1
ssh -N -L 5904:127.0.0.1:5901 username@remoteserverThe above command forwards everything on localhost port 5904 to the port 5901 on remoteserver. This is what I use to connect to a VNC service on port 5901 on a remoteserver at my job from my home computer. Thus, at home, after establishing the above tunnel I can use a vncviewer as follows:vncviewer :4