Updated: April 3, 2026
After I encountered a networking issue in an Ubuntu-based virtual machine running kernel 6.8, I decided to run a little experiment. Let's set up the HWE stack, which ought to bring in a lot of new stuff, including the very modern kernel 6.17. Sounds good. I tried, and then, I got an error message that the VirtualBox service wasn't running anymore inside the guest operating system, ipso facto, I didn't have all the guest additions goodies anymore.
I tried to compile the drivers on the command line, and got an error that said: Something went wrong. Looking into the VirtualBox log, it looked as if VirtualBox could not find various kernel header files, even though the right package was installed and all that. Reading online, I found references that VirtualBox 7.1, which is the version running on the host, wasn't compatible with the new kernel. So, seemingly, an unsolvable problem. But it's not. Let me show you what I did, and what you can do.
Problem in more detail
All right, to continue my introduction, all the necessary tools are there. The build essential bundle, kernel headers, everything. But. My system is running VirtualBox guest additions that came with the program, i.e., the 7.1 bundle, which you can mount into the guest system (insert the ISO file), and then run the setup. The only problem is, this ISO is static, and does not include any new features or updates that would support the latest packages or kernels.
A solution? Upgrade VirtualBox to the latest edition, in this case 7.1 going to 7.2. But what if you cannot, for whatever reason, or if you encountered an issue with the newer version, as I have in my escapades? Well, in that case, you can use Ubuntu's own "powers" to resolve the problem. Funnily, it all always seems to come down to networking issues, cor.
Solution: use Guest Additions from the Ubuntu repos
You may not be aware of this, but Ubuntu's repositories include VirtualBox additions, both for X11 and Wayland desktops, and both for main and HWE kernels. This is another reason why you should consider Ubuntu as your primarily Linux distro, despite its many flaws. Therefore, we will remove the ISO-installed Guest Additions, install a new set from the archives, and that will give you the support you need for kernel 6.17.
First, remove the ISO drivers. Luckily, there's a dedicated command for that:
sudo vbox-uninstall-guest-additions
Without any reboot or anything, install the repo version:
sudo apt install virtualbox-guest-x11-hwe
There's also the non-X11 version if you need it, as well as the non-HWE version, regardless of the specific use case here. For your information, in Ubuntu 24.04, you have the following packages available, and psst: notice the wee inconsistency in the package naming, one with a period (full stop, dot character), and the rest without.
virtualbox-dkms - x86 virtualization solution - kernel module sources for dkms
virtualbox-ext-pack - extra capabilities for VirtualBox, downloader.
virtualbox-guest-additions-iso - guest additions iso image for VirtualBox
virtualbox-guest-utils-hwe - x86 virtualization solution - non-X11 guest utilities
virtualbox-guest-utils - x86 virtualization solution - non-X11 guest utilities
virtualbox-guest-x11-hwe - x86 virtualization solution - X11 guest utilities
virtualbox-guest-x11 - x86 virtualization solution - X11 guest utilities
virtualbox-qt - x86 virtualization solution - Qt based user interface
virtualbox-source - x86 virtualization solution - kernel module source
virtualbox - x86 virtualization solution - base binaries
As an aside, if you wonder how to install the new kernel, including the headers:
sudo apt install linux-generic-hwe-24.04
Restart, and now you should be running kernel 6.17, the guest additions (drivers) should be loaded and working correctly, and there ought to be no conflicts or compilation issues, regardless what host version of VirtualBox you use. Well, within reason, but you do gain a lot of flexibility.
Conclusion
Here you go. If you have a rather constrained system setup by which you want to use the new kernels, but you do encounter problems compiling them when running and using an older host version of VirtualBox and its set of ISO-provided Guest Additions, then you're in luck. You can work around the issue by removing these drivers, and using the bundle from the Ubuntu repositories. This way you will be able to keep up with the changes, and you won't be stuck on weird code errors. Works for X11 and non-X11 displays, plus both standard LTS and HWE kernels. Quite cushty. Ubuntu delivers, once more. Can it be simpler? Sure. Still good, though.
I was not happy that I had encountered the kernel setup snag, or rather, the Guest Additions snag, as the kernel was working correctly. But, problem rectified, there. I can happily report the new kernel 6.17 is quite good. Fast, responsive, and there are no networking issues. In fact, I'm so impressed that I will now check how this kernel behaves on my Slimbook Executive, a machine that has had lots and lots of problems with its software stack lately. That ought to be an interesting adventure, so stay tuned.
Cheers.