Ubuntu / Linux news and application reviews.

Unity Reboot in other OS

A while back I wrote a custom Unity launcher to reboot in a different OS, useful if you dual boot.

Let me remind you how it works: 
  • when GRUB starts, the first GRUB menu item is highlighted - selecting to reboot from this custom launcher will highlight the menu entry you set and will boot it if you don't select a different option in the GRUB menulist (so the GRUB menu will still be displayed if you've set a GRUB timeout higher than 0 but you can set it to 0 and directly boot into the selected OS).
  • This only applies for one reboot, then everything is back to normal.

To make it easier to install and use, I've updated the script and uploaded it to the WebUpd8 PPA. Also, the new version can reboot without requesting for your password - to do this, check the "Don't ask for password on restart" box on the Launcher settings. But please note that using this option is not recommended because it enables any user to execute /usr/bin/grub-editenv so it can be a security risk. But since this was requested, I've implemented it and you can easily enable/disable it.



Install and configure Unity Reboot


1. To install Unity Reboot in Ubuntu 11.10 or 11.04, use the commands below:
sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install unity-reboot

If you don't want to add the WebUpd8 PPA, you can manually download the .deb below:

If you've previously used the Unity Reboot script, it would be a good idea to remove its .desktop file under ~/.config/autostart (or else there will be conflicts).

2. After installation, you either need to log out or run the following command in a terminal:
unity-reboot

This is only required the first time! Don't worry, this command won't reboot your computer.

3. Now you need to add Unity Reboot to the Unity launcher. The launcher won't show up in Dash so open Nautilus, navigate to ~/.local/share/applications (.local is a hidden folder in your home directory so press CTRL + H to see it) and you should see a file called "unity-reboot.desktop" - drag this file to the Unity launcher.

At this point, if you want to restart in a different OS, you will be prompted to enter your password but if you want to be able to restart in a different OS without being prompted for the password (or any other confirmation), right click the Unity Reboot launcher, select "Settings" and check the "Don't ask for password on restart" box.


Important notes:
  • If you've removed a kernel or an OS and just booted, the launcher needs an extra reboot (or a logout or an Unity reload) to be updated. But this isn't something that you do frequently so you will probably not even notice it.
  • If you boot multiple Linux distributions that come with their own GRUB, Unity Reboot will only work if it runs on the Linux distribution that you've installed last. Example: if you install Ubuntu 11.04 and then you also install Ubuntu 11.10 (so you dual boot both of these Ubuntu versions), Unity Reboot will only work in Ubuntu 11.10.
  • The launcher itself doesn't do anything if clicked (that's the intended behavior). Right click it and select a GRUB entry to reboot in a different OS.