QEMU support for Centos 8 / RHEL 8

rcd

Active Member
Jul 12, 2019
245
23
38
62
I have a few Centos 6 VM's that need to be upgraded so I thought I'd just go straight to Centos 8 with those.

Installation was a lot of headache as support for network-scripts are being removed in Centos 8, and I had to learn how to set everything up with NetworkManager specific to my datacenter (OVH) who has a bit quirky setup, with gateway and such (those who use it will know what I mean).

Code:
# check if any devices exist
nmcli con show

# if there are any connections delete them with
nmcli con del device (device being teh name under DEVICE)

# add  new device -
# I call it eth0 because that's what my network devices used to be called. Feel free to use another name, but change accordingly further ahead
nmcli con add type ethernet con-name eth0 ifname ens18

# add ip, gateway, dns  - replace IP and GW with the IP address and gateway, and hostname of your choice.
#. I use 1.1.1.1 1.0.0.1 for dns but you can pick what you like.
nmcli con mod eth0 ipv4.address IP/32 gw4 GW
nmcli con mod eth0 ipv4.dns "1.1.1.1 1.0.0.1"
nmcli general hostname MYHOSTNAME

# disable ipv6 (unless you want to use it)
nmcli con mod eth0 ipv6.method "disabled"

# set ipv4 static (according to OVH not strictly necessary, but they don't support DHCP so I prefer to make it clear to avoid confusion)
nmcli con mod eth0 ipv4.method static

# activate the interface
nmcli con up eth0

# Check all
nmcli -p con show eth0

Anyway, that aside, I realized that although qemu-guest-agent (qemu-guest-agent-2.12.0-88.module_el8.1.0+297+df420408.3.x86_64) automatically had been installed with the base install, it wasn't active as evident on the PVE GUI.

After another couple of hours of Google and comparing to my Centos 7 servers, I found that while /usr/lib/systemd/system/qemu-guest-agent.service exist, a symlink from that to /etc/systemd/system/dev-virtiox2dports-org.qemu.guest_agent.0.device.wants/qemu-guest-agent.service was missing. I created that, but then found that a character device /dev/vport1p1 was also missing. I created it to be like in Centos 7 "mknod /dev/vport1p1 c 244 1", Finally stop and restart the VM (from Proxmox, not from the VM)

So here it is, boiled down to the essentials. You need to be root to do this stuff, you can add sudo before each line if you prefer, or just do it all as root.

Code:
# Make sure qemu-guest-agent has been installed, that you have attempted to start it, and you got an error about it being dead.

mknod 244  1 /dev/vport1p1
mkdir -p /etc/systemd/system/dev-virtio\x2dports-org.qemu.guest_agent.0.device.wants
ln -s /usr/lib/systemd/system/qemu-guest-agent.service  /etc/systemd/system/dev-virtio\x2dports-org.qemu.guest_agent.0.device.wants/qemu-guest-agent.service

I've only installed this one Centos 8 VM so far, so it could be something just went wrong with my installation, but a post I found on the Centos 8 forum suggest that it is a general problem that they appear to not be too much in a hurry to fix. So here it is, in case someone else run into this sometime in the future, with the hope that it may help them quickly get past it.
 
Last edited:
Thank you for the information. I experienced, that CentOS does stuff different than "real" enterprise distributions and therefore try to stay away from CentOS as possible or have workarounds (like this one) available.

Oracle Linux 8.2 does not have this problem and works out-of-the-box after installing. I haven't checked RHEL 8.2 yet, still downloading.
 
Thank you for the information. I experienced, that CentOS does stuff different than "real" enterprise distributions and therefore try to stay away from CentOS as possible or have workarounds (like this one) available.

Oracle Linux 8.2 does not have this problem and works out-of-the-box after installing. I haven't checked RHEL 8.2 yet, still downloading.

How are installing Oracle Linux 8.2 into a VM or Container?
 

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!