4

I am trying to install the Idera (R1soft) linux agent on a Linode running Ubuntu 12.04LTS. The agent requires a driver which in turn requires the kernel headers. Linode uses custom kernels though so the kernel headers I want are not in the apt-get repositories for ubuntu.

To the best of my knowledge linode tracks mainline so I logged into linode and changed my kernel from "latest" to a static version so it would not change on me on future reboots. Then I downloaded that version of the linux source from kernel.org and dropped it in /lib/modules. I pointed the agent install process at that directory but its still complaining it cannot find the headers.

Should I be downloading a different package that only includes header files? Are the headers a subfolder of the linux source? Am I just horribly off base in what I am trying to do here?

root@li372-176:~# serverbackup-setup --get-module --kernel-dir /lib/modules/linux-3.13.7
Checking if module needs updated
Checking for binary module
Waiting                       |
No binary module found
Gathering kernel information
Gathering kernel information complete.
Creating kernel headers package
Checking '/lib/modules/linux-3.13.7' for kernel headers
Unable to find a '.config'. This file is required to build a kernel module
Unable to find a valid source directory.
Please install the kernel headers for your operating system.
To install kernel headers execute:
apt-get install linux-headers-`uname -r`
  • on my distro of choice, you get the headers through the kernel-devel package. Kernel Headers are, well, Kernel Headers. It's the API the kernel uses... i doubt Linode has changed the Headers, maybe the source (the .c files), but if they did change them, then it's likely it was changed very little. -- (this is probably best asked on the Linux/UNIX exchange though, not a server issue, it's a linux issue). – SnakeDoc May 2 '14 at 22:23
  • 1
    In summary, I think you are over-complicating this for yourself. Just snapshot your VM, then install the kernel-devel package for the currently running kernel version. – SnakeDoc May 2 '14 at 22:32
  • 1
    There is no kernel-devel package in 12.04LTS. To get the headers you normally install linux-headers-$uname -r but this package does not exist for Linode VPS's since linode uses its own custom kernels. Presumably because they use PV and need custom kernels. I can install linux-headers-generic which installs 3.2.0-61-generic but the Linode kernel is 3.13.7 on this particular server. I was not sure if the API changed at all between these versions and if it was safe to point the compile process at the 3.2.0-61-generic folder or not. – digitaladdictions May 3 '14 at 0:48
  • For what its worth I did just compile it against the 3.2.0-61-generic headers and it seemed to work. I still would like some confirmation that this is a safe thing to be doing on a production server. – digitaladdictions May 3 '14 at 1:29
  • well, you could try downloading the tar.gz of the 3.13.7 kernel from kernel.org, unpack it and point ur program at it for the headers. they should be in the include directory. Linode has probably just custom compiled for PV like you mentioned. Xen hypervisor has it's own custom kernel's too, and that's the major difference between vanilla and the "custom" versions. – SnakeDoc May 3 '14 at 1:31
3

This is old and has long since been solved but I just logged in for the first time in a long time and noticed it has no answer so I am providing one to add closure.

In order to install the r1soft kernel module or any kernel module on a linode you need to boot the linode from its own distribution supplied kernel not the shared (default) pv kernel. Even if you had the right headers you would not be able to load the module since this is a shared kernel that lives outside of your linode.

The short answer is to install the distribution kernel using your package manager, reconfigure grub to point at the kernel, configure the profile for your linode to boot using either pv-grub (xen) or GRUB2 (kvm), and reboot.

The following two articles detail how to do this in detail on a xen and kvm linode.

https://www.linode.com/docs/tools-reference/custom-kernels-distros/run-a-distributionsupplied-kernel-with-pvgrub

https://www.linode.com/docs/tools-reference/custom-kernels-distros/run-a-distribution-supplied-kernel-with-kvm

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.