How to change the Default OS to boot in dual Boot – Linux and Windows using Linux Grub Bootloader

If you are using Linux and Windows on the same machine and probably using the same disk or keeping another disk attached that had windows then you are looking at GRUB bootloader when you start up your Syyem (Desktop or Laptop).
It always depend on our usage what we have to use more and we don’t want other OS to load up automatically and also we don’t want to wait for long or want to hit Enter manual while selecting the OS which we want to boot.

There are multiple applications in the market for Windows as well for Linux Repo like Ubunutu, Mint, Arc and all

How about keeping the load low and accomplishing it with one line command

Open Terminal
we need to use sudo privileges

This is the file that we have to edit and make sure to keep a backup of it first in case something will go wrong

sudo cp /etc/default/grub /etc/default/grub.bak

then
Edit it using a comfortable editor like nano or VI as I use VIM/VI more so in case you more comfortable with nano replace vi with nano

sudo vim /etc/default/grub

Make sure during start up your windows option is visible at which location like 1 2 or 3

in this file, you will see a line like this

GRUB_DEFAULT=0

here you have to replace this 0 with that number like in case of mine windows is listing on 3 so I will use 2 as array count starts from 0

save and exit the file. control + x and yes in nano and :qw in case of VI

now we need to reload GRUB

sudo update-grub

now you are done, test is by reboot

You may also like...