如何解决如何在 AWS 服务器上通过 TightVNC 运行 gnome-desktop?
我想通过 VNC 使用带有 GNOME 桌面/Unity 的 AWS Ubuntu 20.04 LTS 服务器。虽然我可以通过 VNC 连接,但我得到了一个简单的灰色 X 窗口。在某些变体中,我还有一个画得很差的文件管理器。
目前,我已经安装了 tightvncserver
,并设置了密码。我启动它:
vncserver :1
。我正在从运行 TightVNC 查看器的 Windows 10 盒子进行连接。
问题很明显是 X11 显示管理器,而不是 VNC。但是,gdm3
显示管理器正在运行:
$ systemctl status display-manager.service
● gdm.service - GNOME Display Manager
Loaded: loaded (/lib/systemd/system/gdm.service; static; vendor preset: enabled)
Active: active (running) since Thu 2021-04-29 14:53:51 UTC; 32min ago
Process: 17105 ExecStartPre=/usr/share/gdm/generate-config (code=exited,status=0/SUCCESS)
Process: 17113 ExecStartPre=/usr/lib/gdm3/gdm-wait-for-drm (code=exited,status=0/SUCCESS)
Main PID: 17163 (gdm3)
Tasks: 3 (limit: 18978)
Memory: 6.2M
CGroup: /system.slice/gdm.service
└─17163 /usr/sbin/gdm3
Apr 29 14:53:40 ip-10-0-1-105 systemd[1]: Starting GNOME Display Manager...
Apr 29 14:53:51 ip-10-0-1-105 systemd[1]: Started GNOME Display Manager.
Apr 29 14:53:51 ip-10-0-1-105 gdm-launch-environment][17177]: pam_unix(gdm-launch-environment:session): session opened >
Apr 29 14:53:51 ip-10-0-1-105 gdm-launch-environment][17177]: pam_unix(gdm-launch-environment:session): session closed >
Apr 29 14:53:51 ip-10-0-1-105 gdm3[17163]: GdmDisplay: Session never registered,failing
Apr 29 14:53:51 ip-10-0-1-105 gdm3[17163]: Child process -17271 was already dead.
Apr 29 14:53:51 ip-10-0-1-105 gdm3[17163]: Child process -17271 was already dead.
Apr 29 14:53:51 ip-10-0-1-105 gdm-launch-environment][17706]: pam_unix(gdm-launch-environment:session): session opened >
lines 1-19/19 (END)
我已经尝试了以下说明:
- VNC connection to Linux VM jus shows a gray screen... bu isn't gnome running?
- Ubuntu 20.04 Remote Desktop Access with VNC
- How to Install and Configure VNC on Ubuntu 20.04
- How to run Gnome desktop on Ubuntu 20.04 in cloud
- Installing and configuring Ubuntu Desktop for Google Cloud Platform - 是的,这与 Google Cloud 相关,但前一项将其称为解决方案。
可能还有其他 6 个我也尝试过。我手边没有它们的网址,我认为它们也不是特别有用,因为结果几乎相同。
这并不新鲜,看起来也不应该这么难。我什至从未收到会话身份验证提示。我很愿意使用新的 Ubuntu 20.04 AWS 服务器从头开始,如果这有助于清理任何错误/未知情况。
虽然我对 ~/.vnc/xstartup
进行了多次迭代,但目前它看起来像这样:
#!/bin/sh
xrdb $HOME/.Xresources
xsetroot -sold grey
xterminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
export XKL_MODEMAP_DISABLE=1
/etc/X11/Xsession
虽然 /etc/X11/Xsession
是默认值:
#!/bin/sh
#
# /etc/X11/Xsession
#
# global Xsession file -- used by display managers and xinit (startx)
# $Id: Xsession 967 2005-12-27 07:20:55Z dnusinow $
set -e
PROGNAME=Xsession
message () {
# pretty-print messages of arbitrary length; use xmessage if it
# is available and $DISPLAY is set
MESSAGE="$PROGNAME: $*"
echo "$MESSAGE" | fold -s -w ${COLUMNS:-80} >&2
if [ -n "$DISPLAY" ] && which xmessage > /dev/null 2>&1; then
echo "$MESSAGE" | fold -s -w ${COLUMNS:-80} | xmessage -center -file -
fi
}
message_nonl () {
# pretty-print messages of arbitrary length (no trailing newline); use
# xmessage if it is available and $DISPLAY is set
MESSAGE="$PROGNAME: $*"
echo -n "$MESSAGE" | fold -s -w ${COLUMNS:-80} >&2;
if [ -n "$DISPLAY" ] && which xmessage > /dev/null 2>&1; then
echo -n "$MESSAGE" | fold -s -w ${COLUMNS:-80} | xmessage -center -file -
fi
}
errormsg () {
# exit script with error
message "$*"
exit 1
}
internal_errormsg () {
# exit script with error; essentially a "THIS SHOULD NEVER HAPPEN" message
# One big call to message() for the sake of xmessage; if we had two then
# the user would have dismissed the error we want reported before seeing the
# request to report it.
errormsg "$*" \
"Please report the installed version of the \"x11-common\"" \
"package and the complete text of this error message to" \
"<debian-x@lists.debian.org>."
}
# initialize variables for use by all session scripts
OPTIONFILE=/etc/X11/Xsession.options
SYSRESOURCES=/etc/X11/Xresources
USRRESOURCES=$HOME/.Xresources
SYSSESSIONDIR=/etc/X11/Xsession.d
USERXSESSION=$HOME/.xsession
USERXSESSIONRC=$HOME/.xsessionrc
ALTUSERXSESSION=$HOME/.Xsession
ERRFILE=$HOME/.xsession-errors
# attempt to create an error file; abort if we cannot
if (umask 077 && touch "$ERRFILE") 2> /dev/null && [ -w "$ERRFILE" ] &&
[ ! -L "$ERRFILE" ]; then
chmod 600 "$ERRFILE"
elif ERRFILE=$(tempfile 2> /dev/null); then
if ! ln -sf "$ERRFILE" "${TMPDIR:=/tmp}/xsession-$USER"; then
message "warning: unable to symlink \"$TMPDIR/xsession-$USER\" to" \
"\"$ERRFILE\"; look for session log/errors in" \
"\"$TMPDIR/xsession-$USER\"."
fi
else
errormsg "unable to create X session log/error file; aborting."
fi
# truncate ERRFILE if it is too big to avoid disk usage DoS
if [ "`stat -c%s \"$ERRFILE\"`" -gt 500000 ]; then
T=`mktemp -p "$HOME"`
tail -c 500000 "$ERRFILE" > "$T" && mv -f "$T" "$ERRFILE" || rm -f "$T"
fi
exec >>"$ERRFILE" 2>&1
echo "$PROGNAME: X session started for $LOGNAME at $(date)"
# sanity check; is our session script directory present?
if [ ! -d "$SYSSESSIONDIR" ]; then
errormsg "no \"$SYSSESSIONDIR\" directory found; aborting."
fi
# Attempt to create a file of non-zero length in /tmp; a full filesystem can
# cause mysterious X session failures. We do not use touch,:,or test -w
# because they won't actually create a file with contents. We also let standard
# error from tempfile and echo go to the error file to aid the user in
# determining what went wrong.
WRITE_TEST=$(tempfile)
if ! echo "*" >>"$WRITE_TEST"; then
message "warning: unable to write to ${WRITE_TEST%/*}; X session may exit" \
"with an error"
fi
rm -f "$WRITE_TEST"
# use run-parts to source every file in the session directory; we source
# instead of executing so that the variables and functions defined above
# are available to the scripts,and so that they can pass variables to each
# other
SESSIONFILES=$(run-parts --list $SYSSESSIONDIR)
if [ -n "$SESSIONFILES" ]; then
set +e
for SESSIONFILE in $SESSIONFILES; do
. $SESSIONFILE
done
set -e
fi
exit 0
如果相关,以下是当前 systemctl
目标的列表。请注意,graphical-target
处于活动状态。我也试过用 multi-user
作为默认目标。我没有观察到任何变化。
$ systemctl get-default
multi-user.target
ubuntu@ip-10-0-1-105:~$ systemctl list-units --type target --state active
UNIT LOAD ACTIVE SUB DESCRIPTION
basic.target loaded active active Basic System
cloud-config.target loaded active active Cloud-config availability
cloud-init.target loaded active active Cloud-init target
cryptsetup.target loaded active active Local Encrypted Volumes
getty.target loaded active active Login Prompts
graphical.target loaded active active Graphical Interface
local-fs-pre.target loaded active active Local File Systems (Pre)
local-fs.target loaded active active Local File Systems
multi-user.target loaded active active Multi-User System
network-online.target loaded active active Network is Online
network-pre.target loaded active active Network (Pre)
network.target loaded active active Network
nss-lookup.target loaded active active Host and Network Name Lookups
nss-user-lookup.target loaded active active User and Group Name Lookups
paths.target loaded active active Paths
remote-fs-pre.target loaded active active Remote File Systems (Pre)
remote-fs.target loaded active active Remote File Systems
slices.target loaded active active Slices
sockets.target loaded active active Sockets
swap.target loaded active active Swap
sysinit.target loaded active active System Initialization
time-set.target loaded active active System Time Set
time-sync.target loaded active active System Time Synchronized
timers.target loaded active active Timers
LOAD = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state,i.e. generalization of SUB.
SUB = The low-level unit activation state,values depend on unit type.
24 loaded units listed.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。