How to Access the GRUB Menu in Virtual Machine
Most modern VMs are configured to skip the GRUB bootloader for a seamless experience.
However, you might need to access the GRUB menu at times. For example, if you want to switch back to the older kernel or get into recovery mode for resetting the password.
Reboot your VM and keep the Shift key pressed when it is booting up again. This should give you the GRUB menu.
In this quick article, I will be showing you two ways to access the GRUB menu in Linux running in a virtual machine:
- A temporary solution (when you have to access GRUB once or twice)
- A permanent solution (will show GRUB at every boot)
As most of the users are not going to interact with the grub on a daily basis, I will start with a temporary solution in which you can access the grub without any tweaks.
I have used Ubuntu in the tutorial here but the steps should be valid for other Linux distributions as well.
Access the GRUB bootloader in VM (Quick way)
If you want to access the GRUB occasionally, this is supposed to be the best way as it does not require any configuration.
Just reboot your system and keep the shift
key pressed.
That’s it!
You will have your grub menu without any time limit:
Pretty simple way. Isn’t it?
But it will work for that specific boot only. So what if you want to have the grub on every boot? Refer to the given method.
Enable Grub menu in virtual machines permanently (if you want to)
This method requires changing Grub config file in the command line. Please ensure that you are comfortable doing the edits in the terminal.
If you have to deal with the grub menu to access the other operating systems or change boot from the older kernels often, this method is just for you.
To make the grub accessible at every boot, you must make changes in the configuration file.
First, open the grub config file using the following command:
sudo nano /etc/default/grub
Here, change the GRUB_TIMEOUT_STYLE=hidden
to the GRUB_TIMEOUT_STYLE=menu
:
Next, in the same config file, specify for how many seconds you want the grub to be displayed.
I would recommend 5 seconds as it seems to balance between not too long and short (yep, quite relatable):
GRUB_TIMEOUT=5
And finally, you can save the changes and exit from the nano text editor.
To activate the changes you made to the config file, update the grub using the following command:
sudo update-grub
That’s it. Reboot your system and the grub should be there for 5 seconds.
How about theming GRUB?
You will get the grub bootloader in most of the Linux distros as it is quite simple to configure and gets the job done.
But by default, it’s nothing apart from the black background and plain text. So we made a guide on how you can make it look dope:
I hope you will find this guide helpful and if you have any queries, let me know in the comments.