Dual Boot Windows 11 and Alpine Linux - Part 1

In another effort to skirt around using an official cloud provider like AWS, GCP, or AKS I decided to create my own “remote cloud”. It has taken weeks of trial an error and purchasing USB drives to get it right enough to work.

The first part of this process is setting up a bootable USB drive with Alpine Linux, and creating a dual boot environment with a partition on a Windows machine. It is best to use Windows as the primary OS first because certain filesystem types are not recognized by Windows and could cause startup issues.

Prerequisites

Setup Bootable USB

Make sure the USB drive is plugged into the computer before starting up the rufus application.

  1. Choose “Device” (USB name)
  2. Select “Boot selection” (ISO file)
  3. Format “fat32” if not already selected
  4. Click “Start” to format the drive

Once the drive is formatted eject it (the correct way), and turn off the computer at this point. After powering back on, click F10 until the BIOS setup screen shows. In this window you’ll want to turn off/disable secure boot under “Advanced Setup” before restarting, be sure to plug the USB in again. When the computer restarts click F9 to open the boot menu, you should be able to see the Alpine OS, select it and allow it to start up.

Alpine Linux Setup

Login as root (no password), sometimes the font size on the first run is very small, but there is a terminus font package that can be installed after setting up the networking.

  1. Run “setup-alpine”
  2. (Optional) Run “setup-interfaces” – if not auto-configured from the first step, run this manually
  3. Run “apk update && apk upgrade”
  4. Install all other packages
    • For this setup, run “apk add sudo elogind polkit-elogind lsblk efibootmgr gnome-disk-utility” – add other tools as needed
  5. Do not reboot, as the configuration for the system has not been saved

Setup the Desktop – XFCE4

  1. Install required packages
    • Run “apk add xfce4 xfce4-terminal xfce4-screensaver lightdm-gtk-greeter dbus firefox”
    • Run “setup-devd udev”
  2. Set the desktop environment to start on boot
    • Add dbus, run “rc-update add dbus”
    • Add lightdm, run “rc-update add lightdm”
  3. Clean up the apk cache “apk cache clean”
  4. Save the current configuration “lbu commit -d” – wiki.alpinelinux.org/wiki/Alpine_local_backup
  5. Start up the desktop environment “rc-service lightdm start”
  6. Fix the font and icon sizing
    • Select display resolution in display settings 2048×1152
    • Increase icon and label sizing
    • Customize the background
  7. Save the current configuration on shutdown

Like before, while the machine is powering up, click F9 to show the boot menu and select the default Windows OS. After startup is complete, safely eject the bootable USB. The USB can be used as is without partitioning the main system, just plug it in and select the drive on the boot menu (using F9 on startup).

Create Partition on Windows 11

Based on this article – How to Partition a Hard Drive on Windows

  1. In the file explorer, right click “This PC”, select “Manage”
  2. Under “Storage” select “Disk Management”
    • Right click the primary drive, select “Shrink Volume”
      • Enter at least 25Gi of space (in MB) to create a new partition
    • Right click the new partition, format as a “New Simple Volume”

Lessons Learned

When I first began this process I was quick to follow the Alpine Linux Wiki documentation. However it is slightly disorganized and caused me to first un-configure my Alpine USB and wipe the drivers from the Windows machine I was on. How? There is a section after the initial setup where it calls for running “setup-alpine” again, just skip the basic setup section and save yourself the headache I had. Perhaps I wasn’t reading as thoroughly as I should have.

Also, like most filesystems too many disk modifications can fill up the write limit of the disk, for this project I used an HP Spectre HDD and got Windows reinstalled with a shiny new SSD via the Best Buy Geek Squad.

Next in part 2, I will walk through copying the USB system onto the new partition.