2

Every few weeks/months the kernel on my Ubuntu 16.04.3 (x86_64) installation is automatically updated. That's fine, except that the corresponding kernel headers are not automatically installed at the same time and so the VirtualBox kernel modules are not rebuilt automatically. I have to manually do:

sudo apt-get install linux-headers-`uname -r`

in order to trigger the rebuild. (I got that command from the answer to: VirtualBox '/etc/init.d/vboxdrv setup' issue)

How can I arrange for the linux headers to be automatically updated as well? Or, alternatively, how can I ensure that the VirtualBox modules are automatically rebuilt when the kernel is upgraded?

I have the linux-headers-generic package installed as suggested in the answer to How to get Software Update to automatically grab kernel source along with kernel update?:

$ sudo apt-get install linux-headers-generic
Reading package lists... Done
Building dependency tree       
Reading state information... Done
linux-headers-generic is already the newest version (4.4.0.96.101).
linux-headers-generic set to manually installed.

Edited to add: The output of uname -a is

Linux riemann 4.10.0-35-generic #39~16.04.1-Ubuntu SMP Wed Sep 13 09:02:42 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
saf
  • 35
  • 1
  • 5

1 Answers1

2

Most likely the meta linux-headers-generic-hwe-16.04 is not installed.

The linux-headers-generic is installing headers for the 4.4 kernel, but you are using a HWE kernel, like 4.10.

Run

sudo apt install linux-headers-generic-hwe-16.04

and you should get headers updates.

Pilot6
  • 90,100
  • 91
  • 213
  • 324
  • Thanks - that package certainly wasn't installed, so I've installed it now. I'll wait until the next automated kernel upgrade happens to check that this has fixed it before I accept this answer. Fingers crossed... – saf Sep 22 '17 at 21:21
  • Worked a treat - I just rebooted and have a new kernel (4.10.0-37-generic) and virtualbox still started without any manual intervention. Thanks! – saf Nov 01 '17 at 22:17