Configure GRUB2 Bootloader
GRUB (Grand Unified Bootloader) is the first piece of software that runs when a machine starts up. Its job is to hand off control to the kernel — loading it into memory and passing along any boot parameters — so the operating system can take over. This guide covers the basics of configuring GRUB2 on Ubuntu- and CentOS-based systems, and what changes when you're doing this on a Rackspace cloud server specifically.
Where the configuration lives
The file you actually edit is /etc/default/grub. You don't touch the generated config (/boot/grub/grub.cfg on Debian/Ubuntu, /boot/grub2/grub.cfg on RHEL/CentOS) directly — it gets rebuilt from /etc/default/grub every time you apply changes, so hand-edits there get wiped out on the next update.
Common settings you'll be working with
| Setting | What it does |
|---|---|
GRUB_TIMEOUT | How many seconds GRUB waits on the menu before booting the default entry. Default is 5. Set to 0 to skip the menu and boot immediately, or -1 to wait forever. |
GRUB_TIMEOUT_STYLE | If set to countdown or hidden, the timeout runs before the menu shows up rather than on the menu screen itself. |
GRUB_DISTRIBUTOR | Sets the distro name shown in menu entries, so entries look more descriptive. |
GRUB_DEFAULT | Which entry boots by default — a number (counting from 0), a menu title, or the special value saved. |
GRUB_DISABLE_SUBMENU | Normally newer kernels get a single top-level entry, and everything else (older kernels, recovery entries) gets tucked into a submenu. |
GRUB_DISABLE_RECOVERY | Set to true to stop GRUB from generating recovery-mode entries. |
GRUB_ENABLE_BLSCFG | Turns on the Boot Loader Specification format, which manages each boot entry as its own file in a drop-in directory instead of one big config. |
GRUB_CMDLINE_LINUX | Extra kernel command-line arguments added to every menu entry. |
| Terminal output | Valid values depend on the platform, but typically include console, serial, serial<port>, gfxterm (graphical), vga_text, mda_text, and a couple of novelty options (morse, spkmodem). |
Setting up a menu and background image (general Linux server)
On a regular Linux box (not a Rackspace cloud server — see the note below), you can set a timeout, turn on the menu, and add a background image.
A typical setup uses a 10-second timeout with the menu enabled and an image applied as the background.
The image itself is just a file dropped into /boot/grub2/
Once you've pointed GRUB_BACKGROUND (or the equivalent entry for your GRUB version) at the file, apply the change and reboot.
Applying this on Rackspace cloud servers
Here's the part that's specific to Rackspace: background images aren't available on cloud servers. There's no splash screen to configure. What you are configuring is just the menu itself, with a 15-second timeout — enough time to get into the emergency console and pick a kernel if you need to.
Before changing anything, back up the current /etc/default/grub so you can restore it if something goes sideways. Then enable the menu entry and set the timeout to 15 seconds, apply the change, and reboot.
A couple of practical notes carried over from the original doc, because they matter in practice:
- Log into the Rackspace portal before you reboot, so you're already watching the console when that 15-second window opens.
- After reboot, it can take a couple of attempts (up to three) clicking into the emergency console before it actually shows up — don't assume it failed on the first try.
Ubuntu cloud servers:
If you're on an Ubuntu cloud image, editing /etc/default/grub alone won't actually take effect — Ubuntu's cloud images ship with an override file like , /etc/default/grub.d/50-cloudimg-settings.cfg, that takes precedence. Make your timeout/menu changes there instead (and back that file up too before editing).
Applying the change
After editing the right file, regenerate the actual boot config so GRUB picks up your changes:
Ubuntu/Debian-based:
sudo update-grub(This is a wrapper that runs grub-mkconfig -o /boot/grub/grub.cfg under the hood.)
CentOS/RHEL-based:
sudo grub2-mkconfig -o /boot/grub2/grub.cfgOn UEFI systems, the output path is different — typically /boot/efi/EFI/<vendor>/grub.cfg — check which one applies to your install before running the command.
Reboot afterward to confirm the change took.
Use the Feedback tab to make any comments or ask questions. You can also start a conversation with us.
Updated 9 days ago