OVH Forum  

Go Back   OVH Forum > Specific forums > HOW-TO
Register FAQ Guides Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
Old 10-07-2011, 22:04   #1
Myatu
HG XXXL + KVM over IP
 
Myatu's Avatar
 
Join Date: Feb 2009
Location: Hammersmith, UK
Posts: 2,109
Standard Kernels with Ubuntu / Debian

I've seen a couple threads that ask if its possible to use the standard kernel - one that can load kernel modules - instead of OVH's kernels. With Ubuntu and Debian this is an easy task, that does not require compiling:

Step 1: ensure your server has the GRUB-2 boot loader.

Most newer servers from OVH do, as do all VPS/Cloud installations. You can have a quick look to see if the file /etc/default/grub exists, or whether this command give a valid output:
Code:
# update-grub -v
grub-mkconfig (GRUB) 1.99~rc1-13ubuntu3
Step 2: install a kernel

First make sure you have the most recent data from the repositories:
Code:
apt-get update
And check what kernels are available to you with:
Code:
apt-cache search linux-image
An example output:
Code:
# apt-cache search linux-image
linux-image-2.6.38-8-generic - Linux kernel image for version 2.6.38 on x86/x86_64
linux-image-2.6.38-8-generic-pae - Linux kernel image for version 2.6.38 on x86
linux-image-2.6.38-8-virtual - Linux kernel image for version 2.6.38 on x86/x86_64
linux-image-generic - Generic Linux kernel image
linux-image-generic-pae - Generic Linux kernel image
linux-image-server - Linux kernel image on Server Equipment.
linux-image-virtual - Linux kernel image for virtual machines
linux-image-2.6.32-25-generic-pae - Linux kernel image for version 2.6.32 on x86
linux-image-2.6.32-31-generic-pae - Linux kernel image for version 2.6.32 on x86
linux-image-2.6.32-29-generic-pae - Linux kernel image for version 2.6.32 on x86
The kernels that do not have a specific version, such as linux-image-generic, are meta packages that automatically select the most recent kernel.

The "generic" kernels are best suitable for desktop systems, "servers" for, well, servers, and so on.

Once you have decided on a kernel, install it with:
Code:
apt-get install linux-image-[your selection]
Step 3: Load a kernel

Debian and Ubuntu should already have issued a update-grub command when it installed the kernel you've selected in step 2. But it will not yet be loaded, reason being is that you don't see the "boot screen" of the server (except in vKVM mode or the ipKVM option) and so can't make a selection during boot time.

First determine the order the kernels are listed by GRUB, which can easily be done with fgrep or cat | grep:

Code:
# fgrep menuentry /boot/grub/grub.cfg 
menuentry "Ubuntu 10.10, OVH kernel 2.6.38.2-xxxx-grs-ipv6-64" {
menuentry 'Ubuntu, with Linux 2.6.38-8-server' --class ubuntu --class gnu-linux --class gnu --class os {
menuentry 'Ubuntu, with Linux 2.6.38-8-server (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
The text between the quotes will give you an idea what's-what. Do keep in mind you need to start counting from zero, so the first entry is 0, the second is 1, etc.

Now you need to edit the file /etc/default/grub and change the the GRUB_DEFAULT=0 entry according to which boot option/kernel you wish to use.

So using the previous sample output, we want to load "Ubuntu, with Linux 2.6.38-8-server", and therefore need to change the zero (0) to a one (1) in /etc/default/grub:
Code:
GRUB_DEFAULT=1
Now re-update the GRUB configuration (and this is important) with:
Code:
update-grub
Now reboot your server and cross your fingers. Once the server is back up, you can verify the correct kernel has loaded with uname, ie:

Code:
# uname -a
Linux my-super-duper-server 2.6.38-8-server #42-Ubuntu SMP Mon Apr 11 03:49:04 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
__________________
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

Visit my blog | Leave a PM | G+

Is your OVH IP listed here? Then fix it!
Myatu is offline   Reply With Quote
Old 10-07-2011, 23:19   #2
jonlewi5
EG Max
 
Join Date: Feb 2009
Posts: 400
Re: Standard Kernels with Ubuntu / Debian

Seems to have worked perfectly!
Cheers myatu
jonlewi5 is offline   Reply With Quote
Old 10-07-2011, 23:28   #3
Myatu
HG XXXL + KVM over IP
 
Myatu's Avatar
 
Join Date: Feb 2009
Location: Hammersmith, UK
Posts: 2,109
Re: Standard Kernels with Ubuntu / Debian

Good stuff I was updating an OVH server with a standard kernel when I saw your post, so good timing!
__________________
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

Visit my blog | Leave a PM | G+

Is your OVH IP listed here? Then fix it!
Myatu is offline   Reply With Quote
Old 10-07-2011, 23:42   #4
jonlewi5
EG Max
 
Join Date: Feb 2009
Posts: 400
Re: Standard Kernels with Ubuntu / Debian

haha it really was, managed to vmware server to half install, still failing but i know its something im doing an its too late to be messing with it
jonlewi5 is offline   Reply With Quote
Old 11-07-2011, 10:38   #5
Iray
SuperPlan BestOF
 
Join Date: Apr 2009
Location: Londonish
Posts: 120
Re: Standard Kernels with Ubuntu / Debian

Myatu .. Thanks dude! You need some man love... *Hug*

I'll try this out once I get my new shiny server. Hopefully this is a step by step process for us fellow noobs.
Iray is offline   Reply With Quote
Old 11-07-2011, 13:03   #6
jonlewi5
EG Max
 
Join Date: Feb 2009
Posts: 400
Re: Standard Kernels with Ubuntu / Debian

I can confirm this works perfectly, got vmware setup and working alongside GNS3,

thanks very very much myatu!
jonlewi5 is offline   Reply With Quote
Old 12-07-2011, 01:35   #7
Winit
EG Max
 
Join Date: Sep 2008
Posts: 445
Re: Standard Kernels with Ubuntu / Debian

Thank you Myatu.
Winit is offline   Reply With Quote
Old 12-08-2011, 23:58   #8
nodokodo
RPS
 
Join Date: Aug 2011
Posts: 4
Re: Standard Kernels with Ubuntu / Debian

Just an FYI, but you do NOT have to (and really shouldn't) edit /etc/default/grub.

Instead cd in to /etc/grub.d and if you ls you will see a bunch of scripts prefixed by numbers; the numbers are the boot ordering—change these numbers and you alter the order.

For example, on my Ubuntu 11.04, the OVH kernel is prefixed 06 (to slip in ahead of 10):

Code:
-rwxr-xr-x 1 root root 6658 2011-04-21 14:31 00_header
-rwxr-xr-x 1 root root 5522 2011-04-21 14:19 05_debian_theme
-rwxr-xr-x 1 root root  959 2010-10-11 12:31 06_OVHkernel
-rwxr-xr-x 1 root root 6304 2011-04-21 14:31 10_linux
-rwxr-xr-x 1 root root 5233 2011-04-21 14:31 20_linux_xen
-rwxr-xr-x 1 root root 7119 2011-04-21 14:31 30_os-prober
-rwxr-xr-x 1 root root  214 2011-04-21 14:31 40_custom
-rwxr-xr-x 1 root root   95 2011-04-21 14:31 41_custom
-rw-r--r-- 1 root root  483 2011-04-21 14:31 README
I altered that to 25 (to slip it in after the other kernels):

Code:
-rwxr-xr-x 1 root root 6658 2011-04-21 14:31 00_header
-rwxr-xr-x 1 root root 5522 2011-04-21 14:19 05_debian_theme
-rwxr-xr-x 1 root root 6304 2011-04-21 14:31 10_linux
-rwxr-xr-x 1 root root 5233 2011-04-21 14:31 20_linux_xen
-rwxr-xr-x 1 root root  959 2010-10-11 12:31 25_OVHkernel
-rwxr-xr-x 1 root root 7119 2011-04-21 14:31 30_os-prober
-rwxr-xr-x 1 root root  214 2011-04-21 14:31 40_custom
-rwxr-xr-x 1 root root   95 2011-04-21 14:31 41_custom
-rw-r--r-- 1 root root  483 2011-04-21 14:31 README
Run:
Code:
update-grub
and the default becomes 10_linux (whatever kernel you've just installed after following Myatu).

I'm pretty positive you can just remove it (06_OVHkernel) altogether, but if it aint broke… redundancy never killed anyone (well maybe a few coal miners but that's another story). HTH

Last edited by nodokodo; 13-08-2011 at 15:24.
nodokodo is offline   Reply With Quote
Old 12-03-2012, 13:20   #9
mrchrister
RPS
 
Join Date: Jul 2010
Posts: 1
Re: Standard Kernels with Ubuntu / Debian

thanks so much for the explination, this is sooo much easier then self compiling

I used your instructions on 2 ovh servers now, works flawlessly!
mrchrister is offline   Reply With Quote
Old 08-07-2012, 17:58   #10
Phixion
RPS
 
Join Date: Aug 2009
Posts: 24
Re: Standard Kernels with Ubuntu / Debian

Can anyone tell me the benefits of doing this?
Phixion is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 17:26.


© OVH 1999-2011