How to dual-boot PopOS and Windows
I have a desktop computer and I’m getting sick of Windows. Linux is getting really good lately for games too, so I wanted to give it another shot. I chose Pop!_OS since it has NVIDIA drivers pre-installed, which is something I need and I really do not want to have to configure myself.
Another thing is that I want to dual-boot comfortably. I use a wireless keyboard and I’m not about to search for a wired one every time I need to press F10 to open the boot menu or whatever during startup.
Lastly, Windows and Linux have separate boot partitions. This is mainly because PopOS wants 1GB+ boot partition and Windows creates like 100MB by default. A different distro might fit. Although I’ve heard that sharing a boot partition with windows is a pain in the ass and Windows updates frequently break things. It’s probably good that they are separate.
So here’s how I got it to work - for your information or for my future reference :)
Bootable USB
For this you need a USB stick. Mine is 64GB, but operating systems are curiously small - 16GB is plenty, most likely.
- Download the NVIDIA kind of PopOS (a little bit down the page) ISO file
- Download Balena Etcher for creating the bootable stick. I
- Plug the USB into your computer and use Balena Etcher to flash it with the ISO you just installed
Boot from the USB
Put the flashed USB into the computer, we’re going to try to boot from it.
You have to figure out what key to press to switch your motherboard into boot mode. I have a MSI motherboard and the key is F10, but I’ve seen people saying that F11 or F12 works for them.
Once you get to a menu of drives to boot from, select your USB stick. It will guide you through a trivial setup of keyboard layouts and languages.
Caution
When it comes the time to install the linux onto the main drive. The trivial option just wipes your entire drive and installs the linux there. We do NOT want that - I intend to keep Windows around for a bit more, just in case. So we need to partition the drive, to make a little cozy home for the new linux bro.
Partition the main drive
I only have a single SSD drive. Maybe this works differently with multiple drives.
Anyways - create 3 partitions for your Pop OS:
- Boot partition, size 1GB+, format
fat32
- Swap partition, size ~4GB, format
ext4
. This one is optional, it acts as a bonus RAM if the computer needs some. - Root partition, size 100GB+, format
ext4
. This is the main living space for your linux, make it as large as possible.
Apply the changes and GPart will create your partitions for you. Sit back for a minute! Then restart the PC, pop into the boot menu like you did with the USB stick (you can take it out) - the new PopOS boot partition should be waiting there.
Linux should be the first to boot
Now we need to adjust the boot priority of the operating systems. By default my PC booted into Windows if I let it. What I really want is to show me an option each time.
Running sudo efibootmgr
shows you the order in which the motherboard tries to boot operating systems (I think). Mine shows something like
sudo efibootmgr
BootCurrent: 0003
Timeout: 0 seconds
Bootorder: 0000,0003,0004
Boot0000* Windows Boot Manager
Boot0003* Pop!_OS 22.04 LTS
Boot0004* UEFI OS
See the Bootorder
there? We want to reorder it so that the PopOS item number (0003
) is before the windows one.
sudo efibootmgr -o 0003,0000,0004
Now the linux should boot by default when you restart your PC
If that doesn’t work
Check your motherboard for boot priority. In my BIOS under Settings/Boot/—MySSD—, the windows boot manager was hardwired as the default!!! Change it so that the PopOS is the boot option number 1
Boot menu
Okay, now with the PC booting to Linux by default, I want to present the boot options every time the machine starts up. Just so I don’t have to hunt for the F10 key every time I want to see windows.
The thing is - windows boots from entirely different partition than linux. We have to mount the windows partition into the linux file system and copy its .efi
file into the linux boot items.
First, find how the the windows boot partition is called. You’ve seen this name before in the GParted app
sudo lsblk -f
Look for a FAT32 partition that is NOT mounted anywhere. Note its name, for me it was nvme0n1p1
. There should be two of them, one already mounted to /boot/efi
— that’s the linux one.
The windows boot partition is visible as a device if you run ls /dev
! Now we mount it into the linux file system.
sudo mkdir /mnt/windows-efi
sudo mount /dev/nvme0n1p1 /mnt/windows-efi
Now the windows boot partition should be available as a directory. Let’s grab the EFI file from it and place it where the linux boot menu will find it
sudo mkdir -p /boot/efi/EFI/Microsoft/Boot
sudo cp /mnt/windows-efi/EFI/Microsoft/Boot/bootmgfw.efi /boot/efi/EFI/Microsoft/Boot/
Note
Unfortunately, we can’t symlink the file. Symlinks are a linux feature, and this partition is read before linux is loaded. The bootloader needs the physical file in place. This also means that the EFI could become obsolete with a major Windows update. If that’s your case, just refresh it by copying it to the linux again.
Done! Now to point the boot menu to this strange bootmgfw.efi
file.
Maybe you could even unmount the windows boot partition at this point. I’m not sure.
sudo mkdir -p /boot/efi/loader/entries
sudo nano /boot/efi/loader/entries/windows.conf
Into the windows.conf
file, write the title for the boot item and where to find the EFI file to boot from. It only looks inside /boot/efi
, so we omit that part.
title Windows 10
efi /EFI/Microsoft/Boot/bootmgfw.efi
Now we finally edit the boot menu options.
sudo nano /boot/efi/loader/loader.conf
The inside of this file already contains a file that says something like “default pop-os-current”. LEAVE THAT LINE IN and just add few lines below it. The file should look something like this:
default Pop_OS-Current
timeout 5
editor no
The timeout gives you 5 seconds for switching to windows when the machine starts up. Otherwise it boots into linux.
Congrats if you read this
Let me know how it worked for you and thanks for reading! ❤️