ubuntu 18.04 VNC Grey screen

16,508

Follow these steps:

  1. Install gnome-session-flashback:

     sudo apt install gnome-session-flashback
    
  2. Add this to ~/.vnc/xstartup:

     #!/bin/sh
     autocutsel -fork
     xrdb $HOME/.Xresources
     xsetroot -solid grey
     export XKL_XMODMAP_DISABLE=1
     export XDG_CURRENT_DESKTOP="GNOME-Flashback:Unity"
     export XDG_MENU_PREFIX="gnome-flashback-"
     unset DBUS_SESSION_BUS_ADDRESS
     gnome-session --session=gnome-flashback-metacity --disable-acceleration-check --debug &
    
Share:
16,508

Related videos on Youtube

Fountain
Author by

Fountain

Updated on September 18, 2022

Comments

  • Fountain
    Fountain over 1 year

    I'm havinng problems getting my gnome desktop to load via vnc

    initially I followed this guide for xfce vnc https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-vnc-on-ubuntu-18-04

    working Xfce config:

    #!/bin/sh
    unset SESSION_MANAGER
    unset DBUS_SESSION_BUS_ADDRESS
    startxfce4 &
    
    [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
    [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
    xsetroot -solid grey
    /usr/bin/autocutsel -s CLIPBOARD -fork
    vncconfig -iconic &
    x-terminal-emulator -geometry 80x24x10x10 -ls -title "$VNCDESKTOP Desktop" &
    gnome-session &
    

    im trying to change this to allow my gnome session:

    I found a config from: How to make VNC Server work with ubuntu-desktop without xfce

    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 -iconic &
    x-terminal-emulator -geometry 80x24x10x10 -ls -title "$VNCDESKTOP Desktop" &
    
    gnome-session &
    gnome-panel &
    gnome-settings-daemon &
    metacity &
    nautilus &
    gnome-terminal &
    

    This gets me a grey screen but Nautilus is working (yay sort of)

    my log looks like:

    25/01/20 16:12:35 Xvnc version TightVNC-1.3.10
    25/01/20 16:12:35 Copyright (C) 2000-2009 TightVNC Group
    25/01/20 16:12:35 Copyright (C) 1999 AT&T Laboratories Cambridge
    25/01/20 16:12:35 All Rights Reserved.
    25/01/20 16:12:35 See http://www.tightvnc.com/ for information on TightVNC
    25/01/20 16:12:35 Desktop name 'X' (Ubuntu-server:1)
    25/01/20 16:12:35 Protocol versions supported: 3.3, 3.7, 3.8, 3.7t, 3.8t
    25/01/20 16:12:35 Listening for VNC connections on TCP port 5901
    Font directory '/usr/share/fonts/X11/75dpi/' not found - ignoring
    Font directory '/usr/share/fonts/X11/100dpi/' not found - ignoring
    No VNC extension on display :1
    /home/dev/.vnc/xstartup: 14: /home/dev/.vnc/xstartup: gnome-settings-daemon: not found
    
    ** (gnome-panel:3635): WARNING **: 16:12:36.071: Failed to request name: the name already has an owner
    metacity-Message: 16:12:36.101: could not find XKB extension.
    
    (metacity:3637): metacity-WARNING **: 16:12:36.105: Failed to create MetaCompositorXRender: Missing composite extension required for compositing
    
    25/01/20 16:12:40 Got connection from client 192.168.0.5
    25/01/20 16:12:40 Using protocol version 3.8
    25/01/20 16:12:40 Full-control authentication passed by 192.168.0.5
    25/01/20 16:12:40 rfbProcessClientNormalMessage: ignoring unknown encoding 24
    25/01/20 16:12:40 rfbProcessClientNormalMessage: ignoring unknown encoding 16
    25/01/20 16:12:40 rfbProcessClientNormalMessage: ignoring unknown encoding 22
    25/01/20 16:12:40 rfbProcessClientNormalMessage: ignoring unknown encoding 21
    25/01/20 16:12:40 rfbProcessClientNormalMessage: ignoring unknown encoding 15
    25/01/20 16:12:40 Using zlib encoding for client 192.168.0.5
    25/01/20 16:12:40 rfbProcessClientNormalMessage: ignoring unknown encoding -314
    25/01/20 16:12:40 Enabling full-color cursor updates for client 192.168.0.5
    25/01/20 16:12:40 rfbProcessClientNormalMessage: ignoring unknown encoding -223
    25/01/20 16:12:40 Pixel format for client 192.168.0.5:
    25/01/20 16:12:40   8 bpp, depth 6
    25/01/20 16:12:40   true colour: max r 3 g 3 b 3, shift r 4 g 2 b 0
    25/01/20 16:12:40 Using raw encoding for client 192.168.0.5
    25/01/20 16:12:40 rfbProcessClientNormalMessage: ignoring unknown encoding 24
    25/01/20 16:12:40 rfbProcessClientNormalMessage: ignoring unknown encoding 22
    25/01/20 16:12:40 rfbProcessClientNormalMessage: ignoring unknown encoding 21
    25/01/20 16:12:40 rfbProcessClientNormalMessage: ignoring unknown encoding 16
    25/01/20 16:12:40 rfbProcessClientNormalMessage: ignoring unknown encoding 15
    25/01/20 16:12:40 rfbProcessClientNormalMessage: ignoring unknown encoding -314
    25/01/20 16:12:40 Enabling full-color cursor updates for client 192.168.0.5
    25/01/20 16:12:40 rfbProcessClientNormalMessage: ignoring unknown encoding -223
    25/01/20 16:12:40 rfbProcessClientNormalMessage: ignoring unknown encoding 24
    25/01/20 16:12:40 rfbProcessClientNormalMessage: ignoring unknown encoding 16
    25/01/20 16:12:40 rfbProcessClientNormalMessage: ignoring unknown encoding 22
    25/01/20 16:12:40 rfbProcessClientNormalMessage: ignoring unknown encoding 21
    25/01/20 16:12:40 rfbProcessClientNormalMessage: ignoring unknown encoding 15
    25/01/20 16:12:40 Using zlib encoding for client 192.168.0.5
    25/01/20 16:12:40 rfbProcessClientNormalMessage: ignoring unknown encoding -314
    25/01/20 16:12:40 Enabling full-color cursor updates for client 192.168.0.5
    25/01/20 16:12:40 rfbProcessClientNormalMessage: ignoring unknown encoding -223
    25/01/20 16:12:40 Pixel format for client 192.168.0.5:
    

    I did some research and saw using gnome flashback might be the way to go

    changed my config to:

    #!/bin/sh
    
    export XKL_XMODMAP_DISABLE=1
    export XDG_CURRENT_DESKTOP="GNOME-Flashback:GNOME"
    export XDG_MENU_PREFIX="gnome-flashback-"
    
    gnome-session --session=gnome-flashback-metacity --disable-acceleration-check --debug &
    

    log looks better but non-existing or invalid file:

    25/01/20 21:25:19 Xvnc version TightVNC-1.3.10
    25/01/20 21:25:19 Copyright (C) 2000-2009 TightVNC Group
    25/01/20 21:25:19 Copyright (C) 1999 AT&T Laboratories Cambridge
    25/01/20 21:25:19 All Rights Reserved.
    25/01/20 21:25:19 See http://www.tightvnc.com/ for information on TightVNC
    25/01/20 21:25:19 Desktop name 'X' (Ubuntu-server:1)
    25/01/20 21:25:19 Protocol versions supported: 3.3, 3.7, 3.8, 3.7t, 3.8t
    25/01/20 21:25:19 Listening for VNC connections on TCP port 5901
    Font directory '/usr/share/fonts/X11/75dpi/' not found - ignoring
    Font directory '/usr/share/fonts/X11/100dpi/' not found - ignoring
    gnome-session-binary[2658]: DEBUG(+): Enabling debugging
    gnome-session-binary[2658]: DEBUG(+): hardware acceleration check is disabled
    gnome-session-binary[2658]: DEBUG(+): Using systemd for session tracking
    gnome-session-binary[2658]: DEBUG(+): GsmManager: setting client store 0x56286684db70
    gnome-session-binary[2658]: DEBUG(+): GsmXsmpServer: SESSION_MANAGER=local/Ubuntu-server:@/tmp/.ICE-unix/2658,unix/Ubuntu-server:/tmp/.ICE-unix/2658
    
    gnome-session-binary[2658]: DEBUG(+): emitting SessionIsActive
    gnome-session-binary[2658]: DEBUG(+): fill: *** Getting session 'gnome-flashback-metacity'
    gnome-session-binary[2658]: DEBUG(+): fill: *** Looking if /home/dev/.config/gnome-session/sessions/gnome-flashback-metacity.session is a valid session file
    gnome-session-binary[2658]: DEBUG(+): Cannot use session '/home/dev/.config/gnome-session/sessions/gnome-flashback-metacity.session':
    

    Im quite new to linux and ubuntu, and working with my ubuntu box headless via a windows laptop

    Can anyone help?

    Cheers

  • tedder42
    tedder42 about 4 years
    What does this even mean? Where were you when you said "log in directly" .. on the headless machine's head? Via SSH?
  • Fountain
    Fountain about 4 years
    sorry yes thats what I had to do plug a monitor keyboard mouse into the box. log into session flashback. log out. then it worked fine via vnc
  • Ingo Karkat
    Ingo Karkat over 3 years
    Thanks. I had this problem with Ubuntu 16.04 and Gnome classic. The xstartup simply tried to launch /etc/X11/Xsession, and this resulted in the grey-only screen in VNC. I had to add everything from your answer starting with the export XDG_CURRENT_DESKTOP="GNOME-Flashback:Unity" line, and then it worked flawlessly.
  • user2279952
    user2279952 about 3 years
    This also worked for me! I had to install autocutsel, but after I did and added these lines to my ~/.vnc/xstartup, I was able to log into with my VNC client to the remote host without issue.
  • Wingpad
    Wingpad about 2 years
    This is hands down the most painless xstartup script I've found yet. Thank you kindly.