# Select grub entry to boot next when restarting in kde / kdm

## flin

Hi,

does anybody know what needs to be done so that the "Restart computer" option in the kde log off menu does correctly select an entry from the grub menu to be booted next? I have selected grub as bootmanager in kcontrol and the grub menu entries show in the kde shut down menu. 

But whatever I select there is completely ignored by grub when the system is restarted.

----------

## badchien

Last time I tried to set this up in kdm I found out it only worked with lilo, not grub. I don't know if that is still the case, but perhaps.

----------

## flin

Hmm, I have another linux system which is based on OpenSuSE where this works like a charm (also with grub). I also compared the grub.conf of both systems but couldn't see any significant differences. 

Maybe the SuSE guys have patched grub somehow to work correctly, but on the other hand why should kcontrol offer grub as boot manager 

and show the available grub menu entries if os selection wasn't supported with grub.

----------

## stkas

Hello,

i have the same problem.

Did you find a soution meantime?

Thank you for your answer

Stefan

----------

## transient

I'm not able to help with the KDE part of things unfortunately, but I can tell you how to store the grub entry you want to boot upon next starting your computer. You might be able to see why the KDE menu isn't working then...

In your grub.conf or menu.lst file, make sure you've got the "default" entry set to "saved"

```
default saved
```

You then use the "grub-set-default" program to set the default boot entry. 

Pass it the number of the entry you want to boot, counting from 0.

For example, a simple grub.conf file:

```

default saved

title Sample kernel

kernel (hd0,0)/boot/kernel-image

title Another kernel

kernel (hd0,0)/boot/kernel-image-1

```

In order to set the default boot entry to "Sample kernel", you'd execute 

```
grub-set-default 0
```

To set "Another kernel" as the default, execute 

```
grub-set-default 1
```

 and so on.

This won't work unless you have that "default saved" line in your grub.conf file. So it's possible that Suse will automatically write a grub.conf with that line in it, whereas in gentoo, you write your own, so most likely the line isn't there.

----------

## stkas

@ Transient

Thanks for your help,

i will try it out tonight.

If i understand the "grub-set-default " command correctly it will akt the same way as the "default statement" in the grub.conf file.

In this case it will work to start windows from the next boot on as the default OS. But how do i come back to Linux again?

How to modify the Grub settings from Windows?

The goal is to boot Linux by default and Windows once now and then.

Any further ideas about this?

Best regards

Stefan

----------

## weeny

 *stkas wrote:*   

> @ Transient
> 
> Thanks for your help,
> 
> i will try it out tonight.
> ...

 

I am looking exactly for the same feature. On my old system i had lilo installed and with "lilo -R bootalias" you could make the (lilo) bootloader boot the specified system only once and after that it automatically turned back to the old default. I am using this approach at my work for remotely backing up servers with partimage (1. boot into mini system 2. create image of first system using partimage 3. reboot into productive system again)

now i googled arround and found this ... i will check if this works  :Smile: 

http://www.gnu.org/software/grub/manual/html_node/Booting-once_002donly.html

regards

weeny

----------

