Enabling Cgroup v2 on Ubuntu (22.04 / 24.04)

Steps to enable cgroup v2 on Ubuntu 22.04 and 24.04 if the system has been switched to cgroup v1.

Default Status: Cgroup v2 is enabled natively and set as the default unified hierarchy out-of-the-box on Ubuntu 22.04 and 24.04.

Follow the steps below only if cgroup v1 was manually configured or reverted on your system.

  1. Open the GRUB configuration file with root privileges:
    sudo nano /etc/default/grub
  2. Locate the GRUB_CMDLINE_LINUX_DEFAULT line. Remove any parameters disabling cgroup v2 (such as systemd.unified_cgroup_hierarchy=0), then append the unified hierarchy parameter:
    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash systemd.unified_cgroup_hierarchy=1 cgroup_no_v1=all"
  3. Update the GRUB bootloader configuration:
    sudo update-grub
  4. Reboot the host system:
    sudo reboot
  5. After the system restarts, verify that cgroup v2 is active by running:
    stat -fc %T /sys/fs/cgroup/
    The output should display cgroup2fs, confirming that cgroup v2 is active.