Fedora 31: "Please install the Linux kernel "header" files matching the current kernel for adding new hardware support to the system" in VirtualBox

I found an article for you to help install guest additions.

https://www.tecmint.com/install-virtualbox-guest-additions-in-fedora/

The first step in the installation of VirtualBox guest additions is the installation of kernel headers. This includes the installation of the dkms package (Dynamic Kernel Module Support) alongside other build tools as shown.

$ sudo dnf install dkms kernel-devel gcc bzip2 make curl

Once you have successfully installed kernel headers, you need to confirm the version of the Linux kernel and ensure it matches the version of the just installed kernel headers.

To check the version of the Linux kernel run the command.

$ uname -r OR $ hostnamectl | grep -i kernel

To check the version of the kernel development tool (kernel-devel) execute.

$ sudo rpm -qa kernel-devel

Verify Linux Kernel Headers Verify Linux Kernel Headers

If the versions of the two (kernel version and kernel-devel) do not match as shown in the screenshot above, update the kernel using the command.

$ sudo dnf update kernel-*

When you are done updating the kernel, reboot the system, and again, verify the kernel version again.

$ uname -r

That has worked for you. Many thanks, @John