Setup VNC

Introduction to setup VNC on Ubuntu 18.04.4 LTS

  1. Uninstall the Default Gnome Desktop

    $sudo apt remove gnome-shell
    $sudo apt remove gnome
    $sudo apt autoremove
    $sudo apt purge gnome
    $sudo apt autoclean
    $sudo apt clean
    
  2. Install TigerVNC

    $ sudo apt install xserver-xorg-core
    $ sudo apt install tigervnc-standalone-server tigervnc-xorg-extension tigervnc-viewer
    $ sudo apt-get install gsfonts-x11 xfonts-base xfonts-75dpi xfonts-100dpi
    
  3. Install Gnome 3 and start Gnome, configurate for start on boot

    $ sudo apt install ubuntu-gnome-desktop
    $ sudo systemctl start gdm
    $ sudo systemctl enable gdm
    
  4. Set VNC Server Password

    $ vncpasswd
    Password:
    Verify:
    Would you like to enter a view-only password (y/n)? y
    Password:
    Verify:
    
  5. Startup Script Settings

    $ vim ~/.vnc/xstartup
    #!/bin/sh 
    [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
    [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
    vncconfig -iconic &
    dbus-launch --exit-with-session gnome-session &
    
  6. Start VNC Server

    $ vncserver -localhost no -geometry 1920x950 -depth 24  
       
    
  7. Connect by VNC Viewer Download the vncviewer from realvnc and follow the instructions to

  8. Kill VNC Server

    $ vncserver -list
    $ vncserver -kill :1
    $ vncserver -kill :*