- Install CentOS 8 in a VM
- Add a repo for systemd with networkd support
vi /etc/yum.repos.d/systemd-networkd.repo
[systemd-networkd]
name=systemd-networkd
baseurl=https://people.redhat.com/~jsynacek/systemd/systemd-rebuild-networkd/rhel-8.dev-x86_64/
gpgcheck=0
enabled =0
- Downgrade systemd to the one with networkd support
dnf --enablerepo=systemd-networkd --disablerepo=BaseOS -y downgrade systemd
- Symlink dracut
ln -s /usr/bin/dracut /sbin/dracut
- Install mdraid module
dnf -y install libblockdev-mdraid
- Install additional repositories (optional)
dnf -y install epel-release centos-release-stream
- Set SELinux to permissive
sed -i 's/SELINUX=enforcing/SELINUX=permissive/g' /etc/sysconfig/selinux
- Reboot
- Tar the system, minus
/dev
, /proc
and /sys
cd /; tar zcvf Centos-80-64-boot.tar.gz /bin /boot /etc /home /lib /lib64 /media /mnt /opt /root /run /sbin /srv /tmp /usr /var
- Boot the Hetzner box into rescue mode and scp the tar file to /root
- Run the
installimage
script
- Choose
Custom image
option
- Configure the settings for your VM (hostname, partitioning)
- At the bottom, behind
IMAGE
put /root/Centos-80-64-boot.tar.gz
- Press F10 to quit and save, the image will automatically be installed.
- Auto-relabel the entire filesystem for SELinux on the next reboot
touch /.autorelabel
- Clean up the systemd-networkd repo and update the system
rm -rf /etc/yum.repos.d/systemd-networkd.repo
dnf -y update
- Set the correct timezone
rm -rf /etc/localtime
ln -s /usr/share/zoneinfo/<Zone>/<Location> /etc/localtime
- Reboot (relabel will make this take a bit longer than usual)
- Put SELinux back in enforcing mode
setenforce 1
sed -i 's/SELINUX=permissive/SELINUX=enforcing/g' /etc/sysconfig/selinux
- Fix IPv6 connection (and change the connection name)
nmcli con edit "Wired connection 1"
set connection.id <shorter name>
set ipv6.addresses <your ipv6 prefix>::1/64
set ipv6.gateway fe80::1
set ipv6.addr-gen-mode eui64
save
quit
nmcli networking off; nmcli networking on