How to disable GUI on boot in 18.04 (Bionic Beaver)?

Solution 1:

To disable GUI on boot, run:

sudo systemctl set-default multi-user.target

To enable GUI again issue the command:

sudo systemctl set-default graphical.target

To start Gnome session on a system without a current GUI just execute:

sudo systemctl start gdm3.service

Solution 2:

To answer @nurp's comment

The screen is now pretty small in VirtualBox .

  1. update your /etc/default/grub accordingly:

    GRUB_CMDLINE_LINUX_DEFAULT="nomodeset"
    GRUB_GFXMODE=1152x864x32
    GRUB_GFXPAYLOAD_LINUX=1152x864x32
    
  2. run sudo update-grub.

    • nomodeset so that the kernel does not attempt changing the resolution set by GRUB.
    • GRUB_GFXPAYLOAD_LINUX if this variable is set, it controls the video mode in which the Linux kernel starts up, replacing the ‘vga=’ boot option.

References

  • https://www.gnu.org/software/grub/manual/grub/html_node/gfxpayload.html