How To Install Arch Linux (Windows Dualboot)

We are going to be dualbooting Arch Linux on a Windows laptop today. Despite what others say, Arch is relatively easy to setup in comparison to other distros in my opinion. The fact that it is minimal just means that you have minimal things to setup. Sometimes you will run into issues when installing on hardware compared to a VM, so I will also be covering some of my troubleshooting problems at the end.

Requirements

I recommend having WSL installed on Windows in order to verify the ISO easily in a later step. You will also need an empty USB stick to make a bootable drive. I suggest reading through the Arch Installation Guide to get familiar with the steps. While I couldn’t follow the guide fully because of hardware specific errors, it is useful for getting familiar with what Arch needs in order to work. I’ll be trying my best to use layman terms so that hopefully beginners can follow along too.

Configuring Window’s Side

There are a few steps we need to do on Windows before going into the Arch setup. First we will need to disable fastboot from the battery’s options.

This can be found by right-clicking your battery icon from taskbar > power options > (left side) choose what the power button does > (at the top) change settings that are currently unavailable.

Next we will make an empty partition space by going to start menu and searching for “partition”, it should bring up an application that allows you to shrink your storage space.

Usually it will be disk 0, which is your main drive. You want to shrink the main space (normally C drive) by however much space you want to give your Linux OS.

Next you will want to make sure your bios firmware is up to date. The method to update it will depend on your manufacturer, but typically you will have some kind of program preinstalled to be able to do it. If not, then check their official site for their latest bios firmware. With the bios updated, restart the PC and go into bios (usually F2 or del, depending on your laptop). In the bios, you want to do 2 things:

  • Disable Secure Boot
  • Change the storage to UEFI mode

Every bios is a little different, so the method to change these options will vary. Do not worry if you cannot find the UEFI mode option, we can fix that during our Arch install.

We will download the Arch Linux ISO through torrent from Arch’s wiki site. After getting the ISO, scroll down a bit and we will verify it with a PGP signature. Download the PGP signature and go to the fingerprint’s link.

At the fingerprint’s link, you should see something like the image below. You want to go to “pub” link and copy the URL address.

After getting the URL address, you want to run gpg --fetch-key 'URL_ADDRESS' in your WSL terminal, like in the image below.

Before running gpg --keyserver-options auto-key-retrive --verify archlinux-*.iso.sig , you want to make sure the .sig and .iso files are in the same directory. Good signature means that it’s good to go, ignore the warning.

Create the bootable usb with rufus, etcher, or whichever you prefer. I’m using rufus. To verify your partition scheme, you will need to look into the drive’s properties from the partition menu from before. If you don’t know how to do that, then I suggest taking a look at my Ubuntu dualboot article. Once everything looks good, just hit START to flash Arch onto your USB drive.

Once you have your USB bootable drive, you are all set to work on installing Arch Linux.

Installing Arch Linux

With the USB still plugged in, go into your BIOS and put the USB drive on the top of the list in your boot list. Save and exit, and it should boot into the Arch bootable loader. If you get an invalid signature/secure boot error when trying to boot into the arch USB, go into your bios and make sure you’ve disable secure boot + fast boot in Window’s battery settings.

Bootable USB’s loader after changing boot order from BIOS
Replicating my hardware install on a VM

I will be showing how to connect to wifi, since I figure most people won’t have ethernet readily available.

It should show something like wlan0 under Name

We will be using iwctl to connect, so type iwctl to go into it’s interface. Use device list to see the name of our wifi device. Then station device_name scan . If your device_name is wlan0, it is station wlan0 scan . Next is station device_name get-networks to get the name of the wifi to connect to. With the name/SSID, use station device_name connect wifi_name , a password prompt should show up if the name/SSID is correct. Now we can check if we’re connected to the internet with station device_name show and the ‘State’ should show ‘connected’. Type quit to quit.

Run timedatectl set-ntp true and if it doesn't show any errors, then that means it worked. You can run timedatectl status to check the time and date.

Run lsblk to see all of our storage device names.

This should be totally different on a Windows laptop.

The image above should look totally different from what would be on hardware. It might be ‘sda’ or ‘nvme0n1’ depending on what storage device you have:

nvme0n1         disk
|--nvme0n1p1 part
|--nvme0n1p2 part
|--nvme0n1p3 part
|--nvme0n1p4 part

You will want to run lsblk -f or fdisk -l to see which part is labeled the EFI System. This should be your Window’s EFI partition, remember these commands as we will need to reference these parts throughout partitioning our system.

Run cgdisk /dev/block_device, where block_device should be your storage’s partition system name. Note: If your storage is GPT, you will run cgdisk. Otherwise, you will run fdisk. You will get an error telling you it’s not GPT if you’re mismatching your storage type. Reference here for more info on block device names.

Arrow keys to move around the bottom menu

The images above show how to partition 1 section for EFI. I will be going with 3 sections:

  • Linux EFI Partition
  • Linux Root Partition (your main folder/drive essentially)
  • Linux Swap

Usually people just go with Boot and Root, but I chose this setup for my laptop because I might use hibernate sometimes, so I need swap and a separate EFI from Windows to avoid any corruption during hibernation. You can check out the partition codes for cgdisk here. You will want to go through these 3 setups:

  • EFI: first sector: blank, size: 512M, guid: ef00 , name: Linux EFI
  • Swap: first sector: blank, size: 8G (or your ram size), guid: 8200, name: Linux Swap
  • Root: first sector: blank, size: blank (fills all the way), guid: blank, name: Linux Root

Just imagine having extra partitions on the top of these, which should be your Windows partition. So our Linux partitions should be EFI system, Linux swap, and Linux filesystem.

Use fdisk -l to check your partitions types

Be sure to triple check that everything is correct, because if you write over a windows partition, you will need to recover the disk as there will be no working OS on the drive anymore. Once you have those 3 partitions with the correct settings, select [Write], ‘yes’, then [Quit]. Congrats for making this far, the hardest part is over.

Next we will want to format our EFI partition. Run mkfs.fat -F32 /dev/YOUR_EFI_PARTITION. It is at 5 for me on an nvme, So I will run mkfs.fat -F32 /dev/nvme0n1p5, but it might be /dev/sda# for you.

Next we will format our filesystem with mkfs.ext4 /dev/YOUR_FILESYSTEM_PARTITION , and hit the default for when creating the journal.

If you have swap, formatting it, we will run mkswap /dev/YOUR_SWAP_PARTITION . It will be mkswap /dev/nvme0n1p7, but it might be /dev/sda# for you. Turn on the swap with swapon /dev/YOUR_SWAP_PARTITION .

Formatting Example from my VM for demo purposes

Lets mount our Root filesystem with mount /dev/YOUR_FILESYSTEM_PARTITION /mnt. Then let’s make the folder for our Linux EFI with mkdir /mnt/boot and then run mount /dev/YOUR_EFI_PARTITION /mnt/boot to mount.

Mounting Example from my VM for demo purposes

You can run df to make sure you have both EFI and filesystem mounts with the correct partitions.

We will run pacstrap /mnt base base-devel linux linux-firmware util-linux grub efibootmgr os-prober intel-ucode networkmanager vim . Replace intel-ucode for amd-ucode, if your CPU is AMD. You can add more packages if you want, but I like to keep things minimal for our install. Vim is optional, but not really. You can choose your favorite terminal editor in place of it though.

The fstab is a list of drives for your PC to go through when Linux is booting up, and we will generate it with this command: genfstab -U /mnt >> /mnt/etc/fstab . You can vim /mnt/etc/fstab to see if everything is correct, the UUIDs should NOT be commented out. Remember to run the pacstrap above before running this, as pacstrap downloads genfstab.

Setting Up Arch

Now let’s log into our new Arch installation, since we are currently using our USB drive’s arch. Run arch-chroot /mnt , this will log into our new Arch system as sudo pretty much.

You can see, it changes our terminal prompt.

If every is mounted correctly, you should get a prompt like in the image above.

Let’s set our timezone by symbolic linking it: ln -sf /usr/share/zoneinfo/Japan /etc/localtime , after /zoneinfo you might want to hit tab to see a list of countries, and then maybe another tab after selecting your country if it has multiple timezones. Sync the hardware clock with hwclock - — systohc .

Next, let’s set the locale by going into vim /etc/locale.gen with your favorite terminal editor.

Uncomment en_US.UTF-8 UTF-8 , and/or whichever languages you want, and save+exit the file. Then run locale-gen to generate the files.

Set our language by making a file in/etc/locale.conf and typing in this line: LANG=en_US.UTF-8 , and save+exit.

Next let’s make a hostname, this will be seen after your username on terminal prompts. Make a new file /etc/hostname and type in a desired name and save+exit.

Let’s set our hosts by going into /etc/hosts and writing these 3 lines in:

127.0.0.1    localhost
::1 localhost
127.0.1.1 YOUR_HOSTNAME.localdomain YOUR_HOSTNAME

Replace YOUR_HOSTNAME with your actual hostname.

Lastly let’s set our root’s password with passwd .

Setting up our network manager to load on boot up for whenever we boot into Arch, run systemctl enable NetworkManager . Note that it is case sensitive. You can use nmcli once you’ve finished installing Arch and booting into it, so that way you can easily access wifi instead of taking extra time setting it up manually.

Next let’s setup our bootloader, grub, for dualbooting. Setup grub with grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB

Next we need to let os-prober where our Windows is. So let’s check our Window’s EFI system partition directory with fdisk -l to double check. As mentioned in the partitioning step, any partitions before the ones you’ve created are the Window’s ones. Mine is on the 1st partition, so /dev/nvme0n1p1 . It might be something like /dev/sda# for you.

Let’s make a new mount folder for Windows withmkdir /mnt/win10 , and mount our Windows EFI to it with mount /dev/nvme0n1p1 /mnt/win10 .

Lastly let’s make our grub config with this command: grub-mkconfig -o /boot/grub/grub.cfg . The last output should show “Found Windows Boot Manager …”, which means we have successfully made a dualboot.

Taken from random example

Now we have successfully installed and configured Arch for dualboot on a Windows PC. Last commands to run areexit to get out of arch-chroot, umount -a to unmount all drives, then reboot. After rebooting, you should be greeted at the grub interface with an option for Arch or Windows. You can log into your new Arch system with root as user and the password you made earlier.

For NVME Users that CANNOT set to UEFI in BIOS

If you’ve completed this tutorial and get this similar error when booting into Arch:

Starting version 247.3-1-arch
ERROR: device 'UUID=...' not found. Skipping fsck.
mount: /new_root: can't find UUID=...
You are now being dropped into an emergency shell.
sh: can't access tty: job control turned off

This most likely means that you haven’t set your storage to UEFI mode through the BIOS. It seems like newer computers with shiny NVME drives have this issue a lot. The steps to solve this:

  1. Boot back into the bootable Arch USB drive, go into the installation prompt
  2. mount /dev/linux_root_partition /mnt
  3. mount /dev/linux_efi_partition /mnt/boot
  4. arch-chroot /mnt
  5. vim /etc/mkinitcpio.conf

6. Change modules to the image above and save+quit

7. Run mkinitcpio -P linux to regenerate your kernel images

8. quit then umount -a then reboot , and your arch boot should work now.

I hope this helps out anyone trying to install Arch Linux, it is definitely a great Linux distro with a good community.

Like my content? — Support MeGithubTwitterMedium

Software Engineer living in Tokyo | Linux | Cats | https://github.com/kai-dg | https://haruspace.dev | https://ko-fi.com/harukai