Categories
Development Linux Ubuntu

(Ubuntu 18.04LTS) VNC connection results in grey screen, but nautilus works

Firstly I have installed the following packages:

sudo apt-get install --no-install-recommends ubuntu-desktop gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal

Then I configured ~/.vnc/xstartup as:

# 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 &

After connection, my VNCVIEWER only shows grey desktop (but nautilus works), and the log file shows:

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   

Sun Jan 12 21:11:02 2020                                                                                                                                     
vncext:      VNC extension running!                                                                                                                         
vncext:      Listening for VNC connections on port 5909                                                                                                     
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/yij/.vnc/xstartup: 19: /home/yij/.vnc/xstartup: gnome-settings-daemon: not found                                                                      
xkbcommon: ERROR: xkb_x11_keymap_new_from_device: illegal device ID: -1                                                                                     
xkbcommon: ERROR: xkb_x11_state_new_from_device: illegal device ID: -1                                                                                      
** (gnome-panel:20765): WARNING **: 21:11:05.339: Failed to request name: the name already has an owner                                                     
metacity-Message: 21:11:05.373: could not find XKB extension.                                                                                                                                                                                                                                                             

(metacity:20767): metacity-WARNING **: 21:11:05.376: Failed to create MetaCompositorXRender: Missing composite extension required for compositing           
Traceback (most recent call last):                                                                                                                            
File "/usr/bin/x-terminal-emulator", line 47, in <module>                                                                                                      import terminatorlib.optionparse                                                                                                                          
File "/usr/share/terminator/terminatorlib/optionparse.py", line 23, in <module>                                                                                from util import dbg, err                                                                                                                                 
File "/usr/share/terminator/terminatorlib/util.py", line 20, in <module>                                                                                       import cairo                                                                                                                                              
File "/usr/lib/python3/dist-packages/cairo/__init__.py", line 1, in <module>                                                                                   from ._cairo import *  # noqa: F401,F403                                                                                                                
ImportError: No module named _cairo                                                                                                                         
Error in sys.excepthook:                                                                                                                                    
Traceback (most recent call last):                                                                                                                            
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook                                                                     from apport.fileutils import likely_packaged, get_recent_crashes                                                                                          
File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>                                                                                  from apport.report import Report                                                                                                                          
File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>                                                                                   import apport.fileutils                                                                                                                                   
File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>                                                                                from apport.packaging_impl import impl as packaging                                                                                                       
File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 24, in <module>                                                                          
import apt                                                                                                                                                
File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>                                                                                   
import apt_pkg                                                                                                                                          
ImportError: No module named apt_pkg                                                                                                                                                                                                                                                                                     
Original exception was:                                                                                                                                     
Traceback (most recent call last):                                                                                                                            
File "/usr/bin/x-terminal-emulator", line 47, in <module>                                                                                                     
import terminatorlib.optionparse                                                                                                                          
File "/usr/share/terminator/terminatorlib/optionparse.py", line 23, in <module>                                                                               
from util import dbg, err                                                                                                                                 
File "/usr/share/terminator/terminatorlib/util.py", line 20, in <module>                                                                                      
import cairo                                                                                                                                              
File "/usr/lib/python3/dist-packages/cairo/__init__.py", line 1, in <module>                                                                                  
from ._cairo import *  # noqa: F401,F403                                                                                                                
ImportError: No module named _cairo                                                                                                                         
Nautilus-Share-Message: 21:11:05.874: Called "net usershare info" but it failed:
Failed to execute child process “net” (No such file or directory)  

Please tell me what should I do?

Leave a Reply

Your email address will not be published. Required fields are marked *