The Ultimate Guide to Dual Boot Arch Linux & Windows

The Ultimate Guide to Dual Boot Arch Linux & Windows

cover-photo-for-dual-boot-with-arch-linux-and-windows


Hi all, welcome to my blog, MusaBase! In this comprehensive guide, I'll walk you through dual booting Arch Linux and Windows 10 on your PC. Imagine a computing experience where the sleek, familiar interface of Windows 10 meets the raw, customizable power of Arch Linux, all on one machine. Although dual booting may seem daunting, like managing two vastly different operating systems, this step-by-step guide will demystify the process.
Sure, it's technical, but follow along closely, and i'll turn those "what-ifs" into "how-tos." By the end, you'll reboot with confidence, flipping between Netflix on Windows and a blazing-fast Arch terminal like a tech wizard.







Prerequisites

Before you begin dual booting, ensure you have either a dedicated partition or a separate disk for each operating system. Windows will occupy one partition (or disk) with its own file system, while Linux will use another.
Although you can install Linux on the same drive by creating a separate partition, doing so may compromise Window's recovery features or even lead to data loss if not done carefully. For this reason, it's crucial to back up your data completely before proceeding. Since Windows is already installed on my PC, I'll move directly to installing Linux and configuring the system for dual boot.




Step 1: Listing All Connected Drives

When we boot into the Arch Linux installer, we are greeted by a familiar screen:

arch-linux-live-installation-environment

Our first task is to list all connected devices and partitions.

  • To do this, type:
lsblk
lsblk

explaining-disks-for-windows-and-linux

By clearly understanding the partition layout from the outset, we ensure a smooth dual-boot installation process for both Arch Linux and Windows 10.




Step 2: Disk Partitioning with cfdisk

For now, if we type cfdisk in the terminal without any arguments, it will by defualt open the partition table for the first connected physical drive (in our case, sda). Our sda drive contains Windows along with its associated partitions and files.

windows-drive-and-its-partition

To install Linux on a separate disk and create dedicated partitions for it, we need to specify the target disk when launching cfdisk. For example, if we want to install Linux on the sdb disk, we run the following command:

cfdisk /dev/sdx

Since i am installing Linux in my second drive's then for me the command is:

cfdisk /dev/sdb
cfdisk-sdb-to-create-partitions-on-second-drive

After pressing Enter, we have this screen:

choose-gpt-label
  • Select GPT, because Linux works optimally with GPT (GUID Partition Table).

After selecting the Label Type, you would have the similar screen:

sdb-drive

Navigating the cfdisk interface

In the cfdisk interface, we can navigate using the keyboard arrow keys:

  • Up () & Down () arrow keys, to move between partitions in the middle screen.
  • Left () & Right () arrow keys, to move through the Options menu at the bottom of the screen.

2.1. Creating the Boot Partition

The boot partition will be responsible for booting our system.

  • Select the [ New ] option from the bottom menu and press Enter.
  • A prompt appears at the bottom, asking how much space to allocate for this partition.
  • Type the desired size using digits.
  • Use a capital G for gigabytes (GB) or a capital M for megabytes (MB).

Please refer to the images below for viusal examples:


2.2. Creating the Swap Partition

The Swap partition acts as Virtual Memory when the system runs out of physical RAM.

  • Navigate down to select the Free Space.
  • Move left to the [ New ] option and press Enter.
  • When prompted at the bottom, enter the desired size.
  • Allocate between 4 GB and 32 GB based on our system's needs.

Please refer to the images for visual examples:


2.3. Creating the Root Partition

The root partition will contain the operating system files and other essential directories.

  • Navigate down to the Free Space.
  • Move left to the [ New ] option and press Enter.
  • If we want to allocate all remaining space for this partition, simply accept the suggested size by pressing Enter. If we plan to create additional partitions later, we might allocate around 20 GB or less for the root partition.

Please refer to the images for visual examples:


2.4. Writing the Partition Table

After creating all the partitions, it's time to commit these changes by writing the new partition table to the disk.

  • Navigate right to the [ Write ] option and press Enter.
  • A prompt appears at the bottom asking, "Are you sure you want to write the partition table to disl?"
  • Type yes and press Enter to commit the changes.

Please refer to the images for visual examples:


At this stage, all partitions are successfully created and the filesystem is now ready for data storage.

If everything went right then we can see a filesystem like this:
all-necessary-partitions-created-for-arch-linux

2.5. Finalizing the Partition Setup

  • Navigate to the [ Quit ] option and press Enter to return to the Arch Linux terminal.

This step-by-step guide on using cfdisk for disk partitioning ensures that we are aligned in our dual-boot journey for Arch Linux and Windows 10. By following these detailed instructions, we can confidently partition our drives for a smooth installation experience.




Step 3: Formatting Partitions

Before moving on to the next stage of our Arch Linux installation, we need to format the partitions we created to ensure that our system's storage is properly prepared.

3.1. Listing Storage Devices

  • Type lsblk, it will list all connected storage devices with their partitions.
lsblk
listing-out-drives-for-formatting-and-mounting

3.2. Formatting the Root Partition

Our first task is to format the root partition, which in our setup is /dev/sdb4.

  • We can use mkfs command to create an Ext4 filesystem.
  • To create an Ext4 filesystem for our root partition, type:
mkfs.ext4 /dev/sdb4

3.3. Formatting the Boot Partition

Next, we format the boot partition. In our configuration, this is /dev/sdb2. We can create a FAT32 filesystem on it.

  • To create the FAT32 for our boot partition, type:
mkfs.fat -F 32 /dev/sdb2

3.4. Setting Up the Swap Partition

The swap partition does not require formatting. Instead, we need to initialize it as a swap area. In our setup, the swap partition is /dev/sdb3.

  • To configure our swap partition, type:
mkswap /dev/sdb3

With these steps completed, all our partitions are properly formatted and ready for the next phase of our Arch Linux installation. This meticulous process ensures that our dual-boot system is set up securely and efficiently.




Step 4: Mounting Partitions

Now that we have created and formatted our partition for Arch Linux, it's time to mount them so we can continue with the installation process.

4.1. Mount the Root Partition

First, we mount the root partition (in our case, /dev/sdb4) to the mount point. This partition will house our operating system and other essential files.

  • To mount the root partition, type:
mount /dev/sdb4 /mnt
mounting-root-partition

4.2. Mount the Boot Partition

Next, we need to mount the boot partition.However, the boot EFI directory does not exist in the root partition yet. We need to create it first.

  • To create the directory, type:
mkdir -p /mnt/boot/efi
creating-directory-to-mount-boot-partition

Now, mount the boot partition (in our configuration /dev/sdb2) at /boot/efi.

  • To mount the boot partition, type:
mount /dev/sdb2 /mnt/boot/efi
mounting-boot-partition-at-boot-efi

4.3. Enabling the Swap Partition

The swap partition, we don't have to mount it anywhere we just have to turn it on, in our setup it is /dev/sdb3

  • To turn on the swap partition, type:
swapon /dev/sdb3
turning-on-swap-partition

4.4. Verifying the Partition Layout

  • To ensure that our partitions are correctly mounted and recognized, run:
lsblk
confirming-file-system-layout-for-arch-linux

By following these steps, we ensure that our system's partitions are correctly mounted and prepared for the next phase of our dual-boot Arch Linux installation. This methodical approach guarantees a smoother installation process and enhances system reliability.




Step 5: Installing the Base System

Now that we have our partitions mounted, it's time to install the base Arch Linux system along with essential core pacakges. We install the base system into the /mnt directory, a temporary mount point on our sdb drive, which is the drive we partitioned and mounted for our Linux filesystem. Once the installation is complete and we reboot, our system will boot from the installed OS, and the /mnt directory will no longer be needed.

5.1. Installing Linux Firmware and Base Packages

Arch Linux provides the pacstrap script to install essential packages into the root filesystem of a new installation.

  • To install the Linux Firmware and base packages required for managing our operating system, we need Pacstrab:
pacstrap /mnt base linux linux-firmware sof-firmware base-devel grub efibootmgr nano networkmanager
What is the purpose of each package?

By executing the above command, we installa a robust base system that forms the foundation of our dual-boot Arch Linux and Windows 10 setup. This methodical approach not only streamlines our installation. process but also ensures our system is optimized for performance and reliability.




Step 6. Generating the File System Table or fstab

During installation, we manually mounted our partitions, but these mounts are only temporary. Now, we need to retrieve the filesytem information form these temporary mounts and store it in a configuration file. This ensures that the system automatically mounts the partitions at every startup, allowing Linux to locate its files and data correctly.

  • To retreive the filesystem, we can use genfstab:
genfstab /mnt
genfstab

At this point, we can see the mounted filesystem listed in the terminal. As we can see our partitions are correctly formatted and in the right structure:

  • /dev/sdb4: is our root partition.
  • /dev/sdb2: is our boot partition.
  • /dev/sdb3: is our swap partition

However, we don't need this output displayed on the terminal, we need to save it to a file instead.

  • To store the mount information in an actual file, type:
genfstab /mnt > /mnt/etc/fstab
copying-genfstab-to-file

Now, the fstab content from the terminal is saved inside a file.

  • To verify that the filesystem table has been successfully stored in /mnt/etc/fstab, type:
cat /mnt/etc/fstab
reading-fstab-from-file

By following these steps, we ensure that the mounted partitions are persistently configured, paving the way for a smooth and reliable boot process for our new Arch Linux installation.




Step 7. Chrooting into the Installed System

Now that we have confiugred our partitions and installed the base system, it's time to switch our current environment's root directory to that of the newly installed system, a process known as chrooting. This step is essential before installing a GUI or any other additional components. It allows us to configure core services, set up system configuration files, install the bootloader, set the root password, and create a user account from withint our new Arch Linux environment.

  • To change our root directory, type::
arch-chroot /mnt
chroot-into-live-arch-env

Now, that we are inside our newly installaed Arch Linux system's root directory. One thing to note here is, when we change the root from the live installation environment to the installed system's environment, the shell prompt root@archiso ~ # _ changes to [root@archiso /]#_
Like this:

explaining-shell-changes-for-root-and-chroot

This new prompt confirms that we are now in the new environment, ready to install and configure the remaining components. This chroot step is crucial part of our dual-boot setup for Arch Linux and Windows 10, ensuring that we are fully prepared to finalize our system configuration.




Step 8. Configuring the Base System

In the chroot environment, we must configure several system settings and create a regular user account with sudo privileges for improved security. Rahter than using the root account for everyday tasks, setting up a non-root user helps protect our system from accidental changes and potential security risks. Below are the essential configurations we need to perform:

  • Setting Up Time Zone
  • Localization
  • Hostname
  • Root Password
  • Add a User and Granting Sudo Privileges
8.1. Setting Up Time Zone

To ensure our system uses the correct local time, we create a symbolic link for our time zone file.

  • To set timezone to our localtime, type:
ln -sf /usr/share/zoneinfo/Region/City /etc/localtime

The actual command would be look like this:

ln -sf /user/share/zoneinfo/Asia/Karachi /etc/localtime
setting-timezone-for-my-arch-system
  • To confirm that the time has been set correctly, type:
date
  • Next, synchronize the system clock (hwclock) by typing:
hwclock --systohc
synchronizing-the-hardware-clock-with-arch-system

8.2. Localization

A locale is a set of parameters that defines your system's language, region, and cultural conventions. It includes setting for:

  • Language: The language used for system messages, menus, and user interfaces.
  • Character Encoding: How text is encoded (e.g UTF-8, en_US.UTF-8).
  • Cultural Conventions: Formats for dates, times, numbers, and currency.
  • To set your lcoale, type:
nano /etc/locale.gen
opening-locale-file-in-nano

The above nano command will open the locale.gen file in the terminal from there we can set locale to our need.

  • Nano will open up a file like this:

We can navigate this file with keyboard's Up () & Down () arrow keys.

  • Navigate down () until you reach to the locale that you want to set for your system.
  • Now, delete or remove only the # symbol by pressing either Del key or Backspace.

I am choosing en_US locale for my system. However, you can choose your desired locale.

Now, to save the changes and go back to terminal follow these steps:

  • Press ctrl + o to open up a prompt for confirming to save changes. Press Enter and it will apply these changes.
  • To exit from nano editor press ctrl + x and it will exit you from nano editor.

Now, we need to generate the locale we just uncommented.

  • To generate locale, run:
locale-gen

Now that we have generated locale, we still need to specifiy it in a locale.conf file because some programs would be using this file.

  • Run:
nano /etc/locale.conf

Now in the locale.conf file we will type our locale preset.

  • Type the locale preset in the locale.conf file like this
    LANG=en_US.UTF-8 or fr_FR.UTF-8 depending on your locale and save the file.
LANG=en_US.UTF-8
  • Press ctrl + o to save the changes. Then press Enter to apply the changes.
  • Now Press ctrl + x to exit from the file. It will exit you to terminal.

8.3. Hostname

The Hostname is the name assigned to your system on a network, which helps identify your computer when communicating with other device.

  • To set the hostname for your system, tpye:
nano /etc/hostname

This may open an empty file. Type the desired hostname (for my sytem i am typing, MusaBase).

  • Type the hostname you want.
  • Press ctrl + o to save the changes, then press Enter to apply changes.
  • Now to exit from the hostname file press ctrl + x and it will exit you out to terminal.

8.4. Root Password

Now for security we need to set the root password. The root password is necessary for system administration, security, and managing Linux effectively.

  • To set the root password, type:
passwd

After typing passwd command you will be prompted to enter and re-enter the password for the root user.

Make sure to use a strong password, as root has full system control.

8.5. Add a User with Adding SUDO Privileges

Adding a user with sudo privileges in Linux improves security by limiting direct root access and reducing the risk of accidental system damage, while also enabling controlled administrative access with aduitability.

  • To add a user, run:
useradd -m -G wheel -s /bin/bash username
adding-user-to-wheel-group

8.5.1: User Password

Next, we set a password for the new user.

  • Run:
passwd username
  • Replace username in the above command with your username and press Enter.
  • Enter and re-enter password for the new user.

8.5.2: Giving User SUDO Privileges

Finally, set up sudo for the new user in the wheel group to allow controlled administrative access without directly using the root account. This improves security, prevents accidental system damage, and allows for aduitability of privileged commands. Instead of logging in as root, the user can temporarily gain elevated privileges using sudo.

  • To do this, type:
EDITOR=nano visduo

It will open up a sudoers file link in the 2nd picture, from here we can make the changes.

  • Navigate to bottom with keyboard's down () arrow key.
  • Find this line at the bottom of the file:
# %wheel ALL=(ALL:ALL) ALL
  • Remove the # symbol by pressing either Del or backspace key on your keyboard.
  • Now, Press ctrl + o to save the changes then press Enter to apply the changes.
  • Now to exit press ctrl + x and it will exit you to terminal.

By following these steps, we ensure that our system's base configuration is complete and secure. We have set up the time zone, localization, hostname, root password, and created a non-root user with sudo privileges. This comprehensive configuration prepares our Arch Linux installation for a stable and secure dual-boot environment alongisde Windows 10.




Step. 9 Updating System with User Account (Optional)

Now that we've added a user with sudo privileges, it's time to test some sudo operatins to verify that our new user has the necessary permissions. First, we'll switch from the root account to our newly created user.

  • To switch from root to our new user, run:
su username

Next, we'll run a simple update command using pacman to verify sudo access and update our system.

  • Run:
sudo pacman -Syu

This command will prompt us for our user's password and then update the system if any updates are available. If you have already up to date Arch Linux installation, the command will simply inform you that no updates are needed.
My system was missing some udpates so the -Syu updated my system but you might not have to.




Step 10. Enabling Core Services

Before finally restarting our PC and logging into the installed system, we need to enable some core services. However, first we need to exit from our user shell prompt [username@archiso /]#_ to back to the root shell prompt [root@archiso /]#_to perform these actions with administrative privileges.

  • To exit from user's shell prompt, run:
exit
  • Now, we will enable Core Services like:

1. Enabling Network Manager.
2. Grub Bootloader.


10.1. Enable Network Manager

We need to enable Network Manger using the systemctl command to ensure that the system can automatically manage network connections after reboot.

  • To enable NetworkManager, run:
systemctl enable NetworkManager

10.2. Grub Bootloader

GRUB (GRand Unified Bootloader) is a powerful and flexible bootloader used in Linux systems to manage the startup process. It loads the operating system kenrel into memory and allows you to select between multiple OS installations, GRUB supports both UEFI and BIOS, offers a comman-line interface, and can be customized for advanced boot configurations.

  • To install GRUB, run:
grub-install /dev/sdb
# OR
grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB

Replace the /sdb with your hard-drive name or label. I installed Linux on my second drive which is /sdb so i am installing GRUB on this drive.


Now that GRUB is installed, we also need to generate its initial configuration file.

  • To generate the GRUB config file, run:
grub-mkconfig -o /boot/grub/grub.cfg



Step 11. Rebooting

Now that we have completed all the necessary steps, we will exit the chroot environment and unmount all drives to prepare for rebooting into our newly installed Arch Linux system.

11.1. Exit the Chroot Environment

  • To exit from chroot environment, simply run:
exit

11.2. Unmount All Non-Busy Drives

Before rebooting, it is important to unmount all drives that are not in use.

  • To unmount all non-busy drives, run:
umount -a

11.3. Reboot The System

Finally, we reboot our system. This will take us to the GRUB bootloader screen, from which we can choose to boot into Arch Linux. Later, we can install GUI enviornmnet (such as KDE Plasma) and configure GRUB for dual booting with Windows 10.

  • Run the following command to reboot:
reboot
rebooting-system

By following these steps, we ensure that our system is properly configured and ready for the next phase. This final reboot will transition us from the installation environment into our fully installed Arch Linux system, paving the way for further customizations and the installation of a graphical interface.




Step 12. Booting into Installed Arch Linux System

After rebooting, our system will load into the GRUB bootloader, where we'll be greeted with this screen:

grub-bootloader-with-arch-linux

Once we select *Arch Linux, we will be greeted by Arch Linux's tty1 welcome screen, displaying our configured hostname:

arch-linux-login

At this point, enter the username and it's password we set during the user creation process, then press Enter to log in.

Once we're logged in, our next task is to install a GUI to enhance our experience. We'll install KDE Plasma as our desktop environment with SDDM for graphical logins, and a few essential applications such as Konsole (the KDE terminal emulator), Kate (a powerful text editor), and Firefox for browsing.

  • We can install all these components with a single combined command:
sudo pacman -S plasma sddm && sudo pacman -S konsole kate firefox && sudo systemctl enable --now sddm

After the packages and services are installed, we'll be presented with a graphical login screen:

sddm-login-screen-for-arch-linux

Here, we enter the password for our user account and press Enter. Once authenticated, KDE Plasma will load along with its services, providing us with a fully functional desktop envrionment.

kde-plasma-greeting-screen

Now, we have Arch Linux with a modern desktop environment installed on our PC. We can install additional packages and applications through Konsole, our terminal, or directly from KDE's application manager as we tailor our system to our needs.




Step 13. Setting Up Dual Boot

Now, we need to install a utility tool such as (os-prober) and configure our GRUB configuration file so that GRUB can detect other operating systems (like Windwos) on our computer.

Installing OS-Prober

  • To install os-prober, frist open terminal or konsole.
  • Run:
sudo pacman -Sy os-prober

Configuring GRUB

Next, we need to configure the GRUB configuration file to enable OS detection. This allows GRUB to include boot entries for operating system installed on other drives.

  • To open GRUB configuration file, run:
sudo nano /etc/default/grub
open-grub-config-file
  • Navigate to the bottom with keyboard's down () arrow key. Until you find follwing line:
#GRUB_DISABLE_OS_PROBER=false
disable-grub-os-prober
  • Remove the # symbol, by either pressing Del key or backspace key at the beginning of the line.
grub-cfg-file-altered
  • Press ctrl + o to save changes, then press Enter to confirm.
  • Press ctrl + x to exit from nano.

Updating GRUB

Now that we have installed os-prober and updated our GRUB configuration file, it's time to update GRUB so that it scans for all installed operating systems and generates an updated boot menu.

  • To update GRUB's Config file type:
sudo grub-mkconfig -o /boot/grub/grub.cfg
updating-grub
  • If everything is configured correctly, we should see output similar to this one:
Found Windows Boot Manager on /dev/sdx@/efi/Microsoft/Boot/bootmgfw.efi
os-prober-has-found-windows
.

By following these steps, we ensure that our GRUB bootloader is properly configured for dual booting. With os-prober enabled and GRUB updated, our system will automatically include boot entries for both Arch Linux and Windows, making our dual-boot setup seamless and user-friendly.




Step 14. Testing Dual Boot

Now that we have completed all the necessary configurations for dual booting. it's time to verify that everything works as expected.

  • Reboot the system.
  • Verify the GRUB Menu: When the system boots, the GRUB menu should display entries for both operating system:
grub-bootloader-with-arch-linux-and-windows-entries

Booting into Arch Linux


Booting into Windows 10

At this point, we have a fully working dual boot system with Arch Linux and Windows 10 installed on our PC. Whether we continue our everyday work in Windows or dive into the innovative world of Linux for exploration and experimentations, our setup offers the perfect balance to suit our diverse needs.




Afterwards: Advanced Dual Boot Capabilities

With a dual boot setup, you unlock a unique flexibility that lets you enjoy the strengths of both operating system on a single machine.
Dual booting doesn't just let us switch between operating systems, it opens up a playground for exploring advanced and innovative configurations that go beyond typical everyday use.

  • Cutting-Edge Desktop Environments: Explore modern compositors like Hyperland and Wayland Based desktops that offer fluid multitasking and dynamics windows management. Their highly customizable interfaces push the boundaries of traditional desktop experiences.
  • Enhanced Gaming Experiences On Linux: Experiment with gaming on Linux using Wine and Lutris, which enable many Windows games to run with impressive performance. However, since Linux gaming is still evolving, experimentation can help determine which games perform better on each operating system.
  • Advanced Virtualization and Testing: Leverage Linux's robust virtualization and containerization tools to create isolate environments for development, testing, or legacy applications. These features enable experimental setups that are not easily acheivable on Windows alone.
  • Optimized Workflows for Niche Tasks: Use Windows for its specialized productivity suites, multimedia editing, and top-tier gaming performance. Meanwhile, tap into Linux for development, system customization, and experimenting with cutting-edge software stacks.

By harnessing these advanced features, we turn our dual boot setup into a dynamic workspace that meets our everyday needs while inspiring us to experiment and explore. It’s not just about having two operating systems, it’s about unlocking new possibilities, refining our workflows, and discovering creative ways to work and play. Enjoy the journey and all the exciting paths it opens up for you.




🎉 Congratulations, our dual-boot setup is complete!

If this guide helped you, subscribe for more step-by-step tutorials. If you hit any error or grub isn't showing at boot, please let me know in the comments, I'll be more than happy to help.
1O1 out, I`ll see you in the next one!




Load comments