[HOW-TO] Proxmox 7 cgroupv2 - Centos 7 upgrade systemd without systemd.unified_cgroup_hierarchy=0

timonych

Well-Known Member
Aug 8, 2017
62
17
48
33
Hi Everyone!

I have found an easy workaround how upgrade Centos 7 systemd without modify grub and without reboot host.

So, You should do a few steps.

Disclaimer 1, it's HIGHLY recommended to switch to modern distr which has actual systemd with natively support cgroup v2!!!!

Disclaimer 2, all examples is directed to modify container with ID 100, LVM storage and volume group VG-IMAGES

1. Making dir for mount

Bash:
mkdir -p /mnt/virtual100

2. Mount a container base image.
Bash:
mount /dev/vg-images/vm-100-disk-0 /mnt/virtual100

3. Mount neccessary DEV, PROC, SYS to container
Bash:
mount --bind /dev/ /mnt/virtual100/dev
mount --bind /dev/pts /mnt/virtual100/dev/pts
mount --bind /proc /mnt/virtual100/proc
mount --bind /sys /mnt/virtual100/sys

4. Entering to container via chroot
Bash:
chroot /mnt/virtual100

5. Download repo with systemd with cgroup v2
Bash:
wget https://copr.fedorainfracloud.org/coprs/jsynacek/systemd-backports-for-centos-7/repo/epel-7/jsynacek-systemd-backports-for-centos-7-epel-7.repo -O /etc/yum.repos.d/jsynacek-systemd-centos-7.repo

6. Update all packages to actual
Bash:
yum update

7. Exit from chroot and unmount DEV, PROC, SYS, Container Image
Bash:
exit
umount /dev/virtual100/dev/pts
umount /dev/virtual100/dev
umount /dev/virtual100/proc
umount /dev/virtual100/sys
umount /dev/virtual100

7. Start Your container
Bash:
pct start 100

1628606405514.png
1628606480161.png
 
Last edited:
Will this procedure make it possible to run Centos 7 in LXC containter under Proxmox 7?
 
Will this procedure make it possible to run Centos 7 in LXC containter under Proxmox 7?
Why not?

Contaier will be worked as before, but it's not recommended to use in PRODUCTION.

Bash:
Linux Oracle 5.11.22-5-pve #1 SMP PVE 5.11.22-10 (Tue, 28 Sep 2021 08:15:41 +0200) x86_64 x86_64 x86_64 GNU/Linux

1638349757504.png
1638349806503.png
 
Last edited:
By the way.

If You want to use this workaround for multiple containers in future - I'll recommend to make this only for one, mak backup of this container and after restore this backup like template (restore backup to another VMID)
 
Great HOW-TO!

Don't forget to unmount vm image before starting your container (maybe error in your last umount line?):

Bash:
umount /mnt/virtual100
 
Great HOW-TO!

Don't forget to unmount vm image before starting your container (maybe error in your last umount line?):

Bash:
umount /mnt/virtual100

Hi!

You are right, It's mistake, but I can't edit this :(
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!