使用 Unity 在 Ubuntu 16.04 LTS 上使用 VNC 服务器

使用 Unity 在 Ubuntu 16.04 LTS 上使用 VNC 服务器

是否有人在通过 VNC 远程连接时使用 xstartup 文件设置 vncserver 以支持 Unity 时遇到问题?我阅读了大量关于在 16.04 上设置 vncserver 的文章,但这些文章都不适用于 Unity,因此我需要安装 gnome-panel、gnome-settings-daemon、metacity、nautilus 和 gnome-terminal,并为 xstartup 添加几行代码,以使 VNC 适用于 Gnome classic 而不是 Unity。

为什么 Unity 不支持 VNC?

有什么想法吗?如果有人成功让 VNC 远程连接到 16.04 上的完整 Unity 桌面,请分享设置。

我不想使用 Vino,我需要通过 VNC 为其他用户进行多个会话。

答案1

Ubuntu 16.04 有一个默认的 VNC 服务器VINO,并且VINO可以与 Unity 一起运行而没有问题。

了解更多信息 https://help.ubuntu.com/community/VNC/Servers

答案2

~/.vnc/xstartup

#!/bin/sh
export XKL_XMODMAP_DISABLE=1
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -nowin &
gnome-session &
/usr/lib/x86_64-linux-gnu/unity/unity-panel-service &
unity-settings-daemon &
unity &

答案3

我结合了以下帖子中的信息来获得一个工作会话。

第二个是关于启用 RDP 访问,但示例 .xsession 让我意识到其他帖子中的 .xstartup 示例缺少什么。即启动面板服务和设置守护进程。

https://help.ubuntu.com/community/VNC/Servers

https://www.hiroom2.com/2016/08/28/ubuntu-16-04-remote-connect-to-unity-with-vnc-xrdp/

因为我使用了 VPN,所以我不必担心 VNCAuth 之外的安全性。

这是我在 .xstartup 中最终得到的 GNOME 子句。

            gnome-session --session=ubuntu &
            /usr/lib/x86_64-linux-gnu/unity/unity-panel-service &
            /usr/lib/unity-settings-daemon/unity-settings-daemon &

            for indicator in /usr/lib/x86_64-linux-gnu/indicator-*; do
              basename=`basename ${indicator}`
              dirname=`dirname ${indicator}`
              service=${dirname}/${basename}/${basename}-service
              ${service} &
            done

            unity

我确实注意到,当我调整显示屏大小时,屏幕保护程序和鹦鹉螺会炸开,但我可以忍受。

相关内容