When I try to view a ubuntu machine via VNC, I get a grey screen with 3 checkboxes . I have tried some suggestions I read online but one doesn't help. One still gives me the grey screen with 3 checkboxes, one gives me the grey screen without the three checkboxes, and one gives me a grid! That's following various suggestions on how to amend vnc's xstartup file. Further elaboration below.
I have a computer with Ubuntu 18.03.3 LTS running off USB. It gave two options, 'try ubuntu' and 'install ubuntu' I chose 'try ubuntu'.
$lsb_release -a
shows I am on Ubuntu 18.04.03 LTS
I saw this article and used these commands to install vnc server
$ sudo apt-get install --no-install-recommends ubuntu-desktop gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal gnome-core
$ sudo apt-get install vnc4server
This shows my xstartup file
buntu@ubuntu:~/.vnc$ cat xstartup
#!/bin/sh
# 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 &
ubuntu@ubuntu:~/.vnc$
I think that's the default one.. I get the same error as mentioned
VNC grey screen and start on boot 12.04
and
vncserver grey screen ubuntu 16.04 LTS
and
But the solutions there don't work for me, as i'll explain.
I get a grey screen with 3 checkboxes.
Here see I start the vnc server (and I include some other commands I used, to list processes, as any time i'd change xstartup i'd see if the server was running, and kill it and start it again). And I checked that it is running and on what port, port 5901. And that it's not blocked by the firewall ubuntu uses by default.. ufw, I see from ufw status
that the ufw firewall is not enabled so no issue there. vnc server has started.
ubuntu@ubuntu:~/.vnc$ ps
PID TTY TIME CMD
6065 pts/0 00:00:00 bash
15274 pts/0 00:00:00 ps
ubuntu@ubuntu:~/.vnc$ cat xstartup
#!/bin/sh
# 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 &
ubuntu@ubuntu:~/.vnc$ vnc4server
New 'ubuntu:1 (ubuntu)' desktop is ubuntu:1
Starting applications specified in /home/ubuntu/.vnc/xstartup
Log file is /home/ubuntu/.vnc/ubuntu:1.log
ubuntu@ubuntu:~/.vnc$ ps
PID TTY TIME CMD
6065 pts/0 00:00:00 bash
15287 pts/0 00:00:00 Xvnc4
15293 pts/0 00:00:00 vncconfig
15303 pts/0 00:00:00 ps
ubuntu@ubuntu:~/.vnc$ lsof | grep LISTEN
lsof: WARNING: can't stat() tracefs file system /sys/kernel/debug/tracing
Output information may be incomplete.
Xvnc4 15287 ubuntu 0u IPv4 295628 0t0 TCP *:x11-1 (LISTEN)
Xvnc4 15287 ubuntu 3u IPv6 295630 0t0 TCP *:5901 (LISTEN)
ubuntu@ubuntu:~/.vnc$ ufw status
ERROR: You need to be root to run this script
ubuntu@ubuntu:~/.vnc$ sudo ufw status
Status: inactive
ubuntu@ubuntu:~/.vnc$
I also run the ip add
command to see my IP.
I then go to my other machine which runs windows and I enter the IP:5901 and enter the correct password and the password was accepted.
and I get this grey screen with three checkboxes "accept clipboard from viewers", "send clipboard to viewers", "send primary selection to viewers"
I make amendments based on the first link vnc-grey-screen (172384),but get same grey screen same three checkboxes, that's with
ubuntu@ubuntu:~/.vnc$ echo https://askubuntu.com/questions/172384/vnc-grey-screen-and-start-on-boot-12-04
https://askubuntu.com/questions/172384/vnc-grey-screen-and-start-on-boot-12-04
ubuntu@ubuntu:~/.vnc$ cat xstartup
#!/bin/sh
# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
#exec /etc/X11/xinit/xinitrc
gnome-session --session=gnome-classic &
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
#x-terminal-emulator -geometry 1280x1024+10+10 -ls -title "$VNCDESKTOP Desktop" &
#x-window-manager &
ubuntu@ubuntu:~/.vnc$ ps
PID TTY TIME CMD
6065 pts/0 00:00:00 bash
15287 pts/0 00:00:00 Xvnc4
15293 pts/0 00:00:00 vncconfig
15572 pts/0 00:00:00 ps
ubuntu@ubuntu:~/.vnc$ killall Xvnc4
ubuntu@ubuntu:~/.vnc$ ps
PID TTY TIME CMD
6065 pts/0 00:00:00 bash
15575 pts/0 00:00:00 ps
ubuntu@ubuntu:~/.vnc$ vnc4server
New 'ubuntu:1 (ubuntu)' desktop is ubuntu:1
Starting applications specified in /home/ubuntu/.vnc/xstartup
Log file is /home/ubuntu/.vnc/ubuntu:1.log
ubuntu@ubuntu:~/.vnc$
I then try an xstartup with what is in the second ubuntu link (vncserver-grey-screen - 800302)
ubuntu@ubuntu:~/.vnc$ vi xstartup
ubuntu@ubuntu:~/.vnc$ echo https://askubuntu.com/questions/800302/vncserver-grey-screen-ubuntu-16-04-lts
https://askubuntu.com/questions/800302/vncserver-grey-screen-ubuntu-16-04-lts
ubuntu@ubuntu:~/.vnc$ cat 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 &
ubuntu@ubuntu:~/.vnc$ ps
PID TTY TIME CMD
6065 pts/0 00:00:00 bash
15710 pts/0 00:00:00 ps
ubuntu@ubuntu:~/.vnc$ vnc4server
New 'ubuntu:1 (ubuntu)' desktop is ubuntu:1
Starting applications specified in /home/ubuntu/.vnc/xstartup
Log file is /home/ubuntu/.vnc/ubuntu:1.log
ubuntu@ubuntu:~/.vnc$
and i get a grey screen though this time with no checkboxes
I then attempt a third solution
one suggestion says make sure the permissions of the xstartup file are 755, mine are, another says to uncomment the following two lines:
unset SESSION MANAGER
exec /etc/X11/xinit/xinitrc
doing that (and of course killing and starting the vnc server) $killall Xvnc4<ENTER>
and $vnc4server<ENTER>
I get this screen when trying to connect, it's like a grid
Added
I heard a suggestion to try looking at the log file /home/ubuntu/.vnc/ubuntu:1.log
ubuntu@ubuntu:~/.vnc$ cat ubuntu:1.log
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
Tue Feb 4 21:56:29 2020
vncext: VNC extension running!
vncext: Listening for VNC connections on port 5901
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!
Tue Feb 4 21:56:39 2020
Connections: accepted: 0.0.0.0::62323
SConnection: Client needs protocol version 3.8
SConnection: Client requests security type VncAuth(2)
Tue Feb 4 21:56:43 2020
VNCSConnST: Server default pixel format depth 16 (16bpp) little-endian rgb565
VNCSConnST: Client pixel format depth 6 (8bpp) rgb222
Tue Feb 4 21:56:44 2020
VNCSConnST: Client pixel format depth 16 (16bpp) little-endian rgb565
ubuntu@ubuntu:~/.vnc$
I also found this suggestion https://stackoverflow.com/questions/51415427/whats-wrong-with-my-vncserver-setting that gives a grey screen with no checkboxes..
I heard a suggestion to try this xstartup file , in particular that the lines 14-17 might be helpful https://www.linode.com/docs/applications/remote-desktop/install-vnc-on-ubuntu-18-04/
So I used the whole xstartup file there, as i'd changed my xstartup file quite a bit.
I got a grey screen with no checkboxes, and the log says
ubuntu@ubuntu:~/.vnc$ cat ubuntu\:1.log
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
Tue Feb 4 23:10:06 2020
vncext: VNC extension running!
vncext: Listening for VNC connections on port 5901
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/ubuntu/.vnc/xstartup: 15: /home/ubuntu/.vnc/xstartup: gnome-settings-daemon: not found
** (gnome-panel:16733): WARNING **: 23:10:09.203: Failed to request name: the name already has an owner
xkbcommon: ERROR: xkb_x11_keymap_new_from_device: illegal device ID: -1
xkbcommon: ERROR: xkb_x11_state_new_from_device: illegal device ID: -1metacity-Message: 23:10:09.279: could not find XKB extension.
(metacity:16735): metacity-WARNING **: 23:10:09.285: Failed to create MetaCompositorXRender: Missing composite extension required for compositing
# Failed to parse arguments: Unknown option --login
Tue Feb 4 23:10:17 2020
Connections: accepted: 0.0.0.0::63052
SConnection: Client needs protocol version 3.8
SConnection: Client requests security type VncAuth(2)
Tue Feb 4 23:10:20 2020
VNCSConnST: Server default pixel format depth 16 (16bpp) little-endian rgb565
VNCSConnST: Client pixel format depth 6 (8bpp) rgb222
VNCSConnST: Client pixel format depth 16 (16bpp) little-endian rgb565
Tue Feb 4 23:10:25 2020
Connections: closed: 0.0.0.0::63052 (Clean disconnection)
SMsgWriter: framebuffer updates 3
SMsgWriter: raw rects 1, bytes 16396
SMsgWriter: ZRLE rects 3, bytes 304
SMsgWriter: raw bytes equivalent 2375888, compression ratio 142.268743
ubuntu@ubuntu:~/.vnc$