Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
How to make CGroupsV1 as default in Fedora 31 Server?

How to make CGroupsV1 as default in Fedora 31?

CGroupsV2 as default in Fedora 31 Server. We change it and can assign CGroupV1 as default using the below line in kernel command line.

systemd.unified_cgroup_hierarchy=0

Steps

sudo vim /etc/default/grub
# Add 'systemd.unified_cgroup_hierarchy=0' in kernel command line. It will look like below
GRUB_CMDLINE_LINUX="resume=/dev/mapper/vv-swap rd.lvm.lv=vv/root rd.lvm.lv=vv/swap rhgb quiet intel_iommu=on systemd.unified_cgroup_hierarchy=0"
# Run below command after add it. The below 'grub.cfg' location is only of UEFI. Don't use this for Legacy BIOS.
sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
sudo reboot

How to test it?

# Run 'sudo virt-host-validate' to check. If all the items are 'PASS', it is working fine. 'Fuse' module may FAIL. It should be load manually.
sudo virt-host-validate 
  QEMU: Checking for hardware virtualization                                 : PASS
  QEMU: Checking if device /dev/kvm exists                                   : PASS
  QEMU: Checking if device /dev/kvm is accessible                            : PASS
  QEMU: Checking if device /dev/vhost-net exists                             : PASS
  QEMU: Checking if device /dev/net/tun exists                               : PASS
  QEMU: Checking for cgroup 'cpu' controller support                         : PASS
  QEMU: Checking for cgroup 'cpuacct' controller support                     : PASS
  QEMU: Checking for cgroup 'cpuset' controller support                      : PASS
  QEMU: Checking for cgroup 'memory' controller support                      : PASS
  QEMU: Checking for cgroup 'devices' controller support                     : PASS
  QEMU: Checking for cgroup 'blkio' controller support                       : PASS
  QEMU: Checking for device assignment IOMMU support                         : PASS
  QEMU: Checking if IOMMU is enabled by kernel                               : PASS
   LXC: Checking for Linux >= 2.6.26                                         : PASS
   LXC: Checking for namespace ipc                                           : PASS
   LXC: Checking for namespace mnt                                           : PASS
   LXC: Checking for namespace pid                                           : PASS
   LXC: Checking for namespace uts                                           : PASS
   LXC: Checking for namespace net                                           : PASS
   LXC: Checking for namespace user                                          : PASS
   LXC: Checking for cgroup 'cpu' controller support                         : PASS
   LXC: Checking for cgroup 'cpuacct' controller support                     : PASS
   LXC: Checking for cgroup 'cpuset' controller support                      : PASS
   LXC: Checking for cgroup 'memory' controller support                      : PASS
   LXC: Checking for cgroup 'devices' controller support                     : PASS
   LXC: Checking for cgroup 'freezer' controller support                     : PASS
   LXC: Checking for cgroup 'blkio' controller support                       : PASS
   LXC: Checking if device /sys/fs/fuse/connections exists                   : PASS

Reference

https://fedoraproject.org/wiki/Changes/CGroupsV2 https://www.linuxuprising.com/2019/11/how-to-install-and-use-docker-on-fedora.html https://medium.com/nttlabs/cgroup-v2-596d035be4d7 https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/ECXXG7WRYROXLYFM672ISAU5KTAP2ISO/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment