Zend certified PHP/Magento developer

Installing RealVNC Server on Ubuntu 22.04 error: `Download is performed unsandboxed as root as file`

Recently upgraded from Ubuntu 20.04 to 22.04. I am trying to install RealVNC Server on an Ubuntu 22.04 LTS desktop. I downloaded the Debx64 file from here: https://www.realvnc.com/en/connect/download/vnc/linux/. Then ran the install command in the terminal and received the following error:

N: Download is performed unsandboxed as root as file '/home/user/Downloads/VNC-Server-6.11.0-Linux-x64.deb' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)

This is a non-successful install i.e. RealVNCServer does not run after receiving this error.

The full terminal output is:

$ sudo apt install ./VNC-Server-6.11.0-Linux-x64.deb
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'realvnc-vnc-server' instead of './VNC-Server-6.11.0-Linux-x64.deb'
The following NEW packages will be installed:
  realvnc-vnc-server
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/10.0 MB of archives.
After this operation, 44.2 MB of additional disk space will be used.
Get:1 /home/user/Downloads/VNC-Server-6.11.0-Linux-x64.deb realvnc-vnc-server amd64 6.11.0.47988 [10.0 MB]
Selecting previously unselected package realvnc-vnc-server.
(Reading database ... 205516 files and directories currently installed.)
Preparing to unpack .../VNC-Server-6.11.0-Linux-x64.deb ...
Unpacking realvnc-vnc-server (6.11.0.47988) ...
Setting up realvnc-vnc-server (6.11.0.47988) ...
Updating /etc/pam.d/vncserver
Updating /etc/pam.conf... done

NOTICE: common configuration in /etc/pam.d contains the following modules:
   pam_sss.so
The default vncserver PAM configuration only enables pam_unix. See 
`man vncinitconfig' for details on any manual configuration required.

Looking for font path... /usr/share/fonts/X11/misc,/usr/share/fonts/X11/Type1,bu
ilt-ins (from xset).
Installed systemd unit for VNC Server in Service Mode daemon
Start or stop the service with:
  systemctl (start|stop) vncserver-x11-serviced.service
Mark or unmark the service to be started at boot time with:
  systemctl (enable|disable) vncserver-x11-serviced.service

Installed systemd unit for VNC Server in Virtual Mode daemon
Start or stop the service with:
  systemctl (start|stop) vncserver-virtuald.service
Mark or unmark the service to be started at boot time with:
  systemctl (enable|disable) vncserver-virtuald.service

Processing triggers for desktop-file-utils (0.26-1ubuntu3) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu3) ...
Processing triggers for man-db (2.10.2-1) ...
Processing triggers for shared-mime-info (2.1-2) ...
Processing triggers for mailcap (3.70+nmu1ubuntu1) ...
N: Download is performed unsandboxed as root as file '/home/user/Downloads/VNC-Server-6.11.0-Linux-x64.deb' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)

I then tried installing using dpkg -i:

$ sudo dpkg -i ./VNC-Server-6.11.0-Linux-x64.deb 
Selecting previously unselected package realvnc-vnc-server.
(Reading database ... 205516 files and directories currently installed.)
Preparing to unpack .../VNC-Server-6.11.0-Linux-x64.deb ...
Unpacking realvnc-vnc-server (6.11.0.47988) ...
Setting up realvnc-vnc-server (6.11.0.47988) ...
Updating /etc/pam.d/vncserver
Updating /etc/pam.conf... done

NOTICE: common configuration in /etc/pam.d contains the following modules:
   pam_sss.so
The default vncserver PAM configuration only enables pam_unix. See 
`man vncinitconfig' for details on any manual configuration required.

Looking for font path... /usr/share/fonts/X11/misc,/usr/share/fonts/X11/Type1,built-ins (from xset).
Installed systemd unit for VNC Server in Service Mode daemon
Start or stop the service with:
  systemctl (start|stop) vncserver-x11-serviced.service
Mark or unmark the service to be started at boot time with:
  systemctl (enable|disable) vncserver-x11-serviced.service

Installed systemd unit for VNC Server in Virtual Mode daemon
Start or stop the service with:
  systemctl (start|stop) vncserver-virtuald.service
Mark or unmark the service to be started at boot time with:
  systemctl (enable|disable) vncserver-virtuald.service

Processing triggers for shared-mime-info (2.1-2) ...
Processing triggers for man-db (2.10.2-1) ...
Processing triggers for mailcap (3.70+nmu1ubuntu1) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu3) ...
Processing triggers for desktop-file-utils (0.26-1ubuntu3) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...

No installation error using dkpg -i.

I then clicked on the VNCServer Icon in Applications to try to start the application and received a pop-up window saying “Authentication is needed to run the ‘/etc/vnc/vncservice’ as the super user’. But no GUI appeared.

I ran the following to check if the service was running:

$ sudo systemctl status vncserver-x11-serviced.service
● vncserver-x11-serviced.service - VNC Server in Service Mode daemon
     Loaded: loaded (/lib/systemd/system/vncserver-x11-serviced.service; enable>
     Active: active (running) since Sat 2022-10-29 13:36:13 PDT; 5s ago
   Main PID: 9401 (vncserver-x11-s)
      Tasks: 2 (limit: 96057)
     Memory: 2.2M
        CPU: 25ms
     CGroup: /system.slice/vncserver-x11-serviced.service
             ├─9401 /usr/bin/vncserver-x11-serviced -fg
             └─9403 /usr/bin/vncserver-x11-core -service

Oct 29 13:36:13 user systemd[1]: Started VNC Server in Service Mode daemon.
Oct 29 13:36:13 user vncserver-x11[9403]: ServerManager: Server started
Oct 29 13:36:13 user vncserver-x11[9403]: ConsoleDisplay: Cannot find a running X server on vt2

So I have a few questions:

  • Is the lack of VNCServer GUI related to the ConsoleDisplay Error? I think I’ve read that Wayland needs to be disabled in order for this to work, but when I disable Wayland, the display becomes completely unreadable when because I use this desktop outside of VNC.
  • Any suggestions on how to get this to work?

Thanks!