Dualboot Windows and Ubuntu with Windows as default
Guide on how to set up a dual boot system and configure Windows as the default operating system in the GRUB bootloader.
Setting Default OS in GRUB
By default, Ubuntu sets itself as the primary boot option. Here's how to change it to Windows.
Method 1: Editing GRUB Config (Command Line)
-
Boot into Ubuntu.
-
Open terminal (
Ctrl + Alt + T). -
Find the exact name of the Windows boot entry:
grep menuentry /boot/grub/grub.cfgLook for a line like
menuentry 'Windows Boot Manager (on /dev/nvme0n1p1)'. Copy the name inside the single quotes. -
Edit the GRUB configuration file:
sudo nano /etc/default/grub -
Change the
GRUB_DEFAULTline:# Before GRUB_DEFAULT=0 # After (Paste the name you copied) GRUB_DEFAULT="Windows Boot Manager (on /dev/nvme0n1p1)" -
Save and exit (
Ctrl + O, Enter,Ctrl + X). -
Update GRUB to apply changes:
sudo update-grub
Method 2: Grub Customizer (GUI)
An easier graphical tool.
-
Install Grub Customizer:
sudo add-apt-repository ppa:danielrichter2007/grub-customizer sudo apt update sudo apt install grub-customizer -
Open Grub Customizer.
-
Go to the General settings tab.
-
Under "default entry", select Windows Boot Manager from the dropdown list.
-
Click Save.
Method 3: Remember Last Selection
You can make GRUB remember which OS you booted last time.
-
Edit GRUB config:
sudo nano /etc/default/grub -
Set these lines:
GRUB_DEFAULT=saved GRUB_SAVEDefault=true -
Update GRUB:
sudo update-grub
Changing Boot Order in UEFI/BIOS
Sometimes the computer boots straight into Windows or Ubuntu without showing the GRUB menu. You need to change the UEFI boot order.
- Restart your computer and press the BIOS key (
F2,Del,F10, orEsc). - Navigate to the Boot tab.
- Look for Boot Option Priorities.
- To use GRUB (choice of OS): Move ubuntu to the top.
- To boot straight to Windows (bypass Linux): Move Windows Boot Manager to the top.
Fixing Missing Windows Entry
If Windows disappeared from the GRUB menu after an update:
-
Install
os-prober:sudo apt install os-prober -
Enable it in config:
echo "GRUB_DISABLE_OS_PROBER=false" | sudo tee -a /etc/default/grub -
Update GRUB:
sudo update-grub
Time Synchronization Issue
Windows uses Local Time, Ubuntu uses UTC. This causes the time to be wrong when switching.
Fix in Ubuntu: Make Ubuntu use Local Time:
timedatectl set-local-rtc 1 --adjust-system-clock