如何在 AWS 服务器上通过 TightVNC 运行 gnome-desktop?

如何解决如何在 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)

我已经尝试了以下说明:

  1. VNC connection to Linux VM jus shows a gray screen... bu isn't gnome running?
  2. Ubuntu 20.04 Remote Desktop Access with VNC
  3. How to Install and Configure VNC on Ubuntu 20.04
  4. How to run Gnome desktop on Ubuntu 20.04 in cloud
  5. 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 举报,一经查实,本站将立刻删除。

相关推荐


依赖报错 idea导入项目后依赖报错,解决方案:https://blog.csdn.net/weixin_42420249/article/details/81191861 依赖版本报错:更换其他版本 无法下载依赖可参考:https://blog.csdn.net/weixin_42628809/a
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下 2021-12-03 13:33:33.927 ERROR 7228 [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPL
错误1:gradle项目控制台输出为乱码 # 解决方案:https://blog.csdn.net/weixin_43501566/article/details/112482302 # 在gradle-wrapper.properties 添加以下内容 org.gradle.jvmargs=-Df
错误还原:在查询的过程中,传入的workType为0时,该条件不起作用 &lt;select id=&quot;xxx&quot;&gt; SELECT di.id, di.name, di.work_type, di.updated... &lt;where&gt; &lt;if test=&qu
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct redisServer’没有名为‘server_cpulist’的成员 redisSetCpuAffinity(server.server_cpulist); ^ server.c: 在函数‘hasActiveC
解决方案1 1、改项目中.idea/workspace.xml配置文件,增加dynamic.classpath参数 2、搜索PropertiesComponent,添加如下 &lt;property name=&quot;dynamic.classpath&quot; value=&quot;tru
删除根组件app.vue中的默认代码后报错:Module Error (from ./node_modules/eslint-loader/index.js): 解决方案:关闭ESlint代码检测,在项目根目录创建vue.config.js,在文件中添加 module.exports = { lin
查看spark默认的python版本 [root@master day27]# pyspark /home/software/spark-2.3.4-bin-hadoop2.7/conf/spark-env.sh: line 2: /usr/local/hadoop/bin/hadoop: No s
使用本地python环境可以成功执行 import pandas as pd import matplotlib.pyplot as plt # 设置字体 plt.rcParams[&#39;font.sans-serif&#39;] = [&#39;SimHei&#39;] # 能正确显示负号 p
错误1:Request method ‘DELETE‘ not supported 错误还原:controller层有一个接口,访问该接口时报错:Request method ‘DELETE‘ not supported 错误原因:没有接收到前端传入的参数,修改为如下 参考 错误2:cannot r
错误1:启动docker镜像时报错:Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen 解决方法:重启docker -&gt; systemctl r
错误1:private field ‘xxx‘ is never assigned 按Altʾnter快捷键,选择第2项 参考:https://blog.csdn.net/shi_hong_fei_hei/article/details/88814070 错误2:启动时报错,不能找到主启动类 #
报错如下,通过源不能下载,最后警告pip需升级版本 Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4) Coll
错误1:maven打包报错 错误还原:使用maven打包项目时报错如下 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
错误1:服务调用时报错 服务消费者模块assess通过openFeign调用服务提供者模块hires 如下为服务提供者模块hires的控制层接口 @RestController @RequestMapping(&quot;/hires&quot;) public class FeignControl
错误1:运行项目后报如下错误 解决方案 报错2:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sb 解决方案:在pom.
参考 错误原因 过滤器或拦截器在生效时,redisTemplate还没有注入 解决方案:在注入容器时就生效 @Component //项目运行时就注入Spring容器 public class RedisBean { @Resource private RedisTemplate&lt;String
使用vite构建项目报错 C:\Users\ychen\work&gt;npm init @vitejs/app @vitejs/create-app is deprecated, use npm init vite instead C:\Users\ychen\AppData\Local\npm-