Raja's Exocortex

Ubuntu Desktop Disable Graphics (X11) on Boot

If KasmVNC is used to publish Ubuntu Desktops over the network via VNC, the KasmVNC service will launch its own X11 instance with full fledged desktop environment.

The the console graphics can be disabled to save CPU/RAM if the user connects to the Ubuntu Desktop only via KasmVNC. By default Ubuntu Desktop will boot into X11 graphics on the console and two X11 servers will run (console and KasmVNC) and consume additional CPU/RAM.

root@ubuntu:~# systemctl get-default
graphical.target

root@ubuntu:~# systemctl set-default multi-user.target
Created symlink /etc/systemd/system/default.target โ†’ /lib/systemd/system/multi-user.target.

# reboot and test

Steps to Disable Graphics on Boot

root@ubuntu:~# systemctl get-default
graphical.target

root@ubutu:~# systemctl list-units --type=target
  UNIT                    LOAD   ACTIVE SUB    DESCRIPTION
  basic.target            loaded active active Basic System
  cryptsetup.target       loaded active active Local Encrypted Volumes
  getty-pre.target        loaded active active Preparation for Logins
  getty.target            loaded active active Login Prompts
  graphical.target        loaded active active Graphical Interface
  local-fs-pre.target     loaded active active Preparation for Local File Systems
  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 Preparation for Network
  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 Path Units
  remote-fs.target        loaded active active Remote File Systems
  slices.target           loaded active active Slice Units
  snapd.mounts-pre.target loaded active active Mounting snaps
  snapd.mounts.target     loaded active active Mounted snaps
  sockets.target          loaded active active Socket Units
  sound.target            loaded active active Sound Card
  swap.target             loaded active active Swaps
  sysinit.target          loaded active active System Initialization
  time-set.target         loaded active active System Time Set
  timers.target           loaded active active Timer Units
  veritysetup.target      loaded active active Local Verity Protected Volumes

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.
25 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.

root@ubuntu:~# systemctl set-default multi-user.target
Created symlink /etc/systemd/system/default.target โ†’ /lib/systemd/system/multi-user.target.

root@ubuntu:~# systemctl get-default
multi-user.target

References:

  1. Managing systemd targets with systemctl