首先我安装了以下软件包:
sudo apt-get install --no-install-recommends ubuntu-desktop gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal
然后我将 ~/.vnc/xstartup 配置为:
# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc
[ -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 &
gnome-panel &
gnome-settings-daemon &
metacity &
nautilus &
连接后,我的 VNCVIEWER 只显示灰色桌面(但 nautilus 可以工作),并且日志文件显示:
Xvnc Free Edition 4.1.1 - built Feb 25 2015 23:02:21
Copyright (C) 2002-2005 RealVNC Ltd.
See http://www.realvnc.com for information on VNC.
Underlying X server release 40300000, The XFree86 Project, Inc
Sun Jan 12 21:11:02 2020
vncext: VNC extension running!
vncext: Listening for VNC connections on port 5909
vncext: created VNC server for screen 0
error opening security policy file /etc/X11/xserver/SecurityPolicy
Could not init font path element /usr/X11R6/lib/X11/fonts/Type1/, removing from list!
Could not init font path element /usr/X11R6/lib/X11/fonts/Speedo/, removing from list!
Could not init font path element /usr/X11R6/lib/X11/fonts/misc/, removing from list!
Could not init font path element /usr/X11R6/lib/X11/fonts/75dpi/, removing from list!
Could not init font path element /usr/X11R6/lib/X11/fonts/100dpi/, removing from list!
Could not init font path element /usr/share/fonts/X11/75dpi/, removing from list!
Could not init font path element /usr/share/fonts/X11/100dpi/, removing from list!
/home/yij/.vnc/xstartup: 19: /home/yij/.vnc/xstartup: gnome-settings-daemon: not found
xkbcommon: ERROR: xkb_x11_keymap_new_from_device: illegal device ID: -1
xkbcommon: ERROR: xkb_x11_state_new_from_device: illegal device ID: -1
** (gnome-panel:20765): WARNING **: 21:11:05.339: Failed to request name: the name already has an owner
metacity-Message: 21:11:05.373: could not find XKB extension.
(metacity:20767): metacity-WARNING **: 21:11:05.376: Failed to create MetaCompositorXRender: Missing composite extension required for compositing
Traceback (most recent call last):
File "/usr/bin/x-terminal-emulator", line 47, in <module> import terminatorlib.optionparse
File "/usr/share/terminator/terminatorlib/optionparse.py", line 23, in <module> from util import dbg, err
File "/usr/share/terminator/terminatorlib/util.py", line 20, in <module> import cairo
File "/usr/lib/python3/dist-packages/cairo/__init__.py", line 1, in <module> from ._cairo import * # noqa: F401,F403
ImportError: No module named _cairo
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module> from apport.report import Report
File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module> import apport.fileutils
File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module> from apport.packaging_impl import impl as packaging
File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 24, in <module>
import apt
File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
import apt_pkg
ImportError: No module named apt_pkg
Original exception was:
Traceback (most recent call last):
File "/usr/bin/x-terminal-emulator", line 47, in <module>
import terminatorlib.optionparse
File "/usr/share/terminator/terminatorlib/optionparse.py", line 23, in <module>
from util import dbg, err
File "/usr/share/terminator/terminatorlib/util.py", line 20, in <module>
import cairo
File "/usr/lib/python3/dist-packages/cairo/__init__.py", line 1, in <module>
from ._cairo import * # noqa: F401,F403
ImportError: No module named _cairo
Nautilus-Share-Message: 21:11:05.874: Called "net usershare info" but it failed:
Failed to execute child process “net” (No such file or directory)
请告诉我我该怎么办?
答案1
您从哪里复制了这个过时/错误的配置?
x-window-manager
已经启动了默认窗口管理器(在我的安装上是这样的mutter
)但是接下来几行你尝试启动其他窗口管理器- metacity
。
gnome-settings-daemon
不作为单个二进制文件/应用程序存在(日志文件已经告诉您)。它已被拆分成许多较小的应用程序...
gnome-panel
日志“请求名称失败:该名称已有所有者”...这可能意味着您的默认窗口管理器是,gnome-shell
并且我认为它在没有复合扩展的情况下无法工作(它在 gnome-shell/mutter 中不是可选的)。
根据列出的组件,我认为配置应该是这样的(未经测试):
# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc
[ -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" &
export XDG_CURRENT_DESKTOP="GNOME-Flashback:GNOME"
export XDG_MENU_PREFIX="gnome-flashback-"
gnome-session --session=gnome-flashback-metacity --disable-acceleration-check &
至少你需要安装一些额外的软件包 -gnome-flashback
和gnome-session-flashback
。不知道这是否是你想要的...