How to Fix Failed to Start Set Console Font in Ubuntu

Reviewing failed system units using systemctl --failed on an Ubuntu server or desktop system frequently reveals console-setup.service: Failed with result 'exit-code' or Failed to start Set console font and keymap. While graphical desktop sessions usually start normally, this failure indicates that systemd was unable to initialise virtual TTY terminal fonts and keyboard layouts during boot.

Why Does console-setup.service Fail in Ubuntu?

The console-setup service configures virtual text consoles (TTY1 through TTY6) according to settings stored in /etc/default/console-setup:

  • Race Conditions During Early Boot: The service attempts to apply font parameters to virtual consoles before the kernel framebuffer driver (e.g. drm or i915) has fully initialised.
  • Missing Font Packages or Broken Paths: Configuration files referencing a font file (such as Uni2-Terminus16.psf.gz) that was uninstalled or moved.
  • Headless Cloud Server Environment: Running Ubuntu inside a minimal cloud VPS container (KVM/LXC) that lacks physical video console hardware endpoints.
  • Keyboard Layout Misconfigurations: Malformed UTF-8 characters or invalid keyboard codes inside /etc/default/keyboard.

1. Inspect Detailed systemd Failure Diagnostics

Examine the exact exit status of the console setup unit.

sudo systemctl status console-setup.service

To inspect the relevant journal log entries from the boot sequence:

sudo journalctl -u console-setup.service -b --no-pager

Common messages include loadkeys: /etc/console-setup/cached.kmap.gz: No such file or setfont: KDFONTOP: Function not implemented.

2. Reconfigure Console Setup and Regenerate Keymaps

Re-running the configuration wizard regenerates clean font caches and default keymaps.

  1. Reconfigure the console font utility:
    sudo dpkg-reconfigure console-setup
  2. Choose the default encoding (UTF-8).
  3. Select Combined – Latin; Slavic and Greek.
  4. Choose standard font type (such as VGA or Terminus) and select size 16.
  5. Regenerate keyboard mappings:
    sudo dpkg-reconfigure keyboard-configuration

3. Rebuild cached.kmap.gz File

If the error references a missing cached keyboard map, re-executing the setup scripts constructs the missing binary.

sudo setupcon --save

The --save flag writes the active font and keyboard definitions directly to /etc/console-setup/cached.kmap.gz and cached.psf.gz, eliminating startup read errors.

4. Mask the Service on Headless Cloud Instances (Optional)

If running Ubuntu on a remote cloud server (AWS, DigitalOcean, or Hetzner) managed solely via SSH, physical console font services are redundant.

  1. Confirm that the server is accessed exclusively via SSH.
  2. Disable and mask the console setup unit:
    sudo systemctl mask console-setup.service
  3. Confirm that systemctl --failed no longer reports any degraded services.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.