Getting kernel source

I am trying to install virtual box on a Linode, running: Ubuntu 12.04.5 LTS \n \l

In order to do this, I need the kernel source to be installed (so that the setup procedure for VB can build the kernel module).

I've tried various things, starting with "apt-get install linux-source" and "apt-get install linux-headers". Both seem to be stuck on thinking I want kernel version 3.2.something, but I am running 3.18.something.

One of the command I tried suggests installing "linux-headers-3.18.1-x86_64-linode50", which seems reasonable, but when I try:

apt-get install linux-headers-3.18.1-x86_64-linode50

I get:

apt-get install linux-headers-3.18.1-x86_64-linode50

Reading package lists… Done

Building dependency tree

Reading state information… Done

E: Unable to locate package linux-headers-3.18.1-x86_64-linode50

E: Couldn't find any package by regex 'linux-headers-3.18.1-x86_64-linode50'

#

So, where do I go from here?

I've done the usual "apt-get update" and "apt-get upgrade" incantations. is there something I need to add to my /etc/apt/sources.list file for this to work?

7 Replies

You can't install a Virtual system (virtualbox) ONTOP of a Virtual system (xen).

~~![](<URL url=)https://robinheyden.files.wordpress.com … mirror.jpg">https://robinheyden.files.wordpress.com/2011/02/mirror.jpg" />

**yes, there are exceptions, but not in this case.~~

That's one opinion. I await others.

http://unix.stackexchange.com/questions … r-xen-dom0">http://unix.stackexchange.com/questions/114759/can-virtualbox-run-under-xen-dom0

THat's not the point, anyway.

The point is: Where do I get the kernel source?

@joeschmoe:

Where do I get the kernel source?
https://www.kernel.org/

@buhman:

@joeschmoe:

Where do I get the kernel source?
https://www.kernel.org/

All the obvious things have already been tried.

The point is that experience shows that unless you get EXACTLY the right kernel source, it won't work. It has to be EXACTLY what was used to build the currently running kernel. Believe me, I know of what I speak.

The point is that one of the things that I tried (which, alas, I cannot remember/re-create at the moment) did say that I could get the exact kernel source that corresponds to the kernel used in the Linode setup (presumably, from the Linode devs themselves - the guys who set up the Ubuntu image that I am running). That's what I seek.

Everything relevant is in the original post.

BTW, if it turns out that I can't do this (the overall, long range goal), I am prepared to find that out myself. I will probably find a workaround, if it can't be done "straight up". In any case, I need to find the kernel source/headers.

@joeschmoe:

The point is that experience shows that unless you get EXACTLY the right kernel source, it won't work. It has to be EXACTLY what was used to build the currently running kernel. Believe me, I know of what I speak.

No it doesn't. The sources you build against need only match in ABI compatibility with what you are running. Generally, this means matching versions, but not necessarily matching patches applied on top, since most patches don't break ABI compatibility. Linode simply uses the sources from kernel.org, and patches the Makefile to add the -linode# suffix to the kernel version. They've not had to patch to fix broken things since XSA-39, and even those patches didn't break ABI compatibility, so you could build against sources that didn't have those patches and not have any issues. The last version I can think of where their patching would have broken ABI compatibility would have been when Xen PV support was not in the mainline kernel, which was a very long time ago.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct