在 Ubuntu 22.04 上安装 RealVNC 服务器时出现错误:“下载以未沙盒化的形式以 root 身份执行”

在 Ubuntu 22.04 上安装 RealVNC 服务器时出现错误:“下载以未沙盒化的形式以 root 身份执行”

最近从 Ubuntu 20.04 升级到 22.04。我正在尝试在 Ubuntu 22.04 LTS 桌面上安装 RealVNC Server。我从这里下载了 Debx64 文件:https://www.realvnc.com/en/connect/download/vnc/linux/。然后在终端中运行安装命令,收到以下错误:

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)

这是一次不成功的安装,即 RealVNCServer 在收到此错误后没有运行。

完整的终端输出是:

$ 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)

然后我尝试使用以下方法安装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) ...

使用时没有安装错误dkpg -i

然后,我单击应用程序中的 VNCServer 图标以尝试启动该应用程序,并收到一个弹出窗口,提示“需要进行身份验证才能以超级用户身份运行‘/etc/vnc/vncservice’”。但没有出现 GUI。

我运行以下命令来检查服务是否正在运行:

$ 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

我有几个问题:

  • 缺少 VNCServer GUI 是否与 ConsoleDisplay 错误有关?我想我已经读过,为了使此功能正常工作,需要禁用 Wayland,但是当我禁用 Wayland 时,由于我在 VNC 之外使用此桌面,因此显示变得完全不可读。
  • 关于如何实现这个功能有什么建议吗?

谢谢!

相关内容