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)

  1. Boot into Ubuntu.

  2. Open terminal (Ctrl + Alt + T).

  3. Find the exact name of the Windows boot entry:

    grep menuentry /boot/grub/grub.cfg

    Look for a line like menuentry 'Windows Boot Manager (on /dev/nvme0n1p1)'. Copy the name inside the single quotes.

  4. Edit the GRUB configuration file:

    sudo nano /etc/default/grub
  5. Change the GRUB_DEFAULT line:

    # Before
    GRUB_DEFAULT=0
    
    # After (Paste the name you copied)
    GRUB_DEFAULT="Windows Boot Manager (on /dev/nvme0n1p1)"
  6. Save and exit (Ctrl + O, Enter, Ctrl + X).

  7. Update GRUB to apply changes:

    sudo update-grub

Method 2: Grub Customizer (GUI)

An easier graphical tool.

  1. Install Grub Customizer:

    sudo add-apt-repository ppa:danielrichter2007/grub-customizer
    sudo apt update
    sudo apt install grub-customizer
  2. Open Grub Customizer.

  3. Go to the General settings tab.

  4. Under "default entry", select Windows Boot Manager from the dropdown list.

  5. Click Save.

Method 3: Remember Last Selection

You can make GRUB remember which OS you booted last time.

  1. Edit GRUB config:

    sudo nano /etc/default/grub
  2. Set these lines:

    GRUB_DEFAULT=saved
    GRUB_SAVEDefault=true
  3. 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.

  1. Restart your computer and press the BIOS key (F2, Del, F10, or Esc).
  2. Navigate to the Boot tab.
  3. Look for Boot Option Priorities.
  4. To use GRUB (choice of OS): Move ubuntu to the top.
  5. 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:

  1. Install os-prober:

    sudo apt install os-prober
  2. Enable it in config:

    echo "GRUB_DISABLE_OS_PROBER=false" | sudo tee -a /etc/default/grub
  3. 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
User