Showing posts with label Kernel. Show all posts
Showing posts with label Kernel. Show all posts

Thursday, December 11, 2008

Kernel Update Breaks VirtualBox

This morning I get a call from a customer that runs Ubuntu and XP in VirtualBox.
They said that when the tried starting VirtualBox they received an error message about the wrong driver version. They also mentioned that they recently had a kernel update.

Drat! It's pouring rain and they are almost an hour away with traffic. I really don't want to make the trip. So I get all the info from them about the error message and tell them I'll call them back in 5 minutes.

I do a quick search and find the problem and the solution.
Luckily it is a simple terminal command and takes a few minutes to run it.
I call them back, walk them through the fix and in less then 5 minutes they are back up and very happy.

Seems there is a bug in VirtualBox that causes it to not recompile the driver for the new kernel. So when you get a new kernel update, VirtualBox breaks because the driver has been compiled for the older kernel version.
Sun really needs to fix this bug and it may have been fixed by now. I believe my customer has the VirtualBox updates turned off which means they are using an older version.

So if you are usinfg VirtualBox and get a driver error after you had a kernel update here is how you fix it.

Open the terminal.
Now copy and paste or type in the following code;

sudo /etc/init.d/vboxdrv setup

The setup will begin to recomplie the drivers to match the kernel version.
It takes a few minutes and when it's down you will see your command pompt reappear.

That's it. A simple fix that takes a few minutes.
Hope it saves someone a hassle like it saved me.

Enjoy!

Friday, November 21, 2008

Lock The Software or Kernel Versions

There are times you want to lock in your software or kernel version so that it won't upgrade to the next available version.
This article will show you how to do it and provide examples why you might want to do this.

You just got your Ubuntu system all tweaked out and running sweet. The Nvidia driver problems are all fixed and you are happy. BLINK! The updater has informed you about new updates.
So you click on the updater and start the download and install process. One of the updates is a new kernel. Cool! Might have some new features in it.
You finish the updates and restart your computer to enable the new kernel.

Disaster!!
The video is screwed again. The new kernel hosed your old settings. After a few minutes of making changes you toss up your hands and scream at the top of your lungs.
Lucky for you, you can reboot and select the old kernel for your boot up.
Then you can use one of the tips from my previous blog entry to remove that new kernel.
However, every time you start your computer, the updater informs you that you have a new update. That update is the kernel you just got rid of. How can we tell the updater to ignore it?
Here's how;

Open up the Synaptic Package Manager and do a search for linux-headers.
Find the version you are now using and highlight it.
Now go to the Package button and click on the Lock Version button.
Go back to the search field and do a search for linux-image.
Find the version you are now using and lock that version also.

Now the update manager won't bug you about an update for the new kernel.
You can also use this for software you have installed.
Use this technique to prevent update problems when your system takes a dive with a new kernel or software version.

Enjoy!

TaZMAn

Sunday, July 6, 2008

Editing the Grub Loader Menu

You have your computer set up as a dual boot system and the list of menu items keep growing every time there's a kernel update.

You know that annoying look. That screen shows your Microsoft OS, Memtest and several kernel entries along with their recovery mode images.

Here's how to pare down that list.

WARNING!
Not properly following the directions below may cause your system to not boot.
Proceed at your own risk. I will not be responsible for any damages incurred by your inability to follow directions.

We first need to open up the menu list for emitting. To do that open up a terminal window and type in the following;

sudo gedit /boot/grub/menu.lst

Type in your pasword when prompted.

Now your menu list will open with the permissions needed to edit it.

Look for entries in your menu list that look similar to this;

## ## End Default Options ##

title Ubuntu 7.10, kernel 2.6.22-15-generic
root (hd0,0)
kernel /boot/vmlinuz-2.6.22-15-generic root=UUID=15024b26-e9da-497b-8744-ccfd6170eb84 ro quiet splash
initrd /boot/initrd.img-2.6.22-15-generic
quiet

title Ubuntu 7.10, kernel 2.6.22-15-generic (recovery mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.22-15-generic root=UUID=15024b26-e9da-497b-8744-ccfd6170eb84 ro single
initrd /boot/initrd.img-2.6.22-15-generic

title Ubuntu 7.10, kernel 2.6.22-14-generic
root (hd0,0)
kernel /boot/vmlinuz-2.6.22-14-generic root=UUID=15024b26-e9da-497b-8744-ccfd6170eb84 ro quiet splash
initrd /boot/initrd.img-2.6.22-14-generic
quiet

title Ubuntu 7.10, kernel 2.6.22-14-generic (recovery mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.22-14-generic root=UUID=15024b26-e9da-497b-8744-ccfd6170eb84 ro single
initrd /boot/initrd.img-2.6.22-14-generic

title Ubuntu 7.10, kernel 2.6.22-13-generic
root (hd0,0)
kernel /boot/vmlinuz-2.6.22-13-generic root=UUID=15024b26-e9da-497b-8744-ccfd6170eb84 ro quiet splash
initrd /boot/initrd.img-2.6.22-13-generic
quiet

title Ubuntu 7.10, kernel 2.6.22-13-generic (recovery mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.22-13-generic root=UUID=15024b26-e9da-497b-8744-ccfd6170eb84 ro single
initrd /boot/initrd.img-2.6.22-13-generic

title Ubuntu 7.10, memtest86+
root (hd0,0)
kernel /boot/memtest86+.bin
quiet

### END DEBIAN AUTOMAGIC KERNELS LIST

What we need to do is comment out all the older kernels and their recovery mode entries.
I strongly suggest that you keep the 2 newest entries and their recovery mode entries.
Here's how;

In the above example we can see there are 3 kernel entries.
The newest being 2.6.22-15-generic and the oldest being 2.6.22-13-generic
We want to get rid of the 2.6.22-13-generic and the 2.6.22-13-generic (recovery mode) entries from the boot menu.

So we will comment those entries out. To do that we will use the ## characters to do the commenting.

When it's done it should look like this;


## ## End Default Options ##

title Ubuntu 7.10, kernel 2.6.22-15-generic
root (hd0,0)
kernel /boot/vmlinuz-2.6.22-15-generic root=UUID=15024b26-e9da-497b-8744-ccfd6170eb84 ro quiet splash
initrd /boot/initrd.img-2.6.22-15-generic
quiet

title Ubuntu 7.10, kernel 2.6.22-15-generic (recovery mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.22-15-generic root=UUID=15024b26-e9da-497b-8744-ccfd6170eb84 ro single
initrd /boot/initrd.img-2.6.22-15-generic

title Ubuntu 7.10, kernel 2.6.22-14-generic
root (hd0,0)
kernel /boot/vmlinuz-2.6.22-14-generic root=UUID=15024b26-e9da-497b-8744-ccfd6170eb84 ro quiet splash
initrd /boot/initrd.img-2.6.22-14-generic
quiet

title Ubuntu 7.10, kernel 2.6.22-14-generic (recovery mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.22-14-generic root=UUID=15024b26-e9da-497b-8744-ccfd6170eb84 ro single
initrd /boot/initrd.img-2.6.22-14-generic

##title Ubuntu 7.10, kernel 2.6.22-13-generic
##root (hd0,0)
##kernel /boot/vmlinuz-2.6.22-13-generic ##root=UUID=15024b26-e9da-497b-8744-ccfd6170eb84 ro quiet splash
##initrd /boot/initrd.img-2.6.22-13-generic
##quiet

##title Ubuntu 7.10, kernel 2.6.22-13-generic (recovery mode)
##root (hd0,0)
##kernel /boot/vmlinuz-2.6.22-13-generic ##root=UUID=15024b26-e9da-497b-8744-ccfd6170eb84 ro single
##initrd /boot/initrd.img-2.6.22-13-generic

title Ubuntu 7.10, memtest86+
root (hd0,0)
kernel /boot/memtest86+.bin
quiet

### END DEBIAN AUTOMAGIC KERNELS LIST


As you can see, we put a ## in front of all the entries for the 2.6.22-13-generic kernel.
You need to do this to all the kernel entries older then the newest 2.
That way, should you have a problem with the newest kernel, you can boot into the next oldest one and fix the problem.

Now that we have that cleaned up, let's set the menu so that it doesn't keep adding new kernels to the list that we just cleaned up.

Here's what you need to do.
Look for an entry similar to this in the menu list;

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all

We need to edit the last entry that says # howmany=all
Change the =all to =2

It should look something like this;

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=2


Now your list should never display more then 2 kernel versions along with the recovery mode links.

Close the menu list and select the option to save the changes.

Now for the moment of truth.
Reboot your computer.
If you did everything properly you should only see the 2 newest kernels listed in the grub menu and it will boot up properly when you select the kernel to boot to.

Good luck and enjoy!!!

TaZMAn