How to access GRUB on Ubuntu | Azure Tips and Tricks

How to access GRUB on Ubuntu | Azure Tips and Tricks


>>Learn how to configure your
Ubuntu Azure VM for GRUB, and use GRUB to drop into single user mode in this episode
of Azure Tips and Tricks. GRUB is the Grand
Unified Boot loader. It’s available during Boot App, and allows you to select what
operating system to run or even select a specific kernel
configuration that’s available. Being able to modify
your GRUB config to change your run level at
boot time is crucial to being able to debug your
VM in situations where you may be unable to boot into
your regular operating system. In some situations, GRUB
might be misconfigured to not show up at all during boot or to
show up on the wrong output port. Let’s see if this VM has
GRUB configured properly. Go to set after we reboot the VM
from the serial console blade, we don’t see GRUB show up. Thankfully, GRUB in Ubuntu is
actually really easy to modify. There’s just one file
you need to change on your Ubuntu VM running in Azure. This file is
etc/default/grub.d/50-cloudimg-settings.cfg. Note that GRUB timeout
has a value of zero here. Let’s change that to a value of 15. Note that the higher the number, the longer GRUB will
display on screen, which gives you
more time to act on it. But increasing this GRUB timeout will also increase the perceived
boot time over VM, this is a trade-off to be aware of. We need to add one more line
in here to make sure that the GRUB menu
is actually visible. Now with that, let’s exit. Let’s run update-grub, and
let’s reboot the VM again. Now, we see that GRUB is
automatically showing up upon boot, and it’s counting
down from 15 seconds. I can press any key to
interrupt the countdown, and I can press “E” to edit my GRUB. So now, I’m going to drop
into single user mode. To do this, I find the line
that starts with Linux, and then I append the word
single to the end of it. I press “CTRL+X” to
boot, now, we wait. As you can see, we’re now in
single user mode and we can log in, and get ourselves a shell. In this video, you learned how
to configure GRUB on Ubuntu VM and then how to drop
in a single user mode using GRUB on the same VM.

Leave a Reply

Your email address will not be published. Required fields are marked *