If you are encountering the error "Kernel headers not found for target kernel" while installing VirtualBox Guest Additions, the solution to resolve the issue is by installing kernel-devel package.

Open terminal and run command uname -r to list current linux kernel version:

uname -r

The output is similar to:

6.2.9-300.fc38.x86_64

Then install the kernel-devel package which matches the current linux kernel version:

sudo dnf install kernel-devel-6.2.9-300.fc38

When the installation is complete, go to directory where VirtualBox Guest Additions image file is mounted.

cd /run/media/$USER/VBox_GAs_7.0.8/

Then install the VirtualBox Guest Additions again

sudo ./VBoxLinuxAdditions.run

The error should disappear now.

VirtualBox Guest Additions

Then restart your system.

Fedora VM

If the Fedora guest still doesn't fit screen, try to resize the window.

Fedora VM
Fedora VM