3

I want to use an AWS Ubuntu 20.04 LTS server with GNOME desktop/Unity over VNC. While I can connect via VNC, I get a bare bones, gray X window. In some variations, I also had a poorly drawn file manager. Currently, I have tightvncserver installed, with a password set. I launch it as: vncserver :1. I'm connecting from a Windows 10 box, running TightVNC Viewer.

It very much seems that the X11 display manager is the problem, not VNC. However, the gdm3 display manager is running:

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

I have tried the following instructions:

  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 - Yes, this is about Google Cloud, but the prior item refers to it as a solution.

There are probably 6 others that I have also tried. I don't have their URLs handy, nor do I think them particularly helpful since the results are virtually identical.

This is not new and doesn't seem like it should be this hard. I never even get a session authentication prompt. I am willing to start again from scratch with a new Ubuntu 20.04 AWS server if that will help to clean up any mistakes/unknown conditions.

While I have had numerous iterations of ~/.vnc/xstartup, it currently looks like this:

#!/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

While /etc/X11/Xsession is the default:

#!/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

In case it is relevant, below is the list of current systemctl targets. Note that graphical-target is active. I've also tried with multi-user as the default target. I don't observe any change.

$ 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.
Jeff Benshetler
  • 640
  • 6
  • 13

0 Answers0