How to install arch linux next to windows

This is an article detailing different methods of Arch/Windows coexistence.

This is an article detailing different methods of Arch/Windows coexistence.

Important information

Windows UEFI vs BIOS limitations

Microsoft imposes limitations on which firmware boot mode and partitioning style can be supported based on the version of Windows used:

Note: The following points only list configurations supported by the Windows Setup even though Windows itself may still work on these unsupported configurations. A good example of this is Windows 11 which still works on a BIOS/MBR configuration once the Windows Setup check is bypassed.

  • Windows XP both x86 32-bit and x86_64 (also called x64) (RTM and all Service Packs) versions do not support booting in UEFI mode (IA32 or x86_64) from any disk (MBR or GPT) OR in BIOS mode from GPT disk. They support only BIOS boot and only from MBR disk.
  • Windows Vista or 7 x86 32-bit (RTM and all Service Packs) versions support booting in BIOS mode from MBR disks only, not from GPT disks. They do not support x86_64 UEFI or IA32 (x86 32-bit) UEFI boot. They support only BIOS boot and only from MBR disk.
  • Windows Vista RTM x86_64 (only RTM) version support booting in BIOS mode from MBR disks only, not from GPT disks. It does not support x86_64 UEFI or IA32 (x86 32-bit) UEFI boot. It supports only BIOS boot and only from MBR disk.
  • Windows Vista (SP1 and above, not RTM) and Windows 7 x86_64 versions support booting in x86_64 UEFI mode from GPT disk only, OR in BIOS mode from MBR disk only. They do not support IA32 (x86 32-bit) UEFI boot from GPT/MBR disk, x86_64 UEFI boot from MBR disk, or BIOS boot from GPT disk.
  • Windows 8/8.1 and 10 x86 32-bit support booting in IA32 UEFI mode from GPT disk only, OR in BIOS mode from MBR disk only. They do not support x86_64 UEFI boot from GPT/MBR disk, x86_64 UEFI boot from MBR disk, or BIOS boot from GPT disk. On market, the only systems known to ship with IA32 (U)EFI are some old Intel Macs (pre-2010 models?) and Intel Atom System-on-Chip (Clover trail and Bay Trail) Windows Tablets, which boot ONLY in IA32 UEFI mode and ONLY from GPT disk.
  • Windows 8/8.1 and 10 x86_64 versions support booting in x86_64 UEFI mode from GPT disk only, OR in BIOS mode from MBR disk only. They do not support IA32 UEFI boot, x86_64 UEFI boot from MBR disk, or BIOS boot from GPT disk.
  • Windows 11 only supports x86_64 and a boot in UEFI mode from GPT disk.

In case of pre-installed Systems:

  • All systems pre-installed with Windows XP, Vista or 7 32-bit, irrespective of Service Pack level, bitness, edition (SKU) or presence of UEFI support in firmware, boot in BIOS/MBR mode by default.
  • MOST of the systems pre-installed with Windows 7 x86_64, irrespective of Service Pack level, bitness or edition (SKU), boot in BIOS/MBR mode by default. Very few recent systems pre-installed with Windows 7 are known to boot in x86_64 UEFI/GPT mode by default.
  • ALL systems pre-installed with Windows 8/8.1, 10 and 11 boot in UEFI/GPT mode. Up to Windows 10, the firmware bitness matches the bitness of Windows, ie. x86_64 Windows boot in x86_64 UEFI mode and 32-bit Windows boot in IA32 UEFI mode.

The best way to detect the boot mode of Windows is to do the following[1]:

  • Boot into Windows
  • Press Win+R keys to start the Run dialog
  • In the Run dialog type msinfo32.exe and press Enter
  • In the System Information windows, select System Summary on the left and check the value of BIOS mode item on the right
  • If the value is UEFI, Windows boots in UEFI/GPT mode. If the value is Legacy, Windows boots in BIOS/MBR mode.

In general, Windows forces type of partitioning depending on the firmware mode used, i.e. if Windows is booted in UEFI mode, it can be installed only to a GPT disk. If Windows is booted in Legacy BIOS mode, it can be installed only to an MBR disk. This is a limitation enforced by Windows Setup, and as of April 2014 there is no officially (Microsoft) supported way of installing Windows in UEFI/MBR or BIOS/GPT configuration. Thus Windows only supports either UEFI/GPT boot or BIOS/MBR configuration.

Tip: Windows 10 version 1703 and newer supports converting from BIOS/MBR to UEFI/GPT using MBR2GPT.EXE.

Such a limitation is not enforced by the Linux kernel, but can depend on which boot loader is used and/or how the boot loader is configured. The Windows limitation should be considered if the user wishes to boot Windows and Linux from the same disk, since installation procedure of boot loader depends on the firmware type and disk partitioning configuration. In case where Windows and Linux dual boot from the same disk, it is advisable to follow the method used by Windows, ie. either go for UEFI/GPT boot or BIOS/MBR boot. See https://support.microsoft.com/kb/2581408 for more information.

Install media limitations

Intel Atom System-on-Chip Tablets (Clover trail and Bay Trail) provide only IA32 UEFI firmware without Legacy BIOS (CSM) support (unlike most of the x86_64 UEFI systems), due to Microsoft Connected Standby Guidelines for OEMs. Due to lack of Legacy BIOS support in these systems, and the lack of 32-bit UEFI boot in Arch Official Install ISO (FS#53182), the official install media cannot boot on these systems. See Unified Extensible Firmware Interface#UEFI firmware bitness for more information and available workarounds.

Bootloader UEFI vs BIOS limitations

Most of the linux bootloaders installed for one firmware type cannot launch or chainload bootloaders of the other firmware type. That is, if Arch is installed in UEFI/GPT or UEFI/MBR mode in one disk and Windows is installed in BIOS/MBR mode in another disk, the UEFI bootloader used by Arch cannot chainload the BIOS installed Windows in the other disk. Similarly if Arch is installed in BIOS/MBR or BIOS/GPT mode in one disk and Windows is installed in UEFI/GPT in another disk , the BIOS bootloader used by Arch cannot chainload UEFI installed Windows in the other disk.

The only exceptions to this are GRUB in Apple Macs in which GRUB in UEFI mode can boot BIOS installed OS via appleloader command (does not work in non-Apple systems), and rEFInd which technically supports booting legacy BIOS OS from UEFI systems, but does not always work in non-Apple UEFI systems as per its author Rod Smith.

However if Arch is installed in BIOS/GPT in one disk and Windows is installed in BIOS/MBR mode in another disk, then the BIOS boot loader used by Arch CAN boot the Windows in the other disk, if the boot loader itself has the ability to chainload from another disk.

Note: To dual-boot with Windows on same disk, Arch should follow the same firmware boot mode and partitioning combination used by the Windows installation.

Windows Setup creates a 100 MiB EFI system partition (except for Advanced Format 4K native drives where it creates a 300 MiB ESP), so multiple kernel usage is limited. Workarounds include:

  • Mount ESP to /efi and use a boot loader that has file system drivers and is capable of launching kernels that reside on other partitions.
  • Expand the EFI system partition, typically either by decreasing the Recovery partition size or moving the Windows partition (UUIDs will change).
  • Backup and delete unneeded fonts in esp/EFI/Microsoft/Boot/Fonts/ [2].
  • Backup and delete unneeded language directories in esp/EFI/Microsoft/Boot/ (e.g. to only keep en-US).
  • Use a higher, but slower, compression for the initramfs images. E.g. COMPRESSION="xz" with COMPRESSION_OPTIONS=(-9e).

UEFI Secure Boot

All pre-installed Windows 8/8.1, 10 and 11 systems by default boot in UEFI/GPT mode and have UEFI Secure Boot enabled by default. This is mandated by Microsoft for all OEM pre-installed systems.

Arch Linux install media does not support Secure Boot yet. See Secure Boot#Booting an installation medium.

It is advisable to disable UEFI Secure Boot in the firmware setup manually before attempting to boot Arch Linux. Windows 8/8.1, 10 and 11 SHOULD continue to boot fine even if Secure boot is disabled. The only issue with regards to disabling UEFI Secure Boot support is that it requires physical access to the system to disable secure boot option in the firmware setup, as Microsoft has explicitly forbidden presence of any method to remotely or programmatically (from within OS) disable secure boot in all Windows 8/8.1 and above pre-installed systems

Note:

  • If Windows used Bitlocker and stored the key in the TPM for automatic unlock on boot, it fails to boot when Secure Boot is disabled, instead showing a Bitlocker recovery screen. This is not permanent however, and you can easily boot Windows again by simply re-enabling Secure Boot.
  • On Windows 11, disabling Secure Boot prevents Windows Hello, WSM (Windows Subsystem for Android) and Windows Updates from working

Fast Startup and hibernation

There are two OSs that can be hibernated, you can hibernate Windows and boot Linux (or another OS), or you can hibernate Linux and boot Windows, or hibernate both OSs.

Warning: Data loss can occur if Windows hibernates and you dual boot into another OS and make changes to files on a filesystem (such as NTFS) that can be read and written to by Windows and Linux, and that has been mounted by Windows [3]. Similarly, data loss can occur if Linux hibernates, and you dual boot into another OS etc. Windows may hibernate even when you press shutdown, see section #Windows settings.

For the same reason, if you share one EFI System Partition between Windows and Linux, then the EFI System Partition may be damaged if you hibernate (or shutdown with Fast Startup enabled) Windows and then start Linux, or hibernate Linux and then start Windows.

ntfs-3g added a safe-guard to prevent read-write mounting of hibernated NTFS filesystems, but the NTFS driver within the Linux kernel has no such safeguard.

Windows cannot read filesystems such as ext4 by default that are commonly used for Linux. These filesystems do not have to be considered, unless you install a Windows driver for them.

Windows settings

Fast Startup is a feature in Windows 8 and above that hibernates the computer rather than actually shutting it down to speed up boot times.

There are multiple options regarding the Windows settings for Fast Startup and hibernation that are covered in the next sections.

  • disable Fast Startup and disable hibernation
  • disable Fast Startup and enable hibernation
  • enable Fast Startup and enable hibernation

The procedure of disabling Fast Startup is described in the tutorials for Windows 8, Windows 10 and Windows 11. In any case if you disable a setting, make sure to disable the setting and then shut down Windows, before installing Linux; note that rebooting is not sufficient.

Disable Fast Startup and disable hibernation

This is the safest option, and recommended if you are unsure about the issue, as it requires the least amount of user awareness when rebooting from one OS into the other. You may share the same EFI System Partition between Windows and Linux.

Disable Fast Startup and enable hibernation

This option requires user awareness when rebooting from one OS into the other.
If you want to start Linux while Windows is hibernated, which is a common use case, then

  • you must use a separate EFI System Partition (ESP) for Windows and Linux, and ensure that Windows does not mount the ESP used for Linux. As there can only be one ESP per drive, the ESP used for Linux must be located on a separate drive than the ESP used for Windows. In this case Windows and Linux can still be installed on the same drive in different partitions, if you place the ESP used by linux on another drive than the Linux root partition.
  • you can not read-write mount any filesystem in Linux, that is mounted by Windows while Windows is hibernated. You should be extremely careful about this, and also consider Automount behaviour.
  • If you shut down Windows fully, rather than hibernating, then you can read-write mount the filesystem.

Note: You can avoid this issue for a drive by mounting a drive as an external drive in Windows and ejecting the drive in Windows before hibernating.

Enable Fast Startup and enable hibernation

The same considerations apply as in case «Disable Fast Startup and enable hibernation», but since Windows can not be shut down fully, only hibernated, you can never read-write mount any filesystem that was mounted by Windows while Windows is hibernated.

Note: Windows updates may re-enable Fast Startup, as reported in [4].

Windows filenames limitations

Windows is limited to filepaths being shorter than 260 characters.

Windows also puts certain characters off limits in filenames for reasons that run all the way back to DOS:

  • < (less than)
  • > (greater than)
  • : (colon)
  • " (double quote)
  • / (forward slash)
  • (backslash)
  • | (vertical bar or pipe)
  • ? (question mark)
  • * (asterisk)

These are limitations of Windows and not NTFS: any other OS using the NTFS partition will be fine. Windows will fail to detect these files and running chkdsk will most likely cause them to be deleted. This can lead to potential data-loss.

NTFS-3G applies Windows restrictions to new file names through the windows_names option: ntfs-3g(8) § Windows_Filename_Compatibility (see fstab).

Installation

The recommended way to setup a Linux/Windows dual booting system is to first install Windows, only using part of the disk for its partitions. When you have finished the Windows setup, boot into the Linux install environment where you can create and resize partitions for Linux while leaving the existing Windows partitions untouched. The Windows installation will create the EFI system partition which can be used by your Linux boot loader.

Windows before Linux

BIOS systems

Using a Linux boot loader

You may use any multi-boot supporting BIOS boot loader.

Using the Windows Vista/7/8/8.1 boot loader

This section explains how to : install a linux bootloader on a partition instead of the MBR ; copy this bootloader to a partition readable by the windows bootloader ; use the windows bootloader to start said copy of the linux bootloader.

Note: Some documents state that the partition being loaded by the Windows boot loader must be a primary partition but usage of an extended partition has been documented as working.

  • When installing the boot loader, install it on your /boot partition rather than the MBR. For details on doing this with GRUB, see GRUB/Tips and tricks#Install to partition or partitionless disk, for Syslinux, see the note at Syslinux#Manual install, for LILO see LILO#Install to partition or partitionless disk.
  • Make a copy of the VBR:
    dd if=/dev/disk of=/path/to/linux.bin bs=512 count=1

    where /dev/disk is the path of the partition on which your bootloader is installed and /path/to/ is the mounted filesystem on which you want the copy to be readable by the Windows bootloader.

  • On Windows, the linux.bin file should now be accessible. Run cmd with administrator privileges (navigate to Start > All Programs > Accessories, right-click on Command Prompt and select Run as administrator):
    bcdedit /create /d "Linux" /application BOOTSECTOR

    BCDEdit will return a UUID for this entry. This will be refered to as UUID in the remaining steps.

    bcdedit /set UUID device partition=c: (or the drive letter on which linux.bin is kept) 
    bcdedit /set UUID  path pathtolinux.bin  
    bcdedit /displayorder UUID /addlast  
    bcdedit /timeout 30

On reboot, both Windows and Linux should now show up in the Windows bootloader.

Note: On some hardware, the Windows boot loader is used to start another OS with a second power button (e.g. Dell Precision M4500).

For more details, see https://www.iceflatline.com/2009/09/how-to-dual-boot-windows-7-and-linux-using-bcdedit/

UEFI systems

If you already have Windows installed, it will already have created some partitions on a GPT-formatted disk:

  • a Windows Recovery Environment partition, generally of size 499 MiB, containing the files required to boot Windows (i.e. the equivalent of Linux’s /boot),
  • an EFI system partition with a FAT32 filesystem,
  • a Microsoft Reserved Partition, generally of size 128 MiB,
  • a Microsoft basic data partition with a NTFS filesystem, which corresponds to C:,
  • potentially system recovery and backup partitions and/or secondary data partitions (corresponding often to D: and above).

Using the Disk Management utility in Windows, check how the partitions are labelled and which type gets reported. This will help you understand which partitions are essential to Windows, and which others you might repurpose. The Windows Disk Management utility can also be used to shrink Windows (NTFS) partitions to free up disk space for additional partitions for Linux.

Warning: The first 4 partitions in the above list are essential, do not delete them.

You can then proceed with partitioning, depending on your needs. The boot loader needs to support chainloading other EFI applications to dual boot Windows and Linux. An additional EFI system partition should not be created, as it may prevent Windows from booting.

Note: It only appears when Linux is installed on the second hard disk and a new EFI system partition is created on the second hard disk.

Simply mount the existing partition.

Tip:

  • rEFInd and systemd-boot will autodetect Windows Boot Manager (EFIMicrosoftBootbootmgfw.efi) and show it in their boot menu automatically. For GRUB follow either GRUB#Windows installed in UEFI/GPT mode to add boot menu entry manually or GRUB#Detecting other operating systems for a generated configuration file.
  • To save space on the EFI system partition, especially for multiple kernels, increase the initramfs compression.

Computers that come with newer versions of Windows often have Secure Boot enabled. You will need to take extra steps to either disable Secure Boot or to make your installation media compatible with secure boot (see above and in the linked page).

Linux before Windows

Even though the recommended way to setup a Linux/Windows dual booting system is to first install Windows, it can be done the other way around. In contrast to installing Windows before Linux, you will have to set aside a partition for Windows, say 40GB or larger, in advance. Or have some unpartitioned disk space, or create and resize partitions for Windows from within the Linux installation, before launching the Windows installation.

UEFI firmware

Windows will use the already existing EFI system partition. In contrast to what was stated earlier, it is unclear if a single partition for Windows, without the Windows Recovery Environment and without Microsoft Reserved Partition, will not do.

Follows an outline, assuming Secure Boot is disabled in the firmware.

  1. Boot into windows installation. Watch to let it use only the intended partition, but otherwise let it do its work as if there is no Linux installation.
  2. Follow the #Fast Startup and hibernation section.
  3. Fix the ability to load Linux at start up, perhaps by following #Cannot boot Linux after installing Windows. It was already mentioned in #UEFI systems that some Linux boot managers will autodetect Windows Boot Manager. Even though newer Windows installations have an advanced restart option, from which you can boot into Linux, it is advised to have other means to boot into Linux, such as an arch installation media or a live CD.
Windows 10 with GRUB

The following assumes GRUB is used as a boot loader (although the process is likely similar for other boot loaders) and that Windows 10 will be installed on a GPT block device with an existing EFI system partition (see the «System partition» section in the Microsoft documentation for more information).

Create with program gdisk on the block device the following three new partitions. See [5] for more precise partition sizes.

Min size Code Name File system
16 MB 0C01 Microsoft reserved N/A
~40 GB 0700 Microsoft basic data NTFS
300 MB 2700 Windows RE NTFS

Create NTFS file systems on the new Microsoft basic data and Windows RE (recovery) partitions using the mkntfs program from package ntfs-3g.

Reboot the system into a Windows 10 installation media. When prompted to install select the custom install option and install Windows on the Microsoft basic data partition created earlier. This should also install Microsoft EFI files in the EFI partition.

After installation (set up of and logging into Windows not required), reboot into Linux and generate a GRUB configuration for the Windows boot manager to be available in the GRUB menu on next boot.

Troubleshooting

Couldn’t create a new partition or locate an existing one

See #Windows UEFI vs BIOS limitations.

Cannot boot Linux after installing Windows

See Unified Extensible Firmware Interface#Windows changes boot order.

Restoring a Windows boot record

By convention (and for ease of installation), Windows is usually installed on the first partition and installs its partition table and reference to its bootloader to the first sector of that partition. If you accidentally install a bootloader like GRUB to the Windows partition or damage the boot record in some other way, you will need to use a utility to repair it. Microsoft includes a boot sector fix utility FIXBOOT and an MBR fix utility called FIXMBR on their recovery discs, or sometimes on their install discs. Using this method, you can fix the reference on the boot sector of the first partition to the bootloader file and fix the reference on the MBR to the first partition, respectively. After doing this you will have to reinstall GRUB to the MBR as was originally intended (that is, the GRUB bootloader can be assigned to chainload the Windows bootloader).

If you wish to revert back to using Windows, you can use the FIXBOOT command which chains from the MBR to the boot sector of the first partition to restore normal, automatic loading of the Windows operating system.

Of note, there is a Linux utility called ms-sys (package ms-sysAUR in AUR) that can install MBR’s. However, this utility is only currently capable of writing new MBRs (all OS’s and file systems supported) and boot sectors (a.k.a. boot record; equivalent to using FIXBOOT) for FAT file systems. Most LiveCDs do not have this utility by default, so it will need to be installed first, or you can look at a rescue CD that does have it, such as Parted Magic.

First, write the partition info (table) again by:

# ms-sys --partition /dev/sda1

Next, write a Windows 2000/XP/2003 MBR:

# ms-sys --mbr /dev/sda  # Read options for different versions

Then, write the new boot sector (boot record):

# ms-sys -(1-6)          # Read options to discover the correct FAT record type

ms-sys can also write Windows 98, ME, Vista, and 7 MBRs as well, see ms-sys -h.

Restoring an accidentally deleted EFI partition

If you have a GPT-partitioned disk and erased (e.g. with mkfs.fat -F32 /dev/sdx) the EFI partition, you will notice that Windows Boot Manager will either disappear from your boot options, or selecting it will send you back to the UEFI.

To remedy it, boot with a Windows installation media, press Shift+F10 to open the console (or click NEXT > Repair Computer > Troubleshoot… > Advanced > Command Prompt), then start the diskpart utility:

X:Sources> diskpart
DISKPART> list disk

Select the appropriate hard drive by typing:

DISKPART> select disk number

Make sure that there is a partition of type system (the EFI partition):

DISKPART> list partition

Select this partition:

DISKPART> select partition number

and assign a temporary drive letter to it:

DISKPART> assign letter=G:
DiskPart successfully assigned the drive letter or mount point.

To make sure that drive letter is correctly assigned:

DISKPART> list vol
 Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
 ----------  ---  -----------  -----  ----------  -------  ---------  --------
 Volume 0     E                       DVD-ROM         0 B  No Media
 Volume 1     C                NTFS   Partition    195 GB  Healthy    Boot
 Volume 2         WINRE        NTFS   Partition    400 MB  Healthy    Hidden
 Volume 3     G                FAT32  Partition    499 MB  Healthy    System

Close diskpart:

DISKPART> exit

Navigate to C: (or what your system drive letter is):

X:Sources> cd /d C:

Next is the «magic» command, which recreate the BCD store (with /s for the mount point, /f for firmware type, optionally add /v for verbose):

C:> bcdboot C:Windows /s G: /f UEFI

Tip: If it hangs up after a minute, hit Ctrl+c. This happens sometimes, but you will get a message like boot files successfully created and it will have worked just fine.

You should now have Windows Boot Manager working as a boot option, and thus have access to Windows. Just make sure to never format your EFI partition again!

Note: Remove the drive letter G assigned to the EFI partition to keep it from showing up in My Computer.

See [6], [7] and [8].

The EFI system partition created by Windows Setup is too small

Windows Setup creates a 100 MiB EFI system partition (except for Advanced Format 4K native drives where it creates a 300 MiB ESP). This is generally too small to fit everything you need. You can try different tools to resize this partition, but there are usually other partitions in the way, making it, at the very least, difficult. One option is to use the Arch install media to create a single EFI system partition of your preferred size before you install Windows on the drive. Windows Setup will use the EFI system partition you made instead of creating its own.

Unable to install Windows Cumulative Update on BIOS system

On BIOS systems, Windows cumulative updates may fail with the error We couldn’t complete the updates. Undoing changes. Don’t turn off your computer. In such case, while in Windows, you need to set the Windows partition as active.

C:> diskpart
DISKPART> list disk
DISKPART> select disk number
DISKPART> list partition
DISKPART> select partition number
DISKPART> active
DISKPART> exit

After successfully installing the Windows update, mark back your Linux partition as active, using commands above.

Time standard

  • Recommended: Set both Arch Linux and Windows to use UTC, following System time#UTC in Microsoft Windows. Some versions of Windows revert the hardware clock back to localtime if they are set to synchronize the time online. This issue appears to be fixed in Windows 10.
  • Not recommended: Set Arch Linux to localtime and disable all time synchronization daemons. This will let Windows take care of hardware clock corrections and you will need to remember to boot into Windows at least two times a year (in Spring and Autumn) when DST kicks in. So please do not ask on the forums why the clock is one hour behind or ahead if you usually go for days or weeks without booting into Windows.

Bluetooth pairing

When it comes to pairing Bluetooth devices with both the Linux and Windows installation, both systems have the same MAC address, but will use different link keys generated during the pairing process. This results in the device being unable to connect to one installation, after it has been paired with the other. To allow a device to connect to either installation without re-pairing, follow Bluetooth#Dual boot pairing.

See also

  • Booting Windows from a desktop shortcut
  • One-time boot into Windows partition from desktop shortcut
  • Windows 7/8/8.1/10 ISO to Flash Drive burning utility for Linux (MBR/GPT, BIOS/UEFI, FAT32/NTFS)

Newb’s Guide to installing Arch Next to Pre-installed Windows 10

The steps I took to dual boot Arch Linux alongside the preinstalled Windows 10 that came with my new Lenovo Ideapad. I used Ubuntu exclusively for the last 6 years so I’m Window’s illiterate. I don’t know a whole lot about the inner workings of Linux either.

Pre-Instllation Steps

Prepare the preinstalled Windows to share the system.

Verify the boot mode…

  • Boot into Windows
  • Press Win key and ‘R’ to start the Run dialog
  • In the Run dialog type «msinfo32» and press Enter
  • In the System Information windows, select System Summary on the left and check the value of BIOS mode item on the right.
  • Make sure the value is UEFI, which means Windows boots in UEFI/GPT mode

Disable secure boot

  • Open Settings (The gear icon in the start menu)
  • Click «Updates & Security»
  • In the «Recovery» menu, click «Restart now» under the «Advanced startup» header
  • After restart, choose the «Troubleshoot» option.
  • Choose «Advanced Options»
  • Choose «UEFI Firmware Settings»
  • Press the restart button to load the UEFI firmware
  • In the Security settings find and disable Secure Boot
  • In the Boot settings also find and disable Fast Boot

Disable Fast Startup

  • Open Control Panel (Press Windows key, Type «Control Panel» and press enter)
  • In the «View by» menu, choose «Small Icons» and click on «Power Options».
  • Open «Choose what power buttons do» on the left side menu.
  • Click «Change settings that are currently unavailable»
  • Uncheck «Turn on Fast Startup» and save changes.

Shrink the Windows partition

  • Press Windows Key + R and type diskmgmt.msc — hit enter
  • Right click the C drive and choose «Shrink Volume»
  • Enter the amount of space to shrink the partition (I shrunk mine by 200000mb — 200 gigs)
  • Click «Shrink»

Make a bootable USB

  • Choose a mirror from www.archlinux.org/download — I used the American pair.com mirror because it’s the first reputable domain I recognised.
  • Download the .iso file.
  • Download Rufus from https://rufus.akeo.ie/
  • Plug in a new USB stick and open Rufus
  • Select the USB drive and the downloaded Linux iso.
  • Choose the GPT partition scheme, FAT32 file system
  • Press start

Install Arch

We’re ready to boot and install Arch.

Boot the USB

  • Plug in the USB
  • Hold down the shift key while clicking Restart
  • Choose «Troubleshoot» then «Advanced Options» then «UEFI Firmware Settings» then restart.
  • In the Boot menu, find your bootable USB and move it up above the Windows boot manager so it will boot the USB first.
  • Save and exit

Load keyboard layout & locale

  • Type loadkeys us at the command line and press enter
  • Type locale-gen at the command line and press enter

Hookup them internets

  • At the command line type rfkill unblock wifi and press enter
  • Type iw dev and press enter. It will tell you the name of the Wifi interface.
  • Type wifi-menu <wifi_interface_name> (using your actual interface name) and press enter.
  • A UI will show allowing you to choose a network and log into it.
  • After logging in, ping google.com to verify the internets work. After a few packets are sent, CTRL+C to stop pinging — if it says no packets were lost then we’re good.

Partitioning

  • First type free -m, hit enter. Take note of the amount of total memory available.
  • Type gdisk /dev/sda and hit enter to start the GPT partitioning program
  • Create SWAP partition
    • At the prompt, type n, press enter to create a new partition
    • It will prompt for a partition number. Just hit enter to use the default.
    • It asks where to start the first sector. Press enter to accept the default which is automatically the start of unallocated space.
    • It asks for the last sector. Type +12GB (I have 12 gigs of memory — if you have more or less you should adjust accordingly) and press enter.
    • If it says anything other than «Linux Filesystem» type 8200 at the next prompt. Hit enter.
  • Create Root partition
    • At the prompt, type n, press enter to create a new partition
    • It will prompt for a partition number. Just hit enter to use the default.
    • It asks where to start the first sector. Press enter to accept the default which is automatically the start of unallocated space.
    • It asks for the last sector. Press Enter to accept the default and use all of remaining unallocated space.
    • If it says anything other than «Linux Filesystem» type 8300 at the next prompt. Hit enter.
  • At the prompt, type W, press enter to write changes to the drive. When prompted, type Y and press enter to confirm.

Create SWAP space

  • Type gdisk -l /dev/sda, press enter and take note of the partition number of the Swap part.
  • Type mkswap -L "Linux Swap" /dev/sda7 (My swap partition was number 7 — if yours is 5 use /dev/sda5 instead). Hit enter.
  • Type swapon /dev/sda7 (again, using the apprpriate swap partition number). Hit enter.
  • Verify status of swap space by typing free -m and press enter. If the last line starts with «Swap:» we’re good.

Format and mount the root partition

  • Type gdisk -l /dev/sda, press enter and take note of the partition number of the Root part.
  • Type mkfs.ext4 -L /dev/sda8 (My root partition was number 7 — if yours is 6 use /dev/sda6 instead). Hit enter.
  • Type mount /dev/sda8 /mnt (again, using the apprpriate swap partition number). Hit enter.

Start the installation

  • Type pacstrap /mnt base, hit enter.

Mount the EFI partition

  • Type gdisk -l /dev/sda, press enter and take note of the partition number of the EFI part.
  • Type mount /dev/sda1 /mnt/boot/efi (My efi partition was number 1 — if yours is 2 use /dev/sda2 instead). Hit enter.

Configure the system

  • Type genfstab -U /mnt >> /mnt/etc/fstab. Hit enter.
  • Type cat /mnt/etc/fstab, press enter, to verify the file was created correctly.
  • Change root into the new installation: type arch-chroot /mnt and press enter.

Set the timezone

  • Type cd /usr/share/zoneinfo && ls press enter. Take note of the appropriate region and use it as follows…
  • Type cd <region> && ls (replacing <region> with the most appropriate region.) press enter. Take note of the most appropraite city.
  • Type ln -sf /usr/share/zoneinfo/<region>/<city> /etc/localtime (replacing <region> and <city> with the most appropriate region and city.)
  • Type hwclock --systohc. Hit enter.

Set the host

  • Create the file /etc/hostname and write your hostnme in it with nano or vim
  • Create the file etc/hosts and populate it like this (replacing myhostname with whatever you put in your hostname file.)
127.0.0.1	localhost
::1		localhost
127.0.1.1	myhostname.localdomain	myhostname

Create the root user’s password

  • Type passwd and press enter
  • Enter a new root password and press enter. verify it and press enter.

Create new initramfs image

  • Type mkinitcpio -p linux. Hit enter.

Install Grub bootloader

  • Type pacman -Syu grub efibootmgr and hit enter.
  • Type pacman -Syu efibootmgr and hit enter.
  • Type grub-mkconfig -o /boot/grub/grub.cfg. Hit enter.
  • Type grub-install /dev/sda. Hit enter.
  • Verify the install… Type ls -l /boot/efi/EFI/arch/. Hit Enter. If you see a file called grubx64.efi then all is well.

Create new user

  • Type useradd -s /bin/bash -m username (replace «username» with the new user’s name). Hit enter.
  • Type passwd username (replace «username» with the new user’s name). Hit enter.
  • Enter and verify the password.

Install a desktop environment and some important packages

  • Type pacman -Syu gnome-desktop. Hit enter.
  • Type pacman -Syu gdm. Hit enter.
  • Type systemctl enable gdm. Hit enter.
  • Type pacman -Syu xterm. Hit enter.
  • Type pacman -Syu iw. Hit enter.
  • Type pacman -Syu dialog. Hit enter.
  • Type pacman -Syu vim. Hit enter.
  • Type pacman -Syu wpa_supplicant. Hit enter.
  • Type pacman -Syu os-prober. Hit enter.
  • Type grub-mkconfig -o /boot/grub/grub.cfg. Hit enter.

Unmount and reboot

  • Remove USB
  • Type exit. Hit enter.
  • Type umount -R /mnt. Hit enter.
  • Type reboot. Hit enter.
  • After a moment it will load back into Arch, this time with a desktop GUI.

In this guide, you will learn how to Dual boot Arch Linux with Windows 10 on UEFI system. This guide assumes that you already have Windows 10 installed on your system.

Prerequisites

Before you begin configuring the dual-boot setup, ensure that the following requirements are met:

  • A bootable installation medium of Arch Linux (Either USB or DVD). To download the latest Arch Linux ISO, proceed to the official Arch Linux download page. Once you have downloaded the ISO image, grab an 8GB USB drive and make it bootable using  Rufus tool or any other application that can create a bootable USB drive.
  • A fast and stable internet connection for downloading and installing software packages.

Step 1) Create a separate partition for installation of Arch Linux

For the dual boot setup to work, we need to create a separate partition on the hard drive on which Arch Linux will be installed. To do so, head over to the disk management utility by pressing Windows Key + R. In the dialogue box, type diskmgmt.msc and hit ENTER.

launch-disk-management-utility

This launches the disk management utility displaying the various disk partitions on your hard drive.  We are going to create an unallocated partition by shrinking the C drive. If you have a bigger partition than the C drive, feel free to use it for creating the separate partition,

So, we are going to right-click on drive C and select the  ‘Shrink Volume’ option as shown

02-Shrink-option

On the pop-up dialogue box that appears, we are going to specify the amount to shrink as shown. This is the amount that will be designated for the installation of Arch Linux. In our example, we have shrunk 20 GB of hard disk space will serve as the unallocated space.

Once you are satisfied, click on the ‘Shrink’ button.

03-shrink-amount

Your unallocated space will be indicated as shown below. In our case, we have set aside approximately 20G for the installation of Arch Linux.

03-Unallocated-space

With the unallocated partition in place, plug in your bootable USB and reboot your PC.

Step 2) Configure BIOS to boot from bootable medium

Before you begin with the installation process, it’s prudent to set the boot priority in the BIOS to select your bootable medium as the most preferred option.  Depending on your vendor, you can press the Esc, or F10 key to enter the BIOS and navigate to the boot priority Menu.

Also note that we are using the UEFI mode for installation.

04-configure-boot-options

Once you have selected your boot medium, press the ESC button to continue with the booting process.

Step 3) Begin the installation of Arch Linux

On the bootup screen, you will be presented with options as shown below. Select the first option – Arch Linux install medium (x86_64, UEFI) and hit ENTER.

05-Select-ArchLinux-UEFI

This initialize Arch Linux as evidenced by the boot messages on the screen.

06-loading-Arch

After a few seconds, this ushers you to the prompt as shown below.

07-Arch-Linux-loaded

To confirm that you have EFI support, run the command:

# ls /sys/firmware/efi/efivars

You should get some entries on the screen as shown. If nothing is listed on your screen, then it means you are using MBR and this guide won’t work for you in configuring up a dual boot setup.

08-Verfiy-efi-support

As you begin the installation, you might want to ensure that you have internet connectivity. Internet connectivity is crucial in setting time and date.

You can ping Google’s DNS as shown:

# ping 8.8.8.8 -c 4

You should get a positive reply as shown.

09-Confirm-internet-access

Step 4) Update time and date

Next, we are going to update the system time and date using the timedatectl command as shown.

# timedatectl set-ntp true

You can thereafter confirm the time and date using the command

# timedatectl status

10-sync-time

Step 5) Create & format Linux partitions

Next, we are going to partition our hard drive and create some Linux partitions. An easy way of doing this is using the cfdisk utility. Run the command:

# cfdisk

This displays all the partitions available including Windows partitions.

11-View-all-linux-partitions

As you can see, we have some free space of 19.5G that we created earlier in step 1 from shrinking drive C on the Windows side. Using this partition, we shall create the following Linux partitions :

  • Root partition    /     12G
  • swap partition           4G

To achieve this, we will navigate to the free space with 19.5G just after /dev/sda3 volume and hit ENTER. We will then specify the volume as 12G for the root partition as shown below. Then hit ENTER.

12-Create-a-root-partition

The root partition will be created with the Linux filesystem type as shown.

13-root-partition-created

Next, we will create another partition for swap. Using the same method, we will proceed to the remaining free partition of 7G and select the ‘New’ option.

14-create-new-partition

Specify the partition size as 4G

15-specify-partition-size

Since this will be our swap partition, we need to go the extra step and modify the partition type. Therefore, we will select the ‘type’ option and hit ENTER.

16-change-type-of-partition

In the list that appears, select ‘Linux Swap’ and hit ENTER.

17-set-to-Linux-swap

At this point, both the root and Linux swap partitions are created as seen from the partition table below.

18-Linux-swap-created

To save the partitions, select the ‘Write’ option and hit ENTER.

19-select-write-option

When prompted if you want to write the partition to disk, simply type ‘yes’ and hit ENTER.

20-accept-writing-changes

To exit cfdisk utility, select the ‘Quit’ option and hit ENTER.

21-exit cfdisk

Step 6) Format and mount the partitions

For the partitions to become usable and available for use, we need to format them and later mount them.

To format the root partition, run the command:

# mkfs.ext4 /dev/sda5

22-Format-root-partition

For swap partition, use the command:

# mkswap /dev/sda6

Then enable swap using the swapon command shown:

# swapon /dev/sda6

23-Format-swap

Next, mount the root partition to the /mnt directory

# mount /dev/sda5 /mnt

Additionally, we are going to create a directory for the EFI partition on which we will mount the Windows EFI system which , in our case is located on the /dev/sda1 partition.

# mkdir /mnt/efi

Then mount the EFI partition on the EFI mount point.

# mount /dev/sda1 /mnt/efi

24-Mount-partitions

Step 7)  Install base system and other required Linux firmware packages

Next, we are going to install the central packages for our Linux system including the base and Linux-firmware packages.

# pacstrap /mnt base linux linux-firmware

25-install base-and-linux-firmware

This is going to take quite some time. At this point, you can take a much-deserved break and head out for a stroll and grab some coffee. When the installation is successful, you should get the following output.

27-pacstrap-command-done

Step 8)   Generate fstab file

The next step will be to generate the fstab file on the /mnt directory as follows.

# genfstab -U /mnt >> /mnt/etc/fstab

Step 9)  Setup timezone

After generating the ftab file, navigate to the newly created root filesystem

# arch-chroot /mnt

You can verify that you are in the root filesystem using the command as shown.

# ls

Time zone information is found in the /usr/share/zoneinfo/ directory. To set your timezone, create a symbolic link to the /etc/localtime

Path.

# ln -sf /usr/share/zoneinfo/US/Pacific /etc/localtime

Next, sync the hardware clock using the command:

# hwclock --systohc

Step 10) Set up locale

The locale determines the system language, currency format, numbering and date on your system. This information is contained in the /etc/locale.gen  file. So, open the file using the vim editor.

# vim /etc/locale.gen

NOTE: To install the vim editor, use the pacman command as follows:

# pacman -Sy vim

Once you have accessed the file, scroll and uncomment your preferred locale. In this case, we have decided to go with en_US.UTF-8 UTF-8

Save and exit the file. Next generate the locale configuration using the command.

# locale-gen

31-generate locale

Next, create a new locale configuration file and save the locale as shown.

# echo "LANG=EN_US.UTF-8" > /etc/locale.conf

32-set-locale-in-locale-conf-file

Step 11)  Set up hostname

Next, we are going to configure the hostname of our Arch System. First, create a new file and specify the hostname as shown.

# echo linuxtechi > /etc/hostname

33-set-hostname

Afterwards, modify the /etc/hosts file as follows.

# echo "127.0.1.1  linuxtechi" >> /etc/hosts

Step 12) Install netctl Network Manager

To use the internet once the installation is complete and upon a reboot, we need to install a network manager. In this example we wil install the netctl network manager as follows

# pacman -Sy netctl

34-install-netctl package

During the installation some optional dependencies for netctl are listed. We are going to install the following dependencies. These are:

  • dhcpcd – For DHCP support
  • wpa-supplicant  – For wireless networking
  • ifplugd  – For wired connections networking

35-optional-dependencies

These dependencies will help you set up networking without a problem when you next boot in to Arch Linux.

To install the optional dependencies, run the command below:

# pacman -Sy dhcpcd wpa-supplicant ifplugd

36-install-dhcpcd-wpa_supplicant-ifplugd

Step 13)  Create a regular user

Next, we will create a regular user called  linuxtechi and place him in the wheel group as follows.

# useradd -G wheel -m linuxtechi

The next step will be to assign a password to the user.

# passwd linuxtechi

37-create-a-user

Step 14)  Install GRUB bootloader

We are getting close to the finish line. In this step, we will install the  grub bootloader to enable us boot into our Arch Linux system upon a reboot.

We will install the grub bootloader package alongside the efi boot manager package since we are using the UEFI mode.

# pacman -S grub efibootmgr

38-Install-grub-efibootmgr

Next, install the os-prober package which will enable Arch Linux to detect the Windows operating system.

# pacman -S os-prober

39-Install-os-prober

Then install grub on the EFI directory as shown.

# grub-install --target=x86_64-efi --efi-directory=/efi --bootloader-id=GRUB

40-install-grub-bootloader

And install a grub configuration file as shown.

# grub-mkconfig -o /boot/grub/grub.cfg

41-generate-grub-file

The last line is an indication that Arch has detected the presence of Windows Boot manager on /dev/sda1 partition. Perfect!

The finally, set a password for the root user as shown.

# passwd

42-set-root-passwd

Then exit and reboot your system.

# exit
# reboot

Step 15)  Boot into Arch Linux

When booting, the GRUB bootloader will display various options including booting into Arch Linux, which is the first option, and also booting into Windows which is the last option in my case.

43-Dual bootscreen

Log in as your regular user as shown

44-login as new user

Step 16)  Post Installation tasks

One of the things I noted when I logged in is that I do not have any internet connection. This is an issue caused by the default dhcp profile settings which need to be modified to accommodate the network interface attached to the Arch Linux system.

To find the interfaces attached run the command:

$ ip link

The output confirms that our network interface is enp0s3

45-network failure

We need to modify the ethernet-dhcp file in the /etc/netctl/examples/ path and edit out network interface.

But first, lets copy the file to the /etc/netctl directory.

Switch to the root user

# su

Copy the ethernet-dhcp file to the /etc/netctl directory.

# cp /etc/netctl/examples/ethernet-dhcp  /etc/netctl/custom-dhcp-profile

Next, navigate to the /etc/netctl directory.

# cd /etc/netctl

Use the vim editor to edit the file.

# vim custom-dhcp-profile

The  interface attribute is set to eth0.

46-Interface-set-to-etho

However, as we saw earlier, our network interface is enp0s3. Therefore, modify it to enp0s3. Additionally, uncomment the line starting with the DHCPClient parameter.

DHCPClient=dhcpcd

This enables the system to accept IP addresses using the dhcp service.

47-modify-custom-profile

Save and exit the configuration file. Next, enable the custom dhcp profile.

# netctl enable custom-dhcp-profile

48-enable dhcp-profile

And finally enable the dhcp service.

# systemctl enable dhcpcd.service

49-Enable dhcpcd service

Your interface should now pick an IP address from the router and you should have an internet connection.

50-verify-internet-connectivy

You can install an X windows system as shown,

$ sudo pacman -S xorg xorg-server

Then install a display  manager. For example, to install GNOME, run:

$ sudo pacman -S gnome

Then start and enable gdm service

$ sudo systemctl start gdm
$ sudo systemctl enable gdm

This brings us to the end of this lengthy topic. Hopefully, you are now in a position to Dual boot Arch Linux with Windows on UEFI system.

Read Also : How to Create and Configure Sudo User on Arch Linux

UPDATE! 10/11/2022 This post has been deprecated. See this post which supersedes it.

I am currently going through another coding camp right now.

Although this environment is not part of the course, it is of benefit to anyone looking for a smarter, more dynamic environment for developing on Windows using Linux.

How I set up Arch Linux for WSL

Windows Subsystem for Linux (WSL) is a way to use Linux on Windows without re-partitioning your hard drive or using a Virtual Machine like Virtual Box.

You need to install something called Hyper-V if you want to use Windows Subsystem for Linux (WSL). It can NOT be installed with Window 10 Home, but should work with Windows 11 Home. This will require a reboot.

Right click on the Windows menu and select «Powershell (Administrative)». If you are using Windows 11, open «Windows Terminal (Administrative)». We will enable Hyper-V in the command line rather than going through a bunch of other Windows like I had to do.

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All

Enter fullscreen mode

Exit fullscreen mode

You probably should enable Hyper-V with the Deployment Image Servicing and Management tool (DISM) to help configure windows and Windows images. This will allow DISM to enable Windows features while the operating system is running.

DISM /Online /Enable-Feature /All /FeatureName:Microsoft-Hyper-V

Enter fullscreen mode

Exit fullscreen mode

When the installation is completed, reboot and come back here.

From the Microsoft Store App, you should install the Windows Terminal application and also Visual Studio Code. If you have Windows 11, you should already have Windows Terminal.

Get a Windows Installer

You should install either Chocolatey or Scoop so you can download some stuff in the command line, especially the NerdFonts that are required for Powerline, Powerlevel10k, and VS Code. These fonts have extra characters that can be used in the Windows Terminal.

I recommend Scoop (scoop) over Chocolatey (choco) because it is better organized. Packages are grouped into «Buckets».

Installing Scoop

Set-ExecutionPolicy ByPass -Scope Process -Force
$env:SCOOP='C:ApplicationsScoop'
$env:SCOOP_GLOBAL='C:GlobalScoopApps'
[Environment]::SetEnvironmentVariable('SCOOP_GLOBAL', $env:SCOOP_GLOBAL, 'Machine')
iex "& {$(irm get.scoop.sh)} -RunAsAdmin"

Enter fullscreen mode

Exit fullscreen mode

Note: we can’t use irm get.scoop.sh | iex, not even in an Administrative PowerShell! (This is why PowerShell sucks!)

If iex "& {$(irm get.scoop.sh)} -RunAsAdmin" doesn’t work, try running irm get.scoop.sh -outfile 'install.ps1' ; .install.ps1 -RunAsAdmin. This will create install.ps1 locally, which you will need to del install.ps1 later.

We need to set the execution policy to Bypass. We could have also used Set-ExecutionPolicy RemoteSigned -Scope CurrentUser which would have set the execution policy to RemoteSigned. You can see what execution policy is used by running Get-ExecutionPolicy.

We should get scoop to work. Let’s update it.

scoop update

Enter fullscreen mode

Exit fullscreen mode

Get the NerdFonts

Because the entire set of NerdFonts is about a couple of gigabytes, you should just get the essential fonts.

I recommend installing these fonts from NerdFonts.

  • Meslo
  • FiraCode
  • FiraMono
  • Hack

We first need to add the nerd-fonts bucket.

scoop bucket add nerd-fonts

Enter fullscreen mode

Exit fullscreen mode

Next install the font packages

scoop install Meslo-NF Meslo-NF-Mono Hack-NF Hack-NF-Mono FiraCode-NF FiraCode-NF-Mono FiraMono-NF FiraMono-NF-Mono

Enter fullscreen mode

Exit fullscreen mode

You should be able to set your Windows terminal to use one of the fonts we installed by going to the settings. A lot of folks are recommending using Meslo.

Installing ArchWSL

We need to get ArchWSL from the extras bucket. Before we run WSL for the first time, we need to set it’s version to version 2. This will use WSL2, which is recommended. We can view what version our Linux distribution is using later with wsl -l -v.

wsl --set-version 2
scoop bucket add extras
scoop install archwsl

Enter fullscreen mode

Exit fullscreen mode

You might have seen a message at the end saying «Even when you are logging in as ‘root’, some operations (like service command) require Windows administrator privileges». This is nothing to worry about. We’re going to do something in a little bit so we don’t have to log in as root directly.

Note: To view what Linux distributions are available, we can use wsl -l. To view version information, we can use wsl -v. Combining -l with -v, we can see what version of WSL we are using and what Linux distribution is being used with wsl -l -v.

We are now ready to take care of some basic tasks to get Arch Linux up and running.

Start by running the Arch.exe program.

Arch.exe

Enter fullscreen mode

Exit fullscreen mode

First lets set our root password with passwd, you could use your windows password, but a different password would be more secure.

NOTE: Bash is set up to show the current username of the user that is logged in, and the machine that you are logged into. This is called the prompt. Later we’ll do some stuff to make it look pretty. I would recommend giving your computer a name instead of "Dell-XPS_13-bunch_of_numbers". You can do that in your Windows setting. For now well, call our PC «Crystal». This will show up if we run the command uname -n.
Our prompt in Bash will also use # if root (the administrator) is logged in and $ if a regular user is logged in.

[root@crystal]# passwd

Enter fullscreen mode

Exit fullscreen mode

Once you have set up your root password, let’s create our regular user and give them permission to use the sudo command that temporarily gives them the power to run root command with the sudo prefix.

[root@crystal]# echo "%wheel ALL=(ALL) ALL" > /etc/sudoers.d/wheel      # This creates the sudoers file
[root@crystal]# useradd -m -G wheel -s /bin/bash jrcharney          # Create a new users. I will set mine for jrcharney
[root@crystal]# passwd jrcharney                        # Set the password for the new user
[root@crystal]# exit                                # Return to powershell

Enter fullscreen mode

Exit fullscreen mode

We need to return to the Powershell for a moment to set the default user.

Arch.exe config --default-user jrcharney                    # Note: Use your username not mine!

Enter fullscreen mode

Exit fullscreen mode

Note: If the above command doesn’t work, try restarting the LxssManager in an Administrative Powershell/Windows Terminal.
Do this by running these two command: net stop lxssmanager then net start lxssmanager
Contrary to what the ArchWSL Setup documentation says, you can’t use && in Powershell. But that’s not going to matter once we get this running.
If that doesn’t work, try restarting the computer, but that should only be a last resort.

Once we have our default user, we can launch Arch again. Thanks to how ArchWSL is set up, Arch will be a option in our dropdown menu on the Windows Terminal, but we can’t set it as the default option. That will still need to be PowerShell because Microsoft.

But that’s no big deal, because the next time we start our Linux terminal, you should see something like this as your user prompt.

[jrcharney@crystal]$

Enter fullscreen mode

Exit fullscreen mode

Congratulations! You now have LINUX installed on Window! This next part will add all those rad toys to it to make it look awesome and a lot less scary.

Set up Arch Linux

If this were actually Arch Linux, we could have used a script called arch_install to knock out some of this stuff. Since we don’t have it, we got to do it manually.

Here’s just the quick summary of everything I ran to get mine set up. The first few packages we install will be the ArchLinux keyring, the base development tools, Git, another package manager called yay that will let us use the ArchLinux User Repo (AUR), and short list of other cool stuff.

Note: I’m not going to write the prompt anymore. Almost everything will be done as your default user, even the sudo commands.

sudo pacman-key --init
sudo pacman-key --populate
sudo pacman -Syu
sudo pacman -S archlinux-keyring                                            # Note: ArchWSL says this is optional, but THIS PACKAGE IS MANDITORY! It should be the first one installed.
sudo pacman -S --needed base-devel git                                      # When you install the `base-devel` package for ArchWSL, `fakeroot` and `fakeroot-tcp` are in conflict. When asked if you want to replace `fakeroot-tcp` with `fakeroot` SAY NO!
sudo git clone https://aur.archlinux.org/yay.git                            # This will install `yay` which will allow you access to the ArchLinux User Repository.
cd yay                                                                      # Go to the yay directory  (TODO: Could I have put this in a Downloads directory?)
makepkg -si                                                                 # Make the `yay` package, this will also install the Go Language (`golang`) that `yay` needs to do stuff.
sudo pacman -S openssh                                                      # Install OpenSSH so we can use SSH.
sudo pacman -S github-cli                                                   # Install this so we can use `gh` to do github command. (TODO: Is there something similar for gitlab?)
sudo pacman -S lolcat                                                       # Install `lolcat` (colorful cat), this will also install the Ruby programming language that it depends on.
sudo pacman -S bat                                                          # `bat` is like `cat`, but it looks better.
sudo pacman -S bat-extras fzf clang llvm rust                               # Some important tools I'll talk about them later.
sudo pacman -S python-pip                                                   # Python needs pip to install some packages
sudo pacman -S lm_sensors psutils python-psutil neofetch bashtop htop       # Install these to show system information and to manage processes in a more user-friendly way
sudo pacman -S figlet cowsay fortune-mod cmatrix nyancat                    # Command line toys, some of them are important that they install some depedencies you'll want to have around.
sudo pacman -S ponysay                                                      # It's like cowsay, only 20% cooler.
yay -S bash-pipes                                                           # One more toy (`pipes.sh`), because the Internet is a Series of Tubes. (Note You can't use `sudo` with `yay` upfront. Yay will ask you for your sudo password later.)
sudo pacman -S imagemagick                                                  # Manipulate images from the command line. You probably won't use it a whole lot, but there's some cool stuff that is important
mkdir bin                                                                   # Add this directory. It should be added to your `$PATH`. You can use this directory to launch scripts that you write to do tasks
mkdir Projects Downloads Documents Sandbox Music Pictures Videos            # Just some placeholder directories. I should really make them softlinks to their Windows counterpart later.
curl wttr.in                                                                # Check to see if we have curl installed by checking the weather!
sudo pacman -S zsh                                                          # Install Zsh
zsh --version                                                               # Show the version of Zsh. (We're still in Bash, but that will change shortly.)
chsh -l                                                                     # Show a list of shells we can change to.  (You can also see this in `/etc/shells`)

Enter fullscreen mode

Exit fullscreen mode

OK, we should be ready to do everything in Zsh from now on.

A few things to note

  • You’ll be asked some questions when you launch Zsh the first time when you run Oh-My-Zsh. I forget what I said, most of these aesthetic. There’s probably a tutorial about it on YouTube.
  • You may be asked some questions to get Powerlevel10K working (at least for Oh-My-Zsh), if not, run p10k.
  • If things don’t have color when you run pacman -Ss, go into the /etc/pacman.conf file and uncomment the line that says Color. Visually, this helps out tremendously.
  • We could have changed the shell to Zsh using chsh -s $(which zsh), but there was a problem getting that done. Fortunately we can do this with Oh-My-Zsh
sh -c "$(curl -fsSL http://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"     # Install Oh-My-Zsh.  (I should have used `yay -S oh-my-zsh-git` but this works just as well.)  (If it asks if you want to change the default shell to Zsh, say yes!)
yay -S --noconfirm zsh-theme-powerlevel10k-git                                          # Install the powerlevel10k them for zsh.
echo 'source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme' >> ~/.zshrc    # Use the Powerlevel10K theme in Zsh. (You could use it in Bash too, but I'm not going to do that.)
exec zsh                                                                                # Restart zsh
p10k configure                                                                          # Configure the Powerlevel10k prompt.
sudo pacman -S tmux                                                                     # Install the terminal multiplexer. (We'll have some basic stuff set up in `~/.tmux.conf`)
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm                       # Install the TMUX plugin manager.
sudo pacman -S powerline                                                                # Install powerline. The command to enable it for tmux should be in `~/.tmux.conf`.
sudo pacman -S lsd                                                                      # Use lsd (not that LSD! This one make the ls command look cool.) (I added commands to ~/.bash_aliases to use it.)
sudo pacman -S jq                                                                       # Command-line JSON processor. This will be useful later. (There's also `hq` and `yq`, but I haven't tried those yet.)
sudo pacman -S neovim                                                                   # Neovim is something I'm adding. It's basically a text editor based on Vim, but all the plugins are written in Lua. This should also install Lua.
sudo pacman -S python-neovim                                                            # Python 3 plugin support for Neovim
sudo pacman -S zsh-autosuggestions                                                      # Enable auto suggestions in Zsh
sudo pacman -S zsh-syntax-highlighting                                                  # Enable syntax highlighting. You will need to add a line to to bottom of your `~/.zshrc` file.

Enter fullscreen mode

Exit fullscreen mode

To Activate zsh-syntax-highlighting, add the following line to the end of ~/.zshrc

source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

Enter fullscreen mode

Exit fullscreen mode

My Github repo should contain

  • ~/.bash_aliases
  • ~/.tmux.conf
  • ~/.bashrc
  • ~/.zshrc
  • ~/.p10k.zsh

You should also run VS Code from this environment for the first time such that both applications become familiar with each other.

code .          # That is "code" space "period"

Enter fullscreen mode

Exit fullscreen mode

This will install what WSL and VS Code needs to work with each other.

TODO: How do I set WSL/Arch as the default terminal for VS Code?

Anything else, I’ll probably tack on here later. I do have some dotfiles you can download to run some other tasks.

Congratulations! You’re ready to code like a pro!

Taskwarrior (optional)

There’s one thing I would suggest doing if you are doing software development: Install taskwarrior. This is useful because you can write down tasks for things you can do while working on project. Personally, I’m more of a Trello person because Kanban is awesome and can be used for more than just computer development. I used it to help me list all the things I need to do when I moved into my apartment a few months ago. It’s that versatile.

You could also use something like Notion, which as a Markdown editor, but in terms of Markdown editors, I prefer Typora ($15) because it supports Mermaid where you can generate UML diagrams and other charts and uses MathJax for LaTeX support. You can also embed HTML and SVG and generate a preview of what the code looks like.

To install Taskwarrior, install the task package.

sudo pacman -S task

Enter fullscreen mode

Exit fullscreen mode

We can also install a couple of terminal interface programs such as taskwarrior-tui and vit. I will add that.

sudo pacman -S taskwarrior vit

Enter fullscreen mode

Exit fullscreen mode

There is also a command-line time tracking app called timewarrior (timew) that integrate with task.

sudo pacman -S timew

Enter fullscreen mode

Exit fullscreen mode

Because we installed powerlevel10k earlier, if we add a task, an item should appear showing how many tasks you have on the right side. If it doesn’t show up, you may need to restart ArchWSL or check ~/.p10k.zsh to make sure that the segment is enabled.
In fact, Powerlevel10k has many segments that can be useful. You should enable the ones you know that you will need as enabling all of them will be taxing to your system resources.

The first time you run task you will be told that a configuration file could not be found and asked if you would like to create a sample one. Say yes to it.
Similarly, if you run timew the first time, it will also ask of you would like to create a new database file. Also say yest to that.

I wanted to install Taskell (taskell), which is a command-line Kanban board written in Haskell, but for some reason, the taskell package would not download. Which is unfortunate considering it could be integrated with Trello and Github and it used Markdown. It is quite unfortunate and will need to be brough up at a later date.

So, this is the part where the Coding Boot Camp picks up. Good luck!

Dual Boot Installation of Arch Linux with Preinstalled Windows 10 with Encryption

Notes About Some Basics

  1. General instruction from Arch wiki.

    Dual boot with Windows – ArchWikiDual boot with Windows – ArchWiki Mind that there is no need to create an additional EFI System Partition, since it already exists (see above): when required, mount this to
    /boot, install your bootloader to it and save the entry in
    /etc/fstab. read more.

  2. Partitioning

    Size and tools go to – here

  3. Partition table types

    If you are installing alongside an existing installation (i.e. dual-booting), a partition table will already be in use. If the devices are not partitioned, or the current partitions table or scheme needs to be changed, you will first have to determine the partition tables (one for each device) in use or to be used.

    There are two types of partition table:

    • GPT -gpt
    • MBR -msdos

    Any existing partition table can be identified with the following command for each device:

    For GPT, you are looking for “Partition Table: GPT”. For EFI, you are looking for a small (512 MiB or less) partition with a vfat file system and the boot flag enabled. On it, there should be a directory named “EFI”. If these criteria are met, this is your ESP. Make note of the partition number. You will need to know which one it is, so you can mount it later on while installing GRUB to it.

  4. Partitioning tools

    For each device to be partitioned, a proper tool must be chosen according to the partition table to be used. Several partitioning tools are provided by the Arch installation medium, including:

    parted GPT and MBR
    fdisk, cfdisk, sfdisk GPT and MBR
    gdisk, cgdisk, sgdisk GPT
  5. INSTALL ARCHLINUX ON IDEAPAD Y700 some notes on ideapad Y700, http://mkeswani.blogspot.com/2015/12/install-archlinux-on-ideapad-y700.html
  6. Yet another tutorial with preinstalled windows 8 https://gist.github.com/miguelfrde/5dde43aa08b076106b9e
  7. Partition Type ID https://en.wikipedia.org/wiki/Partition_type#PID_83h 0x83 native to Linux
  8. The best way to detect windows boot mode Most of the linux bootloaders installed for one firmware type cannot launch or chainload bootloaders of other firmware type.

    http://www.eightforums.com/tutorials/29504-bios-mode-see-if-windows-boot-uefi-legacy-mode.html

    • Boot into Windows
    • Press Win key and ’R’ to start the Run dialog
    • In the Run dialog type “msinfo32” and press Enter
    • In the System Information windows, select System Summary on the left and check the value of BIOS mode item on the right
    • If the value is UEFI, Windows boots in UEFI-GPT mode. If the value is Legacy, Windows boots in BIOS-MBR mode.

Prepare Preinstalled Windows

Shrink some space for Linux in Windows

  1. Make some space for Arch Linux in Windows
  2. Win+R and type diskmgmt.msc and hit enter shrink one of the partitions. I also delete the two partitions for reserved for recovery. Want to put a new SSD HD in, I do not have the connecting cable and bracket for the moment.

    lenova-hd.JPG

  3. Make a bootable installation media for Arch Linux
  4. This laptop doesn’t have any CD/DVD drive so the first thing is to make a bootable USB drive.

    Boot into Windows 10. In Windows, download archlinux iso from the following website

    www.archlinux.org/download

    Use the mirror which is closest to you and download the dual iso. archlinux-2015.12.01-dual.iso

    Download Rufus from the following location https://rufus.akeo.ie/

    Plugin any usb drive/pendrive in your usb port. Make sure that you backup data from this usb drive

    rufus_en.png

  5. Attach it to your computer

Turn off Windows fast boot and secure boot

  1. Shutdown Windows after disabling fast start following instruction here or here. And use the command shutdown -s -t 0 to do so.
  2. Restart windows by clicking on Power -> Restart. Make sure that when hitting restart, you are press down Shift key Windows will give you options for Troubleshoot/Adanced Options/UEFI Firmware/

    lenova-1.JPG

    lenovo-1.JPG

    lenovo-3.JPG

    1. Once you restart your machine you should be able to see the BIOS settings.

      Under Configuration you should disable Intel Fast boot, disable SecureBoot (more here). Make sure you change the settings for Graphics from Switchable to Internal. This is needed only to install, you can then modify it later. Save the changes and exit.

  3. Once the machine restarts press and hold F12 key.

    This will give you option to boot from various available devices and your USB drive would be one of them

    lenovo-4.JPG

  4. Select your USB drive to boot
  5. Select the UEFI boot mode when you see the ArchLinux boot screen.

    lenovo-5.JPG

    Once the usb has booted you will see the root prompt.

Partition HD with Live CD

Load keyboard layout

$ loadkeys la-latin1

Connect to the internet (Wi-Fi)

rfkill unblock wifi # I need to do this for Lenovo Ideapad

$ iw dev    # Get the interface name

$ wifimenu <wifi_interface_name>

ping google.com # check internet

Creat Partitions for boot, swap and root

  1. Boot into Arch Linux Installation media in UEFI Mode.
  2. Create three partitions in that empty space: (a) boot 200MB (b) Swap 8GB (c) Root Partition

    1

    2

    3

    4

    5

    6

    7

    8

    9

    10

    11

    12

    13

    14

    15

    16

    17

    18

    19

    20

    21

    gdisk /dev/sda

    n #Wanna create new partition!

    #Hit enter, don’t care about partition number

    #Hit enter, automatically first sector will be starting of unallocated space

    +200MB #Specify the size of the boot partition

    8300 #Hex code for the Linux boot partition.

    n #Wanna create new partition!

    #Hit enter, don’t care about partition number

    #Hit enter, automatically first sector will be starting of unallocated space

    +8GB #Specify the size of the swap partition

    8300 #Hex code for the Linux boot partition.

    n #Wanna create new partition!

    #Hit enter, don’t care about partition number

    #Hit enter, automatically first sector will be starting of unallocated space

    #Hit enter, automatically take the rest of space

    8300 #Hex code for the Linux boot partition.

    w #Write changes to disk

    Y #Confirm!

    Type gdisk l /dev/sda to find out the partition number of the

    swap partition. In my case, it is 5.

    The final partition table in my case:

    $ lsblk

    NAME          MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT

    sda             8:0    0   477G  0 disk  

    ├─sda1          8:1    0   260M  0 part  /boot/efi

    ├─sda2          8:2    0    16M  0 part  

    ├─sda3          8:3    0 234.2G  0 part  

    ├─sda4          8:4    0   200M  0 part  /boot

    ├─sda5          8:5    0     8G  0 part  [SWAP]

    ├─sda6          8:6    0 187.1G  0 part  

    └─cryptroot 254:0    0 187.1G  0 crypt /

    ├─sda7          8:7    0    25G  0 part  

    ├─sda8          8:8    0  1000M  0 part  

    ├─sda9          8:9    0  20.2G  0 part  

    └─sda10         8:10   0  1000M  0 part  

Encrypt the root partition with LUKS Link

Preparing the disk

chech the info about dm-crypt module

dm-cryptwipe on an empty disk or partition

First, create a temporary encrypted container on the partition (sdXY) or the full disk (sdX) you want to encrypt, e.g. using default encryption parameters and a random key via the –key-file /dev/{u}random option (see also Random number generation):

# cryptsetup open —type plain /dev/sdXY container —key-file /dev/random

Second, check it exists

# fdisk -l

Disk /dev/mapper/container: 1000 MB, 1000277504 bytes

...

Disk /dev/mapper/container does not contain a valid partition table

Finally, wipe it with pseudorandom (because encrypted) data. A use of if=/dev/urandom is not required as the encryption cipher is used for randomness.

# dd if=/dev/zero of=/dev/mapper/container status=progress

// dd: writing to ‘/dev/mapper/container’: No space left on device

Preparing non-boot partitions

The following commands create and mount the encrypted root partition. They correspond to the procedure described in detail in Dm-crypt/Encrypting a non-root file system#Partition (which, despite the title, can be applied to root partitions, as long as mkinitcpio and the boot loader are correctly configured). If you want to use particular non-default encryption options (e.g. cipher, key length), see the encryption options before executing the first command:

# cryptsetup -y -v luksFormat /dev/sdaX

# cryptsetup open /dev/sdaX cryptroot

# mkfs -t ext4 -L «Arch Linux» /dev/mapper/cryptroot #or, mkfs.ext4

# mount -t ext4 /dev/mapper/cryptroot /mnt

Type
gdisk l /dev/sda to find out the partition number of the newly created partition and EFI partition.

Check the mapping works as intended:

# umount /mnt

# cryptsetup close cryptroot

# cryptsetup open /dev/sdaX cryptroot

# mount -t ext4 /dev/mapper/cryptroot /mnt

If you created separate partitions (e.g. /home), these steps have to be adapted and repeated for all of them, except for /boot. See Dm-crypt/Encrypting a non-root file system#Automated unlocking and mounting on how to handle additional partitions at boot.

Note that each blockdevice requires its own passphrase. This may be inconvenient, because it results in a separate passphrase to be input during boot. An alternative is to use a keyfile stored in the system partition to unlock the separate partition via crypttab. See Dm-crypt/Device encryption#Using LUKS to Format Partitions with a Keyfile for instructions.

Prepare Swap partition

mkswap L «Linux Swap» /dev/sda5 #Linux Swap is the label

swapon /dev/sda5 #Turn on swap!

free m #Last line will confirm whether swap space has been

turned on or not.

Preparing the boot partition

What you do have to setup is a non-encrypted /boot partition, which is needed for a crypted root. For a standard MBR/non-EFI /boot partition, for example, execute:

# mkfs -t ext4 /dev/sdaY

# mkdir /mnt/boot

# mount -t ext4 /dev/sdaY /mnt/boot

Find and mount the efi partition to /mnt/boot/efi

mkdir p /mnt/boot/efi

#Type gdisk -l to figure out the partition number of the existing EFI partition for MS Windows.

mount /dev/sda1 /mnt/boot/efi

If you want to encrypt boot partition (with GRUB), see here; I did not do it.

Format the partition into filesystems.

  1. Mount the partition in which Arch Linux files will be present to /mnt

    mount /dev/mapper/cryptroot /mnt

  2. Use pacstrap to initialize the Arch Installation If you are behind a proxy server, type: export http_proxy=http://proxy_ip_or_domain:proxy_port

    pacstrap /mnt base <basedevel>

  3. mount EFI partition

    mkdir p /mnt/boot/efi

    mount /dev/sda1 /mnt/boot/efi

  4. Generate the fstab, so that required partitions are mounted on reboot.

    genfstab U p /mnt >> /mnt/etc/fstab

  5. Make sure that
    /boot and
    /boot/efi are listed; add them manually if not.

    nano /mnt/etc/fstab

    # /dev/mapper/cryptboot LABEL=Arch134x20Linux

    UUID=1de833a936b84bab91d665360080e71c       /               ext4            rw,relatime,data=ordered  0 1

    # /dev/sda4

    UUID=bd82cb167b654d39bcca186edd33bddd       /boot           ext4            rw,relatime,data=ordered  0 2

    # /dev/sda1 LABEL=SYSTEM_DRV

    UUID=46062DA8          /boot/efi       vfat            rw,relatime,fmask=0022,dmask=0022,codepage=437,ioc ...

    # /dev/sda5 LABEL=Linux134x20Swap

    UUID=3c8c0892f275485f9ea54f87f34d4e76       none            swap            defaults        0 0

    use the following to retrieve UUID:

    ls l /dev/disk/byuuid/

    lrwxrwxrwx 1 root root 10 May  4 21:57 0C5E30345E3018C2 -> ../../sda6

    lrwxrwxrwx 1 root root 10 May  4 21:46 12429E3A429E2311 -> ../../sdb3

    lrwxrwxrwx 1 root root 10 May  4 21:57 12A013A6A0138F7B -> ../../sda5

    lrwxrwxrwx 1 root root 11 May  4 21:57 1de833a936b84bab91d665360080e71c -> ../../sda10

    lrwxrwxrwx 1 root root 10 May  4 21:57 3c8c0892f275485f9ea54f87f34d4e76 -> ../../sda9

    lrwxrwxrwx 1 root root 10 May  4 21:57 46062DA8 -> ../../sda1

    ...

How to change LUKS passphrase

The followings are adapted from here.

In LUKS scheme, you have 8 “slots” for passwords or key files. First, check, which of them are used:

cryptsetup luksDump /dev/<device> |grep BLED

Then you can add, change or delete chosen keys:

cryptsetup luksAddKey /dev/<device> (/path/to/<additionalkeyfile>)

cryptsetup luksChangeKey /dev/<device> S 6

As for deleting keys, you have 2 options:

  1. delete any key that matches your entered password:

    cryptsetup luksRemoveKey /dev/<device>

  2. delete a key in specified slot:

    cryptsetup luksKillSlot /dev/<device> 6

Arch and Grub Installation after chroot in.

  1. chroot into the arch installation (from live CD).

    archchroot /mnt [/bin/bash]

  2. Configure timezone, generate initial RAM disk. #Chang password for root user

    passwd

    ln s /usr/share/zoneinfo/America/Los_Angeles /etc/localtime

  3. Install the bootloader – grub.

    Install the packages grub and efibootmgr. GRUB is the bootloader, efibootmgr creates bootable .efi stub entries used by the GRUB installation script.

    pacman Syu grub efibootmgr [dosfstools]

Generate the main configuration file

  1. Make sure all partitions are mounted, i.e.
    /
    /boot
    /boot/efi

    1

    2

    3

    4

    5

    6

    7

    8

    9

    10

    11

    12

    13

    14

    15

    16

    17

    mount a

    lsblk

    NAME          MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT

    sda             8:0    0   477G  0 disk  

    ├─sda1          8:1    0   260M  0 part  /boot/efi

    ├─sda2          8:2    0    16M  0 part  

    ├─sda3          8:3    0 234.2G  0 part  

    ├─sda4          8:4    0    25G  0 part  

    ├─sda5          8:5    0  1000M  0 part  

    ├─sda6          8:6    0  20.2G  0 part  

    ├─sda7          8:7    0  1000M  0 part  

    ├─sda8          8:8    0   200M  0 part  /boot

    ├─sda9          8:9    0     8G  0 part  [SWAP]

    └─sda10         8:10   0 187.1G  0 part  

    └─cryptroot 254:0    0 187.1G  0 crypt /

  2. Intial Ramdisk Environment

    Add the encrypt hook to mkinitcpio.conf: link here

    etc/mkinitcpio.conf

    HOOKS=«… encrypt … filesystems …»

  3. update /etc/default/grub

    GRUB_CMDLINE_LINUX_DEFAULT=«i915.preliminary_hw_support=1»

    GRUB_ENABLE_CRYPTODISK=y

    GRUB_CMDLINE_LINUX=«cryptdevice=UUID=1de833a936b84bab91d665360080e71c:cryptroot root=/dev$

  4. install os-prober, only detect the correct Windows boot after boot into Linux, not from chroot with live CD.
  5. configure grub

    The following steps install the GRUB UEFI application to $esp/EFI/grub, install its modules to /boot/grub/x86_64-efi, and place the bootable grubx64.efi stub in $esp/EFI/grub.

    First, tell GRUB to use UEFI, set the boot directory and set the bootloader ID. Mount the ESP partition to e.g. /boot or /boot/efi and in the following change $esp to that mount point (usually /boot):

    # grub-install —target=x86_64-efi —efi-directory=/boot/efi —bootloader-id=grub

    The –bootloader-id is what appears in the boot options to identify the GRUB EFI boot option; make sure this is something you will recognize later. The install will create a directory of the same name under $esp/EFI/ where the EFI binary bootloader will be placed.

    grubmkconfig o /boot/grub/grub.cfg #Generate initial grub config.

    Now, let’s add Windows to the GRUB menu. Edit /boot/efi/EFI/grub/grub.cfg and add the following menuentry after the Arch Linux menuentries [Note: grub boot loader does not locate Windows OS, but this is necessary for grub to load Arch Linux in my case. After I boot into arch linux, I ran
    sudo osprober and update grub config.] See here for details.

    if [ «${grub_platform}» == «efi» ]; then

        menuentry «Microsoft Windows Vista/7/8/10 UEFI-GPT» {

            insmod part_gpt

            insmod fat

            insmod search_fs_uuid

            insmod chain

            search fsuuid set=root $hints_string $fs_uuid

            chainloader /EFI/Microsoft/Boot/bootmgfw.efi

        }

    fi

    and update the string with following output:

    $latex hints_string with the output of
    $ grubprobe target=fs_uuid /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi
    $latex fs_uuid with the output of
    $ grubprobe target=hints_string /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi

Unmount and Reboot

Finish Up Arch Linux Installation

  1. Install the desktop environment, display manager, and vim and xterm. packman -Syu gnome-desktop xterm vim gnome-display-manager systemctl enable gdm #Start gdm on boot
  2. Create a new user and add him to the group wheel. useradd -G wheel -s /bin/bash -m -c “Nehal J Wani” wani passwd wani
  3. Reboot into Arch Linux
  4. Install os-prober. Regenerate grub configuration. Reboot.

    pacman Syu osprober

    sudo osprober

    #/dev/sda1@/EFI/Microsoft/Boot/bootmgfw.efi:Windows Boot Manager:Windows:efi

    grubmkconfig o /boot/grub/grub.cfg

    Done! Now you can choose between Windows and Arch Linux at the start. Yay!

Install Arch Linux

  1. Retrieve package list from another system To create a list of all official repository installed packages do:

    $ pacman Qqe | grep v «$(pacman -Qqm)» > /mnt/backup/pkglistoff.txt

    To create a list of all local installed packages do (includes packages installed from the AUR):

    $ pacman Qqm > /mnt/backup/pkglistloc.txt

  2. install package in new system To reinstall packages using the backup package list:

    pacman needed  S < /mnt/backup/pkglistoff.txt

    #use pacaur or yaourt for local packages

  3. Restore configuration with instruction here (use rsync with -a to mantain symlinks).
  4. install python modules

    pip freeze > pipfile #populate list

    pip install r pipfile

  5. install node.js modules

    npm list g depth=0 >npm  #or

    ls `npm root g` >npmglobal

  6. The new system

    archer-screen.png

Some further tweaks

Wifi fix

modprobe rfv ideapad_laptop #needed for internet connection

Next is to make sure that we unblock hw killed wifi due to the above module

rfkill list

rfkill unblock all

modprobe rfv iwlmvm

modprobe fv iwlmvm

wifimenu

/etc/modprobe.d/blacklist.conf

Add the following lines

blacklist ideapad_laptop

blacklist nouveau

Customize Grub

install
grubcustomizer with pacman, and customize grub loader

grub-customizer-gui.png

starfield theme is chosen here.

grub-customizer-gui1.png

lenovo-7.JPG

Bumblebee Switch the Graphics Card

Bluetooth

Encrypting a non-root file system

You can encrypt a secondary filesystem from a partition to protect only sensitive data. The following shows how to create a common partition for all user’s /home directories.

  1. First, make sure the partition is empty (has no file system attached to it). Delete the partition and create an empty one if it has a file system.

    Create the partition which will contain the encrypted container.

  2. Then setup the LUKS header with the following:

    # cryptsetup options luksFormat device

    Replace
    device with the previously created partition.

    To gain access to the encrypted partition, unlock it with the device mapper, using:

    # cryptsetup open device name

    After unlocking the partition, it will be available at
    /dev/mapper/name. Now create a file system of your choice with:

    # mkfs.fstype /dev/mapper/name

  3. Mount the file system to
    /home, or if it should be accessible to only one user to
    /home/username Tip: Unmount and mount once to verify that the mapping is working as intended.
  4. To mount the partition manually:

    # cryptsetup open device name

    # mount -t fstype /dev/mapper/name /mnt/home

  5. To unmount it manually:

    # umount /mnt/home

    # cryptsetup close name

Mount at boot automatically

  1. generate key file

    # cryptsetup luksAddKey /dev/<device> -S 6

    Enter any passphrase:

    Enter new passphrase for key slot:

    Verify passphrase:

  2. create crypttab If the keyfile for a secondary file system is itself stored inside an encrypted root, it is safe while the system is powered off and can be sourced to automatically unlock the mount during with boot via
    crypttab. For example, unlock a crypt specified by UUID:

    /etc/crypttab

    homecrypt    UUID=UUIDidentifier    /etc/mykeyfile

  3. then add it to fstab Then use the device mapper’s name (defined in
    /etc/crypttab) to make an entry in
    /etc/fstab:

    /etc/fstab

    /dev/mapper/homecrypt        /home   ext4        defaults        0       2

2

MAR


Download Article


Download Article

Do you want to install Arch Linux, but you don’t want to give your current operating system? Not all programs work for Linux. You may want to keep a copy of your current operating system for the most flexibility. Arch Linux is an extremely lightweight Linux distribution intended for advanced users. Installing and using Arch Linux requires a little bit of time and familiarity with Linux commands. However, going through the process is very rewarding and you will likely learn a lot about how Linux is structured. This wikiHow teaches you how to install an Arch Linux dual boot.

  1. Image titled Install Arch Linux Dual Boot Step 1

    1

    Check your System Specs. Arch Linux is an incredibly lightweight system that doesn’t need a lot to run. However, it does have a few system requirements. You can check your system specs using one of the following steps:[1]
    [2]
    [3]

    • Windows: Open the Windows Start menu. Then click the Settings/Gear icon. Click the System option. Then click About.
    • Mac: Click the Apple Icon in the menu bar at the top. Then click About this Mac.
    • Linux: Open the Terminal or command line and type «hwinfo» and press Enter.
  2. Image titled Install Arch Linux Dual Boot Step 2

    2

    Ensure you have a UEFI motherboard. Most modern computers have UEFI motherboards. However, if you are using a particularly old computer, your motherboard may only be using legacy BIOS. If this is the case, you can still install Arch Linux, but the process may be different than what is covered in this wikiHow article.

    Advertisement

  3. Image titled Install Arch Linux Dual Boot Step 3

    3

    Ensure you have a 64-bit Processor. Arch Linux is designed to work with x86-64 architectures. Make sure you have a 64-bit processor.[4]

  4. Image titled Install Arch Linux Dual Boot Step 4

    4

    Ensure you have a minimum of 1 GB RAM. Arch Linux only needs 512 MB of RAM to run. However, you will need more than 512 MB of RAM to run the bootable Live media disk needed to install Arch Linux.

  5. Image titled Install Arch Linux Dual Boot Step 5

    5

    Ensure you have a minimum of 2 GB of hard drive space. The Arch Linux install is less than 2 GB. However, you will want to allow some extra space to install apps and programs. You will need to partition your hard drive to create space to install Arch Linux. It is recommended you allocate at least 10 GB of hard drive space for Arch Linux.

  6. Image titled Install Arch Linux Dual Boot Step 6

    6

    Ensure you have enough hard drive space for a swap space partition. In addition to a standard partition for your Linux installation and file system, Linux also uses swap space when your memory gets full. The amount of swap space you need depends on how much RAM your computer has.

    • If you have less than 2GB of RAM, it is recommended you allocate double the amount of RAM you have for your swap space. If you have between 2 — 8 GB of RAM, you can allocate swap space that is equal to the amount of RAM you have. If you have greater than 8 GB of RAM, it is recommended you allocate a minimum of 4GB of RAM for swap space. Enter the amount of swap space you want to allocate (i.e. «4G») and press Enter.
  7. Image titled Install Arch Linux Dual Boot Step 7

    7

    Ensure you have an internet connection. It is crucial that you have an internet connection when installing Linux. You can use a Wi-Fi connection, but a wired connection will be much easier to use during the installation process.

  8. Advertisement

  1. Image titled Install Arch Linux Dual Boot Step 8

    1

    Aquire a USB drive. It is recommended you use a USB drive that has at least 4 GB of storage space on it.

    • Note: Formatting the USB drive will erase all data on the USB drive. So make sure you back up all data you wanna keep before formatting the hard drive.
  2. Image titled Install Arch Linux Dual Boot Step 9

    2

    Download the Arch Linux ISO file. Alternatively, if you want an easier way to install Arch Linux, you can download the Calam Arch installer from here. The Calam Arch installer uses a graphical user interface and allows you to pick your own packages and desktop environment. More advanced users can use the following steps to download the official Arch Linux ISO file.

    • Go to https://archlinux.org/download/
    • Scroll down and click a link below your country.
    • Click the Arch Linux ISO file at the top.
  3. Image titled Install Arch Linux Dual Boot Step 10

    3

    Download Balena Etcher. Balena Etcher is a free program that can write an ISO file to a USB disk to create a bootable USB drive. Use the following steps to download Balena Etcher:

    • Go to https://www.balena.io/etcher/ in a web browser.
    • Click the green download button to download Etcher for your operating system.
    • Open the BalenaEtcher setup file in your web browser or Downloads folder.
    • Click I Agree to agree to the license agreement.
  4. Image titled Install Arch Linux Dual Boot Step 11

    4

    Insert your USB drive. This is the USB drive you will use to install Arch Linux. Insert it into any free USB port on your computer.

  5. Image titled Install Arch Linux Dual Boot Step 12

    5

    Open Balena Etcher. It has an icon that resembles a green cube. Click the Balena Etcher icon to open Balena Etcher.

    • Alternatively, you can use Rufus to flash a USB drive.
  6. Image titled Install Arch Linux Dual Boot Step 13

    6

    Click Flash from File. It’s the blue button on the left. Click this option to select an ISO file.

  7. Image titled Install Arch Linux Dual Boot Step 14

    7

    Select the ISO file. You can select the Arch Linux file or the Calam Arch installer file. They are most likely in your Downloads folder. Select the file and click Open.

  8. Image titled Install Arch Linux Dual Boot Step 15

    8

    Click Select Target. It’s the blue button in the middle. This allows you to select a USB drive.

  9. Image titled Install Arch Linux Dual Boot Step 16

    9

    Select your USB drive and click Select. Click your USB drive in the menu and click the blue button that says «Select» in the lower-right corner.

  10. Image titled Install Arch Linux Dual Boot Step 17

    10

    Click Flash. It’s the blue button on the right. This starts flashing the ISO file to your USB drive. Allow a few minutes for the process to complete. Once the process is complete. you can use the USB drive to boot your PC.

  11. Advertisement

  1. Image titled Avoid Miscommunication in Emails Step 10

    1

    Decide how much hard drive space you need. Arch Linux needs a minimum of 2 GB to install. You will probably want to create some extra hard drive space for apps and files. It is recommended you allocate at least 10 GB of hard drive space for Arch Linux. Also, keep in mind that you will be creating a separate swap space partition during the installation process. Make sure you include the amount of swap space you need in your Linux partition.

  2. Image titled Install Arch Linux Dual Boot Step 19

    2

    Partition your Windows hard drive. In Windows, you can do so using the Disk Management utility. Do not partition the EFI System partition or the Recovery partition. Use the following steps to partition your hard drive in Windows:

    • Click the Windows Start menu.
    • Type «Disk Management».
    • Click Create and format hard disk partitions.
    • Right-click your Windows partition.
    • Click Shrink Volume and wait for it to query your hard drive.
    • Enter the amount of space you want to allocate in MB (i.e. 10000 for 10 GB) in the third box down.
    • Click Shrink
  3. Image titled Install Arch Linux Dual Boot Step 20

    3

    Partition your Mac hard drive. On Mac, you can partition your hard drive using Disk Utility. You will also need to select «ext4» as the file system. Use the following steps to partition your hard drive on Mac:[5]

    • Click the magnifying glass icon in the upper-right corner.
    • Type «Disk Utility» in the search bar.
    • Click Disk Utility.app.
    • Select your main hard drive in the menu to the left.
    • Click the plus (+) icon below the pie chart.
    • Click Add Partition.
    • Type a name for the partition.
    • Click the Format pop-up menu and select «ext4» as the format.
    • Enter the size of the partition or click and drag the control dot in the pie chart.
    • Click Apply
    • Click Continue.
    • Click Done.
  4. Image titled Install Arch Linux Dual Boot Step 21

    4

    Partition a disk drive in Linux. In Linux, you will need to use the Terminal or command line to partition a disk drive. You will need to identify which hard drive you want to partition. Then you will need to create a label for the partition and then enter the command to partition the hard drive. Use the following steps to partition a hard drive in Linux:[6]

    • Press Ctrl + Alt + T to open the Terminal or command line.
    • Type sudo parted -l and press Enter to display a list of hard drives.
    • Identify which hard drive you want to partition.
    • Note the path next to «Disk» (i.e. «/dev/sda»).
    • Type sudo parted [path to disk] and press Enter (i.e. «sudo parted /dev/sda»)
    • Type mklabel gpt and press Enter to set a disk label as «gpt.»
    • Type {{kbd|mkpart primary ext4 1 MB xx GB]] and press Enter. Replace «xx» with the number of GB you want to allocate to the new partition.
  5. Advertisement

  1. Image titled Install Arch Linux Dual Boot Step 22

    1

    Boot your PC into the BIOS menu (Windows and Linux only). To boot into the BIOS, start by rebooting your PC. You’ll need to press one of the function keys on your keyboard as your computer reboots. Which button you need to press varies between different computer models. It will usually say which button to press in the lower-right comer. If your computer boots up too fast, you can use the following steps to boot into the BIOS in Windows:

    • Click the Windows Start menu.
    • Click the Settings/Gear icon.
    • Click Update & Security.
    • Click Recovery in the menu to the left.
    • Click Restart under «Advanced Setup.»
    • Click Troubleshoot.
    • Click Advanced Options.
    • Click UEFI Firmware Settings.
    • Click Restart.
  2. Image titled Install Arch Linux Dual Boot Step 23

    2

    Locate the boot order settings in the BIOS menu. The BIOS menu is arranged differently depending on the make and model of your motherboard. Use the arrow keys on the keyboard to navigate the BIOS menu. Press Enter to make a selection. The boot order section is usually listed under «Boot» or something similar. Locate the boot order options in the BIOS menu.

  3. Image titled Install Arch Linux Dual Boot Step 24

    3

    Make sure the USB drive is first in the boot order. This ensures your computer will attempt to boot from the USB drive before booting into your main operating system. If no USB drive is inserted, your computer will boot into your operating system as normal. Follow the instructions on your BIOS menus to change the boot order of your drives.

  4. Image titled Install Arch Linux Dual Boot Step 25

    4

    Save your BIOS settings and restart. After changing the boot order, locate the option to Save your BIOS Settings and exit. It will usually say Save and Exit or something similar.

  5. Image titled Install Arch Linux Dual Boot Step 26

    5

    Insert your Arch Linux USB installation drive and boot up your PC. Now that your BIOS is set to boot from a USB drive first, your system will boot Arch Linux live from the USB drive instead of booting into your normal operating system.

    • Mac Users: If you are using a Mac, restart your Mac. When you hear the startup sound, press and hold the Option key. The Startup Manager will start scanning for other devices it can boot from.
  6. Advertisement

  1. Image titled Install Arch Linux Dual Boot Step 27

    1

    Select Arch Linux archiso x86_64 UEFI CD. It’s the first option in the Arch Linux startup menu. Use the arrow keys to navigate the menu. Press Enter to make a selection. It do a brief system check and then it will display the command line.

  2. Image titled Install Arch Linux Dual Boot Step 28

    2

    Type ls /sys/firmware/efi/efivars and press Enter. This should display a list of items in the EFI firmware directory. This confirms that you are using a UEFI motherboard. If you receive an error message that the directory does not exist, you are not using a UEFI motherboard and you will need to use a different installation process.

  3. Image titled Install Arch Linux Dual Boot Step 29

    3

    Type ping google.com and press Enter. This will ping the Google server several times and display the time it took to connect. This confirms that you have an internet connection. Press Ctrl +C to stop pinging. If you are not connected to the internet, you can connect to your modem or router directly using an Ethernet cable, or you can use the following steps to connect to Wi-Fi:[7]

    • Type iwctl and press Enter.
    • Type device list and press Enter to display a list of network interfaces.
    • Type station [interface name] scan to scan for Wi-Fi networks. Replace «[interface name]» with the interface you want to use (i.e. «station wlan0 scan».)
    • Type station [interface name] get-networks and press Enter to display a list of networks.
    • Type station [interface name] connect [Wi-Fi Network Name] and press Enter. Replace «[Wi-Fi Network Name]» with your network SSID.
    • Enter your Wi-Fi password and press Enter.
    • Type station [interface name] show and press enter to confirm you are connected to Wi-Fi.
    • Type exit and press Enter to exit iwctl.
  4. Image titled Install Arch Linux Dual Boot Step 30

    4

    Type timedatectl set-ntp true and press Enter. This updates and sets the system time and date.

    • You can confirm the system time and date by typing timedatectl status and pressing Enter.
  5. Advertisement

  1. Image titled Install Arch Linux Dual Boot Step 31

    1

    Type cfdisk and press Enter. This displays a list of all disks and partitions along with the partitions for your other operating system.

  2. Image titled Install Arch Linux Dual Boot Step 32

    2

    Select the partition you want to install Arch Linux on. Use the keys on the keyboard to navigate the list of partitions. Press Enter to select a hard disk partition. It should say what each partition is being used for. The partition you made for Arch Linux will most likely be called «Free Space.»

    • If you are asked to select a label for the hard disk, select «GPT.»
  3. Image titled Install Arch Linux Dual Boot Step 33

    3

    Select New and press Enter. This creates a new Partition.

  4. Image titled Install Arch Linux Dual Boot Step 34

    4

    Enter 512M and press Enter. This allocates 512 MB for your Linux root installation.

  5. Image titled Install Arch Linux Dual Boot Step 35

    5

    Select Type. Use the keys on the keyboard to navigate the menu at the bottom. Select Type and press Enter.

  6. Image titled Install Arch Linux Dual Boot Step 36

    6

    Select EFI System and press Enter. It’s near the top of the List menu. This sets the type as EFI so that your computer can boot from this hard drive installation.

  7. Image titled Install Arch Linux Dual Boot Step 37

    7

    Select the Free Space drive and press Enter. This drive should contain the remaining free space available after allocating 512 MB for the root file system. Select the remaining free space partition and press Enter.

  8. Image titled Install Arch Linux Dual Boot Step 38

    8

    Enter the amount of swap space you need. The amount of swap space you need depends on how much RAM your computer has. Enter the amount of swap space you need (i.e. 4G) and press Enter.

    • If you have less than 2GB of RAM, it is recommended you allocate double the amount of RAM you have for your swap space. If you have between 2 — 8 GB of RAM, you can allocate swap space that is equal to the amount of RAM you have. If you have greater than 8 GB of RAM, it is recommended you allocate a minimum of 4GB of RAM for swap space. Enter the amount of swap space you want to allocate (i.e. «4G») and press Enter.
  9. Image titled Install Arch Linux Dual Boot Step 39

    9

    Select Type and press Enter. Use the keys on the keyboard to navigate the menu at the bottom. Select Type and press Enter.

  10. Image titled Install Arch Linux Dual Boot Step 40

    10

    Select Linux Swap and press Enter. This creates a new partition for your Linux Swap.

  11. Image titled Install Arch Linux Dual Boot Step 41

    11

    Allocate the remaining hard drive space as Linux Filesystem. You can do so using the same method as above. Select the remaining «Free Space» partition and select Type at the bottom. Then select Linux Filesystem as the type.

  12. Image titled Install Arch Linux Dual Boot Step 42

    12

    Select Write. It’s the second to last button at the bottom of the screen. Select it and press Enter. This writes your partitions in the format you specified.

    • You will be asked if you are sure you want to write the disk partitions. To confirm, type «yes» and press Enter. Once you write your disk partitions, you cannot undo that change. Be sure to double-check your system partitions to make sure they are correct. If you write to the wrong disk drive, you could mess up the installation for your other operating system.
  13. Image titled Install Arch Linux Dual Boot Step 43

    13

    Select Quit and press Enter. This exits the cfdisk utility.

  14. Advertisement

  1. Image titled Install Arch Linux Dual Boot Step 44

    1

    Type fdisk -l and press Enter. This displays all the drives and partitions on your computer. Note the path of the entire disk drive next to «Disk» at the top. Also note the path of each partition listed below «Device.» You can see the partition type listed below «Type.»

    • Use this command any time you review the path to a partition.
  2. Image titled Install Arch Linux Dual Boot Step 45

    2

    Format your root installation drive. To do so, type mkfs.fat -F32 [path to partition] and press Enter. Replace «[path to partition]» with the path to your root installation drive (i.e. «mkfs.fat -F32 /dev/sda1»).

  3. Image titled Install Arch Linux Dual Boot Step 46

    3

    Format your Linux file system partition. To do so, type mkfs.ext4 [path to partition] and press Enter. Replace «[path to partition]» with the path to your Linux File system drive (i.e. «mkfs.ext4 /dev/sda2»).

  4. Image titled Install Arch Linux Dual Boot Step 47

    4

    Format your swap space partition. To do so type mkswap [path to swap space] and press Enter. Replace «[path to swap space]» with the path to the swap space partition (i.e. «mkswap /dev/sda2»).

  5. Image titled Install Arch Linux Dual Boot Step 48

    5

    Activate the swap space partition. To do so, type swapon [path to swap space]" and press enter. Replace «[path to swap space]» with the path to the swap space partition (i.e. «swapon /dev/sda2»)

  6. Image titled Install Arch Linux Dual Boot Step 49

    6

    Mount the file system partition. To do so type mount [path to file system] /mnt and press Enter. Replace «[path to file system]» with the path to the file system partition (i.e «mount /dev/sda3 /mnt»).

  7. Image titled Install Arch Linux Dual Boot Step 50

    7

    Make a «boot» directory on the file system partition. To do so, type mkdir /mnt/boot and press Enter.

  8. Image titled Install Arch Linux Dual Boot Step 51

    8

    Mount the EFI system partition to the «boot» partition. To do so, type mount [path to EFI system] /mnt/boot and press Enter. Replace «[path to EFI system]» with the path to the EFI partition.

  9. Advertisement

  1. Image titled Install Arch Linux Dual Boot Step 52

    1

    Enter the command to install the base Linux package and Linux firmware. To do so, type pacstrap /mnt base linux linux-firmware and press Enter. This may take a while. Now might be a good time to take a break.

  2. Image titled Install Arch Linux Dual Boot Step 53

    2

    Install the VI text editor. You will need this program to edit a few files during the installation process. To install the VI text editor, type pacman -Sy vi and press Enter

  3. Image titled Install Arch Linux Dual Boot Step 54

    3

    Generate the fstab file. This generates a new UUID file which gives a unique identifier to the file system. To generate the fstab file type genfstab -U /mnt >> /mnt/etc/fstab and press Enter.

    • You can check the resulting fstab file by typing vi /mnt/etc/fstab and pressing Enter. You should see some new UUIDs being generated for each file system. To exit out of the VI text editor, type :q! and press Enter.
  4. Image titled Install Arch Linux Dual Boot Step 55

    4

    Change root to the new file system. To do so, type arch-chroot /mnt and press Enter.

  5. Image titled Install Arch Linux Dual Boot Step 56

    5

    Set your local time zone. You can use the following steps to set your local time zone:

    • Type ln -sf /usr/share/zoneinfo/ and press Tab to display a list of all possible regions.
    • Add your region to the end of the command as listed in the list of regions and press Tab.
    • Type Y and press Enter to list all locations in your region.
    • Add the location nearest to you as listed in the list of locations to the end of the command.
    • Add a space followed by /etc/localtime to the end of the command and press Enter. The entire command should look something like ln -sf /usr/share/zoneinfo/America/Denver /etc/localtime
  6. Image titled Install Arch Linux Dual Boot Step 57

    6

    Sync the hardware clock. To do so, type hwclock --systohc and press Enter.

  7. Image titled Install Arch Linux Dual Boot Step 58

    7

    Set your language variables. To do this, you will need to open the «locale.gen» file which lists all possible language variables. Uncomment the language locales you want to use by deleting the hash (#) in front of them. You will also need to write down the locales you want to use. The locale for American English is «en_US.UTF-8 UTF-8.» Use the following steps to set yoru language variable:

    • Type vi /etc/locale.gen and press Enter.
    • Scroll down and find the locale(s) you want to use.
    • Highlight the hash in front of it and press Delete (not backspace).
    • Write down the locale(s) you want to use.
    • Type :x and press Enter to save the locate file.
    • Type locale-gen and press Enter to run the locale file. It should list the locales you uncommented.
  8. Image titled Install Arch Linux Dual Boot Step 59

    8

    Create a new locale configuration file. You will be creating a new locale configuration file in the «/etc» directory. Use the following steps to do so.

    • Type vi /etc/locale.conf and press Enter to create a new file.
    • Press «i» to switch to Insert mode.
    • Type LANG= followed by your locale(s) (i.e. «LANG=en_US.UTF-8»).
    • Press «Esc» to return to Command mode.
    • Type :x and press Enter to save and exit VI.
  9. Image titled Install Arch Linux Dual Boot Step 60

    9

    Change the keyboard layout (optional). By default, Arch Linux uses a standard US keyboard layout. If you want to set a different keyboard layout, you can use the following steps to do so:

    • Type ls /usr/share/kbd/keymaps/**/*.map.gz and press Enter to list all possible keyboard layouts.
    • Identify which keyboard layout you want to use before the «.map.gz» file extension (i.e. «de-latin1» for German).
    • Type vi /etc/vconsole.conf and press Enter to create a new vconsole configuration file.
    • Press «i» to switch to Insert mode.
    • Type keymap= followed by the keymap you want to use (i.e. «keymap=amiga-us»).
    • Press «Esc» to switch to command mode.
    • Type :x and press Enter to save and exit VI.
  10. Image titled Install Arch Linux Dual Boot Step 61

    10

    Create a new hostname for your computer. This will be your computer’s name on a network. Use the following steps to create a new hostname for your computer:

    • Type vi /etc/hostname and press Enter.
    • Press «i» to enter Insert Mode.
    • Type a hostname for your computer. It can your computer name, or anything you want.
    • Press «Esc» to enter Command mode.
    • Type :x and press Enter to save and exit.
  11. Image titled Install Arch Linux Dual Boot Step 62

    11

    Update the Host file. After creating a local host name, you will need to update the host file. Use the following steps to do so. Replace «[Tab]» with a Tab press on the keyboard and replace «[hostname]» with the hostname you chose for your computer. Use the following steps to update your host file:

    • Type vi /etc/hosts and press Enter to open the Hosts file.
    • Press «i» to enter Insert mode.
    • Type 127.0.0.1 [Tab] localhost just below the first 2 lines at the top of the file.
    • Type ::1 [Tab] [Tab] localhost in the next line down.
    • Type 127.0.1.1 [Tab] hostname.localhost [Tab] hostname on the next line down. If you have a static IP address replace «127.0.1.1» with your static IP address.
    • Press «Esc» to enter Command mode.
    • Type :x and press Enter to save and exit.
  12. Advertisement

  1. Image titled Install Arch Linux Dual Boot Step 63

    1

    Set a root user password. To do so, type passwd and press Enter. Then type your root user password and press Enter. Then type your password again and press Enter.

  2. Image titled Install Arch Linux Dual Boot Step 64

    2

    Add a new user. To do so, type useradd -m [username] and press Enter. Replace «[username]» with the user’s username they will use to log in to Arch Linux.[8]

    • The «-m» option creates a separate home directory for the user.
    • If you want to add the user to a group, you can add «-G» followed by the group name after the «useradd» command.
    • If you want to create a custom home directory for the user type «-d» followed by te path to the user’s home directory after the «useradd» command.
  3. Image titled Install Arch Linux Dual Boot Step 65

    3

    Set a password for the user. To do so, type passwd followed by the user’s username and press Enter. Then type the user’s password and press Enter. Retype the user’s password and press Enter.

  4. Advertisement

  1. Image titled Install Arch Linux Dual Boot Step 66

    1

    Install the GRUB bootloader. This allows you to boot back into Arch Linux upon rebooting. To install the GRUB bootloader, type pacman -S grub efibootmgr and press Enter. Then press «y» when prompted and press Enter.

  2. Image titled Install Arch Linux Dual Boot Step 67

    2

    Install OS-Prober. This allows you to find the Windows setup so that you can create a dual-boot system. To install OS prober, type pacman -S os-prober and press Enter. Type «y» when prompted and press Enter.

    • To test if OS Prober is properly installed, simply type «os-prober» after the installation is complete. If you get no error messages, it is properly installed.
  3. Image titled Install Arch Linux Dual Boot Step 68

    3

    Install GRUB. To do so, type grub-install --target=x86_64-efi --efi-directory=/boot/ --bootloader-id=GRUB and press Enter. This command installs GRUB using x86_64 architecture. It also specifies the boot directory.

  4. Image titled Install Arch Linux Dual Boot Step 69

    4

    Make a new directory for your other operating system. To do so, simply type mkdir /mnt2 and press Enter. This creates a new directory called «mnt2» which will be used to mount the partition with the other operating system you want to dual-boot.

  5. Image titled Install Arch Linux Dual Boot Step 70

    5

    Mount the partition for your other operating system. To do so, type mount [path to partition] /mnt2 and press Enter Replace «[path to partition]» with the path to drive that your other operating system is installed on (i.e. «mount /dev/sda2 /mnt2). This mounts that partition to the newly created «mnt2» folder.

  6. Image titled Install Arch Linux Dual Boot Step 71

    6

    Generate a GRUB configuration file. To do so, type mkconfig -o /boot/grub/grub.cfg and press Enter. This will generate the GRUB configuration file automatically. OS-Prober should detect the other operating system you are dual-booting and report that it found that operating system.

  7. Image titled Install Arch Linux Dual Boot Step 72

    7

    Type exit and press Enter. This exits back to the root user.

  8. Image titled Install Arch Linux Dual Boot Step 73

    8

    Type reboot and press Enter. This reboots your computer. Upon rebooting, you should boot into the GRUB menu. You should see Arch Linux as your first selection, Advanced Options as your second option, and your other operating system as your third option. Select which operating system you want to use. When you boot into Arch Linux, you will be asked to log in with your username and password.[9]
    [10]

  9. Advertisement

Ask a Question

200 characters left

Include your email address to get a message when this question is answered.

Submit

Advertisement

Thanks for submitting a tip for review!

About This Article

Thanks to all authors for creating a page that has been read 12,687 times.

Is this article up to date?

In this article you can read how to setup a PC that both runs
Windows 10 Pro and the latest Arch Linux (Januari 2020). After
following this guide you’ll have a PC that allows you to select
to boot either into Windows 10 or Arch Linux. All you need is a
free harddisk a Windows License and preferrably two USB sticks
that we use to install the Windows and Arch Linux ISO files
onto. We use Windows to create the bootable USB sticks but if
you’re running Mac, see the links below.

Prerequisites

  • PC with ethernet connection.
  • A harddisk onto which we install Windows and Arch Linux
  • 1x USB stick for Arch Linux
  • 1x USB stick for Windows 10.
  • A PC that runs Windows.
  • We assume you have a UEFI bios.

Create a bootable USB Installer for Arch Linux

You’re going to prepare two USB sticks, one will be used for the
Arch Linux installer and the other for the Windows 10
Installer. When you don’t have two USB sticks you’ll have to
reuse one; in this case first create this bootable Arch Linux USB
stick.

  • Download the Arch Linux ISO.
  • Select a server nearby your location
  • Download the file with a name like archlinux-2020.01.01-x86_64.iso.
  • Do not download the the bootstrap version
  • Download the Rufus Windows application.
  • Run Rufus:
    • Device: select your USB stick
    • Boot selection: press the SELECT button and brofwse to your arch iso file.
    • Partition Scheme: GPT
    • Target System: UEFI
    • File system: FAT32
    • Press START: Select DD

Create a bootable USB Installer for Windows

To download the Windows 10 Pro ISO we can either use the
Windows Media Creation Tool
which also creates a bootable USB or trick the Windows website to
download the ISO file and use Rufus instead. The Windows Media
Creation Tool is known to be buggy and therefore we’re going to
use Rufus to create a bootable USB stick, just like we did for
the Arch Linux bootable USB stick.

By default when you try open the download page for the Windows 10
ISO, the Microsoft website forces you to use the Windows Media
Creation Tool; at least when you’re using Windows to download the
ISO. Luckily we can trick the website to pretend we’re visiting
the website from a Mac. When the Microsoft website thinks we’re
using a Mac it magically allows us to download the ISO.

  • Use the Chrome browser and search for «Windows 10 Pro ISO»
  • Open the link to something like: https://www.microsoft.com/software-download/windows10ISO
  • Press CTRL + SHIFT + I to open the Developers Tools
  • Click the menu icon (3 dots) on the right of the Developer Tools
  • Select More tools > Network Conditions
  • Unselect the User agent [x] Select automatically setting.
  • Select Safari — Mac
  • Reload the page.
  • Select Windows 10, press Confirm
  • Select your language
  • Select the 64-bit download

Open Network Conditions Menu
Open the network conditions via the Chrome Developer Tools

Select Safari as your User Agent
Select Safari on Mac as your user agent

Once you’ve downloaded the Windows 10 Pro ISO, open Rufus again
and place the USB stick in your PC. Note that all data on this
stick will be removed when we copy the Windows 10 Pro Installer
onto this bootable USB stick.

  • Run Rufus
  • Device: select your USB stick
  • Bool selection: press SELECT and browse to your Windows ISO file.
  • Partition Scheme: GPT
  • Target System: UEFI
  • File System: NTFS
  • Press START

Create bootable Windows Installer USB with Rufus

Install Arch Linux

Now that you have a bootable Arch Linux USB installer and a
bootable Windows 10 Pro USB installer you’ll have to install Arch
Linux first. This means that you have to start with the most
important step first: partitioning.

Partitioning is known to be difficult when you’re new to
Linux. Though let me tell you that it’s a lot easier than you
think. What might be a bit difficult is to choose the sizes
of your partitions. I’ll describe what I normally use and you can
follow along or choose your own partitions sizes.

I do assume that you’ve got one harddisk onto which you want to
install both Arch Linux and Windows 10 Pro. I use a 2TB SSD disk
where I choose 1TB for Arch Linux and 1TB for Windows.

When you’ve got more than one harddisk and you want to use
another harddisk to install Arch Linux and Windows 10 you have to
make sure that your UEFI bios boots from the harddisk onto which
we’re going to install Arch Linux and Windows.

Boot from the Arch Linux USB

  • Put your USB stick with the Arch Linux installer into your PC
  • Boot from USB
  • Select Arch Linux archiso x86_64 UEFI CD, press Enter

When your screen turns crazy after you have pressed Enter,
reboot and follow these steps instead:

  • Boot from from USB
  • Select «Arch Linux archiso x86_64 UEFI CD», press e
  • Scroll to the end of the command and add nomodeset
  • Press enter.

Partitioning your harddisk

To find your harddisk we use fdisk. You might have multiple
harddisks and at this point it doesn’t really matter which one
you use; this is up to you.

# fdisk -l

You’ll see a similar output as below. The Disk /dev/sdb is what
we’re after. We’ll use the /dev/sdb disk to install Arch Linux
and Windows. Note that my PC came pre-installed with Windows 10
Pro which uses a digital license. This means my motherboard has
the license baked into it and it’s safe to remove the existing
partitions. When you don’t have a digital license make sure you
have a copy of your Windows 10 License Key.

You’ll create three partitions. The boot partition, the root Arch
Linux partition and one that the Windows installer will use to
install Windows 10. I recommend writing the partitions numbers,
sizes and types down as you might want to refer to these when
installing Windows 10.

# fdisk -l 

Disk /dev/sdb: 3.65 TiB, 4000787030016 bytes, 7814037168 sectors
Disk model: Samsung SSD 860 
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: E413F59B-D9CB-4E10-A358-C5E7309DF4D9

Device          Start        End    Sectors  Size Type
/dev/sdb1        2048     526335     524288  256M EFI System
/dev/sdb2      526336 4295493631 4294967296    2T Linux filesystem
/dev/sdb3  4295493632 7814037134 3518543503  1.7T Microsoft basic data

Now that you know the disk name, you can run gdisk to partition your
disk. First we’ll remove all the existing partitions.

# gdisk /dev/sdb

Remove exiting partitions:

- Press `d`
- Partition number (1-2): 1 [PRESS ENTER]
- Press `d`
- Repeat for all your paritions.

Create the boot and main partion for Arch Linux:

- Press `n`
- Partition number: 1
- First sector: [PRESS ENTER]
- Last sector: +256M 
- Hex code or GUID: ef00 

- Press `n`
- Partition number: 2
- First sector: [PRESS ENTER]
- Last sector: 1T 
- Hex code or GUID: 8300 

Create the Windows Partition:

- Press `n`
- Partition number: 3
- First sector: [PRESS ENTER]
- Last sector: [PRESS ENTER}
- Hex code or GUID: 0700

Save and exit.

- Press `w`
- Do you want to proced: `y`

Lets see the created partitions:

# fdisk -l /dev/sdb

Disk /dev/sdb: 3.65 TiB, 4000787030016 bytes, 7814037168 sectors
Disk model: Samsung SSD 860 
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: E413F59B-D9CB-4E10-A358-C5E7309DF4D9

Device          Start        End    Sectors  Size Type
/dev/sdb1        2048     526335     524288  256M EFI System
/dev/sdb2      526336 4295493631 4294967296    2T Linux filesystem
/dev/sdb3  4295493632 7814037134 3518543503  1.7T Microsoft basic data

Format the partitions:

# mkfs -t vfat /dev/sdb1
# mkfs -t ext4 /dev/sdb2

Setup and install Arch Linux base system

Mount system: you first mount the main system (/dev/sdb2) after which you
mount the boot partition (/dev/sdb1).

# mkdir /mnt
# mount /dev/sdb2 /mnt

# mkdir /mnt/boot
# mount /dev/sdb1 /mnt/boot

Setup base system:

# pacstrap /mnt base base-devel linux linux-firmware
# genfstab -U -p /mnt >> /mnt/etc/fstab
# arch-chroot /mnt

Install some core utilities:

# pacman -S emacs
# pacman -S git
# pacman -S kitty
# pacman -S dhcpcd
# pacman -S openssh

Configure timezone

# ln -sf /usr/share/zoneinfo/Europe/Amsterdam /etc/localtime
# hwclock --systohc

# emacs -nw /etc/locale.gen
-- uncomment: en_US.UTF-8 UTF-8

# locale-gen
# localectl set-locale LANG=en_US.UTF-8

# emacs -nw /etc/locale.conf
-- add the following lines:
LANG=en_US.UTF-8
LC_CTYPE=en_US.UTF-8

Hostname

# emacs -nw /etc/hostname
-- set your hostname, e.g. roxlu, arch, etc.)

Host file

# emacs -nw /etc/hosts

-- make sure it reads something like: 
127.0.0.1 localhost
::1 localhost
127.0.1.1 yourhostname.localdomain yourhostname

Add your main account:

# useradd -m -g users -s /bin/bash roxlu
# gpasswd -a roxlu wheel
# passwd roxlu

Set root password:

# passwd

Install the rEFInd boot loader

I’ve been using the rEFInd boot loader for quite a while and have
been very happy with it; I like that it’s a graphical menu that
you can customise. So let’s install the rEFInd boot loader.

# pacman -S refind-efi
# refind-install

The refind-install util will copy some required files to the
boot partition for you but we still have to configure rEFInd to
make sure that it loads the correct files when booting. You have
to set the correct UUID in the /boot/refind_linux.conf.

We have to get the UUID of our root partition (not boot). You can
use the following command to get the UUID for the root partition:

# findmnt -no UUID /
3d72956e-db77-43b4-b299-14a0de20ea4c 

To copy the UUID easily I’m using emacs that I use to create a
split window. In the right window I run M-x eshell in which I
execute findmnt -no UUID / and copy the UUID. In the left pane
I opened the /boot/refind_linux.conf. Now make sure that it reads
something similar as this:

# emacs -nw /boot/refind_linux.conf

-- create a split window
-- M-x eshell, and run `blkid /dev/sdb2` in 
-- copy the UUID into `refind_linux.conf` so that it looks like:

"Boot with standard options"  "rw root=UUID=3d72956e-db77-43b4-b299-14a0de20ea4c"
"Boot to single-user mode"    "rw root=UUID=3d72956e-db77-43b4-b299-14a0de20ea4c single"
"Boot with minimal options"   "rw root=UUID=3d72956e-db77-43b4-b299-14a0de20ea4c"

Now verify that your boot partition is setup correctly. It should
look similar to this listing:

# cd /boot
# ls -1

EFI
initramfs-linux-fallback.img
initramfs-linux.img
refind_linux.conf
vmlinuz-linux

When you’re missing the kernel executable vmlinuz-linux or
any of the initramfs-* something went wrong. Try to reinstall
the kernel using:

# pacman -S linux

When you reboot now, you’ll get a similar menu as in the image above, but you’ll see only the Linux menu option, we’re going to add Windows later.

Setup networking using DHCP

I’m using DHCP to automatically configure my network. When you
don’t use DHCP you can set your IP manually but that’s out of the
scope of this document. To enable DHCP for a network interface, we’ll
check which one is currently in use. To do this we use the ip addr
command. Find the interface that you want to setup; this is most likely
the one which comes directly after the link/loopback interface with
a link designation like link/ether

 # ip addr

 3: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 00:d8:61:4f:ba:df brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.178/24 brd 192.168.0.255 scope global noprefixroute eno1
       valid_lft forever preferred_lft forever
    inet6 fe80::5c2d:3270:4:9ca8/64 scope link 
       valid_lft forever preferred_lft forever

In the example above, the name of our network interface is
eno1. Now, that you know the name of the network interface we
can enable DHCP on it. Note that below we use dhcpcd and
not dhcp.

# systemctl enable dhcpcd@eno1

Reboot

Remove the USB stick and exit the chroot environment, then
execute reboot. When your PC restarts you should see the rEFInd
boot menu that you need to start Linux.

# exit
# reboot

When you don’t get the rEFInd menu something went wrong. See the
next section which allows you to go back into your just installed
Arch Linux. When you do get the rEFInd boot menu: congrats, you
just installed Arch Linux successfully. Skip the next step and
continue with the Windows 10 Pro install.

Fixing errors when your boot menu is broken

Don’t worry, you don’t have to reinstall everything again. When
you don’t see the rEFInd boot menu after restarting you either
made an error while configuring rEFInd or creating the partitions.
When your partitions are incorrect, you might have to reinstall
Arch Linux again. When it’s something related to rEFInd, you
might be able to fix it by checking your configs again.

Here I’ll explain how you can go back into your just installed
Arch Linux so you’re able to verify some things and check the rEFInd
configuration.

  • Put the Arch Linux bootable USB installer in your PC.
  • Boot from the Arch Linux USB (see above how to do this).
  • Mount your installed Arch Linux and chroot into it. Make sure
    to use the correct partitions that you used when partitioning
    your filesystem.

      # mount /dev/sdb2 /mnt
      # mount /dev/sdb1 /mnt/boot
      # arch-chroot /mnt
    
  • Now you’re back into your install and you can fix it!

Install Windows 10 Pro

At this point you should be able to access the rEFInd boot menu
when you boot your PC. Now you instert the bootable Windows 10
Pro USB stick into your PC, remove the Arch Linux installer USB
and reboot. After the reboot, rEFInd will show you a couple of
extra options. I got two extra options for the Windows
installer. I selected the menu option with Boot
EFIRufusntfs_x64.efi from UEFI_NTFS

Installing Windows 10 is a pretty trivial and straightforward
process. The only thing which might be worth mentioning is the
partitioning step. When the installer starts, one of the first
screens will ask if you want to repair an existing installation
or do a advanced full install. Choose the advanced option and
when you’re asked to select the partition make sure to select the
one that you prepared when partitioning for Arch Linux.

Select the correct partition, press Next and follow the
screens from the installer. Once Windows has been installed
remove the USB key and restart. rEFInd will contain an extra
option for Windows 10 Pro.

Windows removed rEFInd: how to reinstall rEFInd?

It might happen that the Windows installer removed the rEFInd
boot menu and forced it’s own boot manager to be the default one.
This means that when we reboot we won’t get the rEFInd boot menu
anymore. You can fix this issue by reinstalling rEFInd.

  • First boot into your Arch Linux installation as described above
    in the Boot from the Arch Linux USB.
  • Next run refind-install again
  • Remove the USB stick
  • Reboot

This should bring back the rEFInd boot menu and it will have two
options now, one for Windows 10 Pro and one for Arch Linux. Congratulations
you have successfully installed Arch Linux and Windows 10 Pro as a
dual boot on your PC with the rEFInd boot menu.

Now that you’ve got a nice setup, you might want to
create a self-hosted Unifi NVR


  • NAT Types
    This is so exciting, in this article I dive into some of the different ways a NAT device translates addresses which is important for peer-to-peer connections.


  • Building Cabinets
    In this post I dive into the design and construction of a cabinet with an interact LED strip. I also explain how I dynamically change the colors of the LEDs over TCP/UDP.


  • Compiling GStreamer from source on Windows
    How to compile GStreamer on Windows from Source using Visual Studio 2019 and the meson build system.


  • Debugging CMake Issues
    In this post I explain a process you can follow to debug issues with CMake by focusing on a specific target and making the output verbose.


  • Dual Boot Arch Linux and Windows 10
    How to install Arch Linux and Windows 10 Pro as dual boot. A step by step tutorial how to create bootable installers, partition and setup a dual boot menu.


  • Mindset Updated Edition, Carol S. Dweck (Book Notes)
    Paragraphs I marked from the book «Mindset» from Carol S. Dweck.


  • How to setup a self-hosted Unifi NVR with Arch Linux
    A step by step HOW-TO that explain show to setup a Unifi Video Controller with an NFS share with Arch Linux.


  • Blender 2.8 How to use Transparent Textures
    Follow this node setup when you want to use an image with transparency as a «sticker».


  • Compiling FFmpeg with X264 on Windows 10 using MSVC
    A couple of steps to compile FFmpeg on Windows using MSVC.


  • Blender 2.8 OpenGL Buffer Exporter
    The following Blender script creates a [name].h and [name].cpp for the selected object and stores the positions, normals and UVs.


  • Blender 2.8 Baking lightmaps
    Light maps are a cheap way to add a lot of realism to you static scenes and have been used forever.


  • Blender 2.8 Tips and Tricks
    Use Environment Map only for reflections; create a floor plane for a Product Render, diffuse texture for roughness and more!


  • Setting up a Bluetooth Headset on Arch Linux
    Learn how to setup a Sennheiser PXC 550 Bluetooth headset on Arch Linux.


  • Compiling x264 on Windows with MSVC
    Compile the excellent x264 source on Windows using MSYS2 and MSVC.


  • C/C++ Snippets
    Is a number divisible by four?


  • Reading Chunks from a Buffer
    Some thoughts on reading bytes from a file; handy for reading NALs.


  • Handy Bash Commands
    Bash scripts: removing white space, lowercase filenames, backup using tar, etc.


  • Building a zero copy parser
    Simple solution to parse data in a pretty performant way. Used this for a RTSP protocol parser.


  • Kalman Filter
    A very simple yet powerful filter which works great when you have to smooth noisy data. Used for the Nike Rise 2.0 project.


  • Saving pixel data using libpng
    Do you have raw RGBA data that you want to save? Use this snippet to save it into a PNG file.


  • Compile Apache, PHP and MySQL on Mac 10.10
    Setup you own PHP, MySQL and Apache and with virtual document roots.


  • Fast Pixel Transfers with Pixel Buffer Objects
    Using Pixel Buffer Objects (PBO) for fast asynchronous data transfers and OpenGL.


  • High Resolution Timer function in C/C++
    Wait…… wait.. fast high resolution timer funtions (Windows, Linux, Mac)


  • Rendering text with Pango, Cairo and Freetype
    My never ending obsession with font rendering. A complex beast to do well. Use Pango and FreeType for the heavy lifting.


  • Fast OpenGL blur shader
    Make things look blurry … and fast using this OpenGL blur shader.


  • Spherical Environment Mapping with OpenGL
    An old trick to get great lighting effects using Environment Maps and OpenGL.


  • Using OpenSSL with memory BIOs
    OpenSSL is a great library with lots of abstractions. In this post I discuss how to break some of these abstractions and use your own memory buffers.


  • Attributeless Vertex Shader with OpenGL
    A simple way to render a fullscreen quad without a vertex buffer with OpenGL.


  • Circular Image Selector
    Some thoughts on a different way to select images from a huge collection in a compact UI.


  • Decoding H264 and YUV420P playback
    Using libav to demux and playback with OpenGL.


  • Fast Fourier Transform
    Analyse your audio using the Fastest Fourier Transform in the West.


  • OpenGL Rim Shader
    Pretty glowy edges using a GLSL rim shader.


  • Rendering The Depth Buffer
    Render the non-linear OpenGL Depth Buffer.


  • Delaunay Triangulation
    Do you need to triangulate some shape: use the “Triangle” library.


  • RapidXML
    RapidXML is a versatile and fast XML parser with a simple API. Check out these examples.


  • Git Snippets
    Some simple GIT snippets; added here to remind myself.


  • Basic Shading With OpenGL
    A couple of basic GLSL shaders with explanation.


  • Open Source Libraries For Creative Coding
    Collection of great open source libraries for you creative programming projects.


  • Bouncing particle effect
    Snippet that can be used to create a bouncy particle effect; basic, effective, simple but nice.


  • OpenGL Instanced Rendering
    Want to render thousands and thousands of objects? Use OpenGL instanced rendering. The solution…the only solution.


  • Mapping a texture on a disc
    Ever heard about projective interpolation related to texture mapping? Learn about this intertesting issue with OpenGL and texture mapping.


  • Download HTML page using CURL
    When you want a quick solution to perform a HTTP(S) request CURL is always a quick an simple solution. Check out this example code.


  • Height Field Simulation on GPU
    Although not a Navier-Stokes implementation … still a very nice and enjoyable effect.


  • OpenCV
    Optical Flow: when doing anything with tracking you’ve probably heard of it. See this simple example code using OpenCV and OpenGL.


  • Some notes on OpenGL
    FBOs and Depth Testing, using different Attachment Points, a YUV420p shader, …


  • Math
    Meaning of the Dot Product in 3D graphics, calculating a perpendicular vector using Sam Hocevar’s solution, orientation matrix and more.


  • Gists to remember
    Some gists that I want to remember, often use, etc…


  • Reverse SSH
    Do you want to login, into a remote PC but the remote PC is behind a firewall? Then use this simple reverse SSH trick which doesn’t require changing your firewall rules.


  • Working Set
    Having issues with your compiler? Or during linking? Check these common issues and their solutions. I also list several tools that you can use to get a some useful info.


  • Consumer + Producer model with libuv
    Example of a common Multi Threaded Consumer/Producer Model using LibUV.


  • Parsing binary data
    Learn about the basic of a binary protocol and how to create one easily yourself.


  • C++ file operation snippets
    Reading a file into a string, vector, checking the file size, change to a position, etc. A collection of C++ file operation snippets.


  • Importance of blur with image gradients
    Do you want to experiment with OpenGL and aligning Brush Strokes along Image Gradients? Then check out this post about the importance of blurring.


  • Real-time oil painting with openGL
    Code snippet for fake «oil painting» effect with OpenGL using instanced rendering.


  • x264 encoder
    Basic example on how to use libx264 to encode image data using libav


  • Generative helix with openGL
    Screenshots of a project I worked on with that generates a DNA helix.


  • Mini test with vector field
    Screenshots while experimenting with a vector field; nothing much to see here.


  • Protractor gesture recognizer
    Testing the amazing One Dollar $1 gesture recognizer. The simplest and very good gesture recognizer.


  • Hair simulation
    Example code that implements the «Fast Simulation of Inextensible Hair and Fur» paper from M. Müller, T.Y. Kim and N.Chentanez.


  • Some glitch screenshots
    Glitch screenshots.


  • Working on video installation
    Screenshots of some experiments of a video installation.


  • Generative meshes
    I enjoy creating physics based simulations and render them on high res. Here are some experiments I did a time ago.


  • Converting video/audio using avconv
    Examples that show you how to use avconv to manipulate video and audio files.


  • Auto start terminal app on mac
    Automatically start you application whe Mac boots and make sure that it restarts your app when it exists. Handy for interactive installations.


  • Export blender object to simple file format
    Export the selected object in Blender into a .h and .cpp file that prepresents the buffer.

  • Понравилась статья? Поделить с друзьями:
  • How to install apache on windows
  • How to install ansible on windows
  • How to install android studio on windows 10
  • How to install android apps on windows 11
  • How to install adb on windows