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.
-
Open the GRUB configuration file with root privileges:
sudo nano /etc/default/grub -
Locate the
GRUB_CMDLINE_LINUX_DEFAULTline. Remove any parameters disabling cgroup v2 (such assystemd.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" -
Update the GRUB bootloader configuration:
sudo update-grub -
Reboot the host system:
sudo reboot -
After the system restarts, verify that cgroup v2 is active by running:
stat -fc %T /sys/fs/cgroup/The output should displaycgroup2fs, confirming that cgroup v2 is active.
