Upgraded to 20.04 and now my VNC connection no longer works...

Bo Berglund bo.berglund at gmail.com
Sat Mar 6 16:17:55 UTC 2021


On Fri, 05 Mar 2021 15:55:18 +0100, Oliver Grawert <ogra at ubuntu.com> wrote:

>hi,
>Am Freitag, den 05.03.2021, 15:37 +0100 schrieb Bo Berglund:
>> 
>> So if vnc4server has been dropped from the Ubuntu repository, what
>> alternatives
>> are there to use a headless Ubuntu 20 via VNC?
>
>vnc4server has been dropped from VNC ... 
>
>debian and ubuntu just inherit that ... 
>
>you should be able to use their new package: tigervnc-standalone-server
>(no idea if the configuration is still compatible though)
>

I have found the Ubuntu official documentation on VNC/servers:
https://help.ubuntu.com/community/VNC/Servers

Here also TigerVNC is mentioned among other alternatives.
Apparently TigerVNC is maintained by Ubuntu maintainers so it seems like the
best choice for the future.

So I installed the vnc server using:

sudo apt install tigervnc-standalone-server

Then started it with:

vncserver :1
New 'polaris-ubuntu:1 (bosse)' desktop at :1 on machine polaris-ubuntu
Starting applications specified in /home/bosse/.vnc/xstartup
Log file is /home/bosse/.vnc/polaris-ubuntu:1.log
Use xtigervncviewer -SecurityTypes VncAuth -passwd /home/bosse/.vnc/passwd :1 to
connect to the VNC server.

Now I see that it is running on display :1

$ vncserver -list
TigerVNC server sessions:

X DISPLAY #     RFB PORT #      PROCESS ID
:1              5901            34114

But when I try to connect from my Win-10 RealVNC client, which I use for all
other VNC enabled computers, it will not connect...
Something is amiss regarding the setup.

So I stopped it with:

$ vncserver -kill :1
Killing Xtigervnc process ID 34114... success!

What could I do now to get it working?
Maybe some files left over from the old vnc server that was removed by the
Ubuntu upgrade are interfering? If so how can I find which they are?
I have a $HOME/.vnc directory containg some files, should I delete this
directory and try again?

Or are there some files elsewhere that I also need to get rid of?

I tried to rename the .vnc dir and then start as follows:
-----------------------------
$ vncserver :1

You will require a password to access your desktops.

Password:
Verify:
Would you like to enter a view-only password (y/n)? n

New 'polaris-ubuntu:1 (bosse)' desktop at :1 on machine polaris-ubuntu

Starting applications specified in /etc/X11/Xvnc-session
Log file is /home/bosse/.vnc/polaris-ubuntu:1.log

Use xtigervncviewer -SecurityTypes VncAuth -passwd /home/bosse/.vnc/passwd :1 to
connect to the VNC server.
------------------------------

But even now I do not get any connection when using the RealVNC client on my
Windows10 PC even though it worked fine prior to the upgrade to Ubuntu 20.04.

The logfile contains this:
------------------------------
Xvnc TigerVNC 1.10.0 - built Apr  9 2020 06:49:31
Copyright (C) 1999-2019 TigerVNC Team and many others (see README.rst)
See https://www.tigervnc.org for information on TigerVNC.
Underlying X server release 12008000, The X.Org Foundation


Sat Mar  6 16:56:55 2021
 vncext:      VNC extension running!
 vncext:      Listening for VNC connections on local interface(s), port 5901
 vncext:      created VNC server for screen 0
------------------------------

I don't know why it has created a server for screen 0 when I specified :1 in the
command, but if I try to connect to :0 in the client it does not change
anything, still no connection....

So I checked with netstat:
------------------------------
$ netstat -vatn
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 127.0.0.1:5901          0.0.0.0:*               LISTEN <==
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN
tcp        0      0 192.168.119.135:39088   195.9.195.3:443         ESTABLISHED
tcp       24      0 192.168.119.135:39082   195.9.195.3:443         CLOSE_WAIT
tcp        0      0 192.168.119.135:39158   195.9.195.3:443         ESTABLISHED
tcp        0      0 192.168.119.135:770     192.168.119.216:2049    ESTABLISHED
tcp        0      0 192.168.119.135:39150   195.9.195.3:443         ESTABLISHED
tcp        0      0 192.168.119.135:51044   194.71.11.165:80        TIME_WAIT
tcp        0    256 192.168.119.135:22      192.168.119.238:59678   ESTABLISHED
tcp6       0      0 ::1:5901                :::*                    LISTEN <==
tcp6       0      0 :::111                  :::*                    LISTEN
tcp6       0      0 :::22                   :::*                    LISTEN
tcp6       0      0 ::1:631                 :::*                    LISTEN
--------------------------------

So there are two listening ports for VNC but these are not on the Ethernet port
at all!
What is the reason for that and also what would one use that for, it is
impossible to connect from anywhere at all, which defeats the use case for VNC
in the first place?

How can I fix this?

NOTICE:
The Ubuntu machine is sitting on the Mate login screen, there is no user session
running and this is because I want VNC to create a virtual screen which I can
set the size of independent of the LCD screen of the laptop itself.


-- 
Bo Berglund
Developer in Sweden





More information about the ubuntu-users mailing list