------------------
New 'host:50 (profitus)' desktop at :50 on machine host
Starting applications specified in /home/profitus/.vnc/xstartup
Log file is /home/profitus/.vnc/cubit:50.log
Use xtigervncviewer -SecurityTypes VncAuth -passwd /home/profitus/.vnc/passwd :50 to connect to the VNC server.
------------------
But I CANNOT connect to it from the outside. There are no errors reported in the log when trying to connect (located as stated in the output above). The command 'netstat -tpln' shows:
------------------
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
...
tcp 0 0 127.0.0.1:5950 0.0.0.0:* LISTEN 7449/Xtigervnc
...
tcp6 0 0 ::1:5950 :::* LISTEN 7449/Xtigervnc
...
------------------
My current ~/.vnc/xstartup looks like:
------------------
#!/bin/bash
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
x-window-manager &
xrdb $HOME/.Xresources
startkde &
------------------
I even tried using lines such as
------------------
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc
------------------
instead of 'startkde &', but that didn't work.
I have tried other VNC servers such as x11vnc by Karl Runge. That server does properly start up and I can access it from the outside through port 5950. But it only hooks me up with screen :0 and it is pretty buggy.
I also tried tightvnc to port 50 and it only works if I accept its "default" screen resolution at 800x600 and it only hooks me up with screen :0. If I try something else I only get a gray screen with a mouse pointer. I get similar results with vnc4server too with the difference that I only get a gray screen no matter what I do and I get some checkboxes at the upper left corner on the gray screen.
---
https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-vnc-on-ubuntu-18-04
---
I essentially wrote:
sh -L 5950:127.0.0.1:5950 -C -N -l profitus <my_ip> -p 222
Where 222 is my ssh port. But when I try start vnserver after running this command,, vncserver complains that another vncserver is already running. netstat shows that ssh is running.
If I otoh run vncserver before, then ssh will fail to bind the port.
---------
ssh -L 5920:127.0.0.1:5950 -C -N -l profitus <my_ip> -p 222
vncserver -geometry 1920x1080 -depth 24 :20
---------
but that also fails. It doesn't matter which order I execute these commands. I still fail to login.
I also tried the flag '-rfbport 5920' instead of ':20' and also in conjunction with :20.