### Example Archinstall Configuration JSON Source: https://github.com/archlinux/archinstall/blob/master/docs/installing/guided.rst A sample JSON file demonstrating the structure for configuring the Archinstall guided installer. This includes disk partitioning, bootloader settings, and language. ```json { "additional-repositories": [], "archinstall-language": "English", "audio_config": null, "bootloader_config": { "bootloader": "Systemd-boot", "uki": false, "removable": false }, "bootloader": "Systemd-boot", "debug": false, "disk_config": { "config_type": "manual_partitioning", "device_modifications": [ { "device": "/dev/sda", "partitions": [ { "btrfs": [], "flags": [ "boot" ], "fs_type": "fat32", "length": { "sector_size": null, "total_size": null, "unit": "B", "value": 99982592 }, "mount_options": [], "mountpoint": "/boot", "obj_id": "369f31a8-2781-4d6b-96e7-75680552b7c9", "start": { "sector_size": { "sector_size": null, "total_size": null, "unit": "B", "value": 512 }, "total_size": null, "unit": "sectors", "value": 34 }, "status": "create", "type": "primary" }, { "btrfs": [], "flags": [], "fs_type": "fat32", "length": { "sector_size": null, "total_size": null, "unit": "B", "value": 100000000 }, "mount_options": [], "mountpoint": "/efi", "obj_id": "13cf2c96-8b0f-4ade-abaa-c530be589aad", "start": { "sector_size": { "sector_size": null, "total_size": null, "unit": "B", "value": 512 }, "total_size": { "sector_size": null, "total_size": null, "unit": "B", "value": 16106127360 }, "unit": "MB", "value": 100 }, "status": "create", "type": "primary" }, { "btrfs": [], "flags": [], "fs_type": "ext4", "length": { "sector_size": null, "total_size": null, "unit": "B", "value": 15805127360 }, "mount_options": [], "mountpoint": "/", "obj_id": "3e75d045-21a4-429d-897e-8ec19a006e8b", "start": { ``` -------------------------------- ### Run Archinstall with Local Config Source: https://github.com/archlinux/archinstall/blob/master/docs/installing/guided.rst Start the guided installation using a local JSON configuration file. This allows for pre-configured answers to installation steps. ```sh archinstall --config config.json ``` -------------------------------- ### QEMU/KVM VM Setup for Local Image Installation Source: https://github.com/archlinux/archinstall/blob/master/README.md Boots a QEMU/KVM virtual machine using a prepared image file for testing archinstall. This command is for booting the test media after installation. ```bash qemu-system-x86_64 -enable-kvm -machine q35,accel=kvm -device intel-iommu -cpu host -m 4096 -boot order=d -drive file=./testimage.img,format=raw -drive if=pflash,format=raw,readonly,file=/usr/share/edk2/x64/OVMF_CODE.4m.fd -drive if=pflash,format=raw,readonly,file=/usr/share/edk2/x64/OVMF_VARS.4m.fd ``` -------------------------------- ### Install and Run Archinstall Source: https://github.com/archlinux/archinstall/blob/master/README.md Initialize pacman keys, install the archinstall package, and then run the installer. Use sudo if running from an existing system. ```shell pacman-key --init pacman -Sy archinstall archinstall ``` -------------------------------- ### Run Archinstall Guided Installer Source: https://github.com/archlinux/archinstall/blob/master/docs/installing/guided.rst Execute the Archinstall guided installer from the Arch Linux ISO. This is the default mode. ```sh archinstall ``` -------------------------------- ### Run Archinstall in Guided Mode with Local Image Source: https://github.com/archlinux/archinstall/blob/master/README.md Executes archinstall in guided mode using a locally prepared image. Ensure archinstall is installed or updated. ```bash pip install --upgrade archinstall ``` ```bash python -m archinstall --script guided ``` -------------------------------- ### Share Archinstall Log Source: https://github.com/archlinux/archinstall/blob/master/README.md Use this command to upload the install log and get a shareable URL for issue reporting. ```shell archinstall share-log ``` -------------------------------- ### Run Archinstall with Remote Config Source: https://github.com/archlinux/archinstall/blob/master/docs/installing/guided.rst Initiate the guided installation with a JSON configuration file hosted remotely. Ensure the URL is accessible. ```sh archinstall --config-url https://domain.lan/config.json ``` -------------------------------- ### Build and install archinstall from source Source: https://github.com/archlinux/archinstall/blob/master/docs/installing/python.rst Builds a wheel file for the archinstall package and then installs it into Python's module path using PyPa's build and installer tools. Requires navigating into the cloned repository first. ```console $ cd archinstall $ python -m build . $ python -m installer dist/*.whl ``` -------------------------------- ### Archinstall Build and Test Script Source: https://github.com/archlinux/archinstall/wiki/Building-and-Testing A bash script to automate the ISO building and testing process. It handles repository cloning, package installation, script configuration, ISO building, and QEMU VM setup. ```bash #!/bin/bash if [ -z "$1" ] then echo "Need to define a output folder for the archiso:" echo "Example (build and run):" echo " ./test.sh ./archiso true" echo "Example (skip building and run ISO as given path):" echo " ./test.sh ./archiso" exit 1 fi REPO="https://github.com/Torxed/archinstall.git" ARCHISO_FOLDER=$1 REBUILD=$2 BRANCH="master" if [ $REBUILD ] then echo "Making a clean build!" `rm -rf "${ARCHISO_FOLDER}" 2>/dev/null` || ( echo "Could not delete protected folder:" echo "-> ${ARCHISO_FOLDER}" echo "Running as sudo." sudo rm -rf "${ARCHISO_FOLDER}" ) mkdir -p "${ARCHISO_FOLDER}" cp -r /usr/share/archiso/configs/releng/* "${ARCHISO_FOLDER}/" git clone "${REPO}" "${ARCHISO_FOLDER}/airootfs/root/archinstall-git" (cd "${ARCHISO_FOLDER}/airootfs/root/archinstall-git"; git checkout "${BRANCH}" ) echo "git" >> "${ARCHISO_FOLDER}/packages.x86_64" echo "python" >> "${ARCHISO_FOLDER}/packages.x86_64" echo "python-setuptools" >> "${ARCHISO_FOLDER}/packages.x86_64" cat <<\EOF >> "${ARCHISO_FOLDER}/airootfs/root/.zprofile" [[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && sh -c "cd /root/archinstall-git; git config --global pull.rebase false; git pull; cp examples/guided.py ./; python guided.py" EOF ( cd "${ARCHISO_FOLDER}/"; sudo mkarchiso -v -w work/ -o out/ ./; ) fi if [ ! -f "./test.qcow2" ]; then qemu-img create -f qcow2 ./test.qcow2 15G fi sudo qemu-system-x86_64 \ -cpu host \ -enable-kvm \ -machine q35,accel=kvm \ -device intel-iommu \ -m 8192 \ -drive if=pflash,format=raw,readonly,file=/usr/share/ovmf/x64/OVMF_CODE.fd \ -drive if=pflash,format=raw,readonly,file=/usr/share/ovmf/x64/OVMF_VARS.fd \ -device virtio-scsi-pci,bus=pcie.0,id=scsi0 \ -device scsi-hd,drive=hdd0,bus=scsi0.0,id=scsi0.0,bootindex=2 \ -drive file=./test.qcow2,if=none,format=qcow2,discard=unmap,aio=native,cache=none,id=hdd0 \ -device virtio-scsi-pci,bus=pcie.0,id=scsi1 \ -device scsi-cd,drive=cdrom0,bus=scsi1.0,bootindex=1 \ -drive file=$(ls -t $ARCHISO_FOLDER/out/*.iso | head -n 1),media=cdrom,if=none,format=raw,cache=none,id=cdrom0 ``` -------------------------------- ### Manual Partitioning: EXT4 Example Source: https://github.com/archlinux/archinstall/blob/master/docs/cli_parameters/config/disk_config.rst Example configuration for an EXT4 partition, commonly used for the root filesystem ('/'). Units and positions are user-specific. ```json { "btrfs": [], "flags": [], "fs_type": "ext4", "length": { "sector_size": null, "total_size": null, "unit": "B", "value": 15805127360 }, "mount_options": [], "mountpoint": "/", "obj_id": "3e75d045-21a4-429d-897e-8ec19a006e8b", "start": { "sector_size": { "sector_size": null, "total_size": null, "unit": "B", "value": 512 }, "total_size": { "sector_size": null, "total_size": null, "unit": "B", "value": 16106127360 }, "unit": "MB", "value": 301 }, "status": "create", "type": "primary" } ``` -------------------------------- ### Install Documentation Dependencies Source: https://github.com/archlinux/archinstall/blob/master/docs/README.md Install Sphinx and the Read the Docs theme using pip. Ensure you use the -U flag for upgrades. ```bash pip install -U sphinx sphinx-rtd-theme ``` -------------------------------- ### Manual Partitioning: FAT32 Example Source: https://github.com/archlinux/archinstall/blob/master/docs/cli_parameters/config/disk_config.rst Example configuration for a FAT32 partition, typically used for /boot. The 'boot' flag is automatically handled for EFI systems. ```json { "btrfs": [], "flags": [ "boot" ], "fs_type": "fat32", "length": { "sector_size": null, "total_size": null, "unit": "B", "value": 99982592 }, "mount_options": [], "mountpoint": "/boot", "obj_id": "369f31a8-2781-4d6b-96e7-75680552b7c9", "start": { "sector_size": { "sector_size": null, "total_size": null, "unit": "B", "value": 512 }, "total_size": null, "unit": "sectors", "value": 34 }, "status": "create", "type": "primary" } ``` -------------------------------- ### Prepare Local Installation Image Source: https://github.com/archlinux/archinstall/blob/master/README.md Creates a blank image file and sets it up as a loop device for testing archinstall without a live ISO. Requires arch-install-scripts and util-linux. ```bash truncate -s 20G testimage.img ``` ```bash losetup --partscan --show ./testimage.img ``` -------------------------------- ### Setup Archiso Configuration Source: https://github.com/archlinux/archinstall/wiki/Building-and-Testing Initializes the archiso build environment by copying the releng configuration. This is the first step in customizing your ISO. ```bash # mkdir -p ./archiso # cd ./archiso # cp -r /usr/share/archiso/configs/releng/* ./ ``` -------------------------------- ### Install AUR Plugin Source: https://github.com/archlinux/archinstall/blob/master/docs/help/known_issues.rst Use this command to install the AUR plugin for archinstall. Be aware that this may lead to unsupported usage of AUR during installation. ```console # archinstall --plugin https://archlinux.life/aur-plugin ``` ```console # archinstall --plugin https://raw.githubusercontent.com/phisch/archinstall-aur/master/archinstall-aur.py ``` -------------------------------- ### Install archinstall with pacman Source: https://github.com/archlinux/archinstall/blob/master/docs/installing/python.rst Installs both the archinstall library and the helper executable using pacman. This is the recommended method if using the official Arch Linux ISO. ```console pacman -S archinstall ``` -------------------------------- ### Install Archinstall from Source Source: https://github.com/archlinux/archinstall/blob/master/README.md Installs the archinstall package from the local source directory using pip. This is an alternative to running directly from source. ```bash pip install --break-system-packages . ``` -------------------------------- ### Configure Autolaunch .zprofile Source: https://github.com/archlinux/archinstall/wiki/Building-and-Testing Creates a .zprofile script that automatically runs archinstall on TTY1 login. It configures git, pulls the latest changes, copies the guided script, and executes it. ```bash # cat <<\EOF >> ./airootfs/root/.zprofile [[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && sh -c "cd /root/archinstall-git; git config --global pull.rebase false; git pull; cp examples/guided.py ./; python guided.py" EOF ``` -------------------------------- ### Install archinstall library from PyPI Source: https://github.com/archlinux/archinstall/blob/master/docs/installing/python.rst Installs only the archinstall Python library using pip. This method is useful if you do not need the helper executable. ```console pip install archinstall ``` -------------------------------- ### Install Build Requirements Source: https://github.com/archlinux/archinstall/blob/master/README.md Installs necessary packages for building archinstall from source. Ensure sufficient RAM and free disk space. ```bash pacman -Sy; pacman -S git python-pip gcc pkgconf ``` -------------------------------- ### Verifying Archinstall with Qemu Harddrives Source: https://github.com/archlinux/archinstall/blob/master/test_tooling/qemu/README.md After a machine has been shut down, use this command to boot Qemu with only harddrives to verify the installation. ```bash python test_tooling/qemu/qemu.py \ --harddrive ~/test.qcow2:15G \ --harddrive ~/test_large.qcow2:25G ``` -------------------------------- ### Install Pre-commit Hooks Source: https://github.com/archlinux/archinstall/blob/master/CONTRIBUTING.md Installs pre-commit hooks to run checks like mypy, ruff check, and flake8 locally before each commit. Ensure you have pre-commit installed. ```bash pre-commit install ``` -------------------------------- ### Pre-mounted Configuration (Leave as is) Source: https://github.com/archlinux/archinstall/blob/master/docs/cli_parameters/config/disk_config.rst Use this mode when disks are manually mounted under /mnt/archinstall. The system will be installed to these mountpoints without re-partitioning. ```json { "config_type": "pre_mounted_config", "mountpoint": "/mnt/archinstall" } ``` -------------------------------- ### Example Output of Disk Listing Source: https://github.com/archlinux/archinstall/blob/master/docs/examples/python.rst This is an example of the output generated by the script that lists hard drives, showing detailed information about each detected disk and its partitions. ```text [ BDevice( disk=, device_info=_DeviceInfo( model='PC801 NVMe SK hynix 512GB', path=PosixPath('/dev/nvme0n1'), type='nvme', total_size=Size(value=512110190592, unit=, sector_size=SectorSize(value=512, unit=)), free_space_regions=[ , , ], sector_size=SectorSize(value=512, unit=), read_only=False, dirty=False ), partition_infos=[ _PartitionInfo( partition=, name='primary', type=, fs_type=, path='/dev/nvme0n1p1', start=Size(value=2048, unit=, sector_size=SectorSize(value=512, unit=)), length=Size(value=535822336, unit=, sector_size=SectorSize(value=512, unit=)), flags=[ , ], partn=1, partuuid='a26be943-c193-41f4-9930-9341cf5f6b19', uuid='6EE9-2C00', disk=, mountpoints=[ PosixPath('/boot') ], btrfs_subvol_infos=[] ), _PartitionInfo(...) ] ) ] ``` -------------------------------- ### Automate Archiso Build and Test Script Source: https://github.com/archlinux/archinstall/wiki/Testing-a-specific-disk-layout This script automates the process of building a custom archiso, cloning the archinstall repository, and setting up a specific disk layout with an encrypted partition. It's designed for testing the partitioner and base installation within a QEMU environment. Ensure you have necessary build tools and QEMU installed. ```bash #!/bin/bash if [ -z "$1" ] then echo "Need to define a output folder for the archiso:" echo "Example (build and run):" echo " ./test.sh ./archiso true" echo "Example (skip building and run ISO as given path):" echo " ./test.sh ./archiso" exit 1 fi REPO="https://github.com/Torxed/archinstall.git" ARCHISO_FOLDER=$1 REBUILD=$2 BRANCH="master" if [ $REBUILD ] then echo "Making a clean build!" `rm -rf "${ARCHISO_FOLDER}" 2>/dev/null` || ( echo "Could not delete protected folder:" echo "-> ${ARCHISO_FOLDER}" echo "Running as sudo." sudo rm -rf "${ARCHISO_FOLDER}" ) mkdir -p "${ARCHISO_FOLDER}" cp -r /usr/share/archiso/configs/releng/* "${ARCHISO_FOLDER}/" git clone "${REPO}" "${ARCHISO_FOLDER}/airootfs/root/archinstall-git" (cd "${ARCHISO_FOLDER}/airootfs/root/archinstall-git"; git checkout "${BRANCH}" ) echo "git" >> "${ARCHISO_FOLDER}/packages.x86_64" echo "python" >> "${ARCHISO_FOLDER}/packages.x86_64" echo "python-pip" >> "${ARCHISO_FOLDER}/packages.x86_64" echo "python-setuptools" >> "${ARCHISO_FOLDER}/packages.x86_64" cat <<\EOF >> "${ARCHISO_FOLDER}/airootfs/root/.zprofile" if [[ -z $DISPLAY && $XDG_VTNR -eq 1 ]]; then cd /root/archinstall-git pip uninstall archinstall -y >/dev/null 2>&1 git pull python setup.py install >/dev/null 2>&1 cd /root RED='\033[0;31m' YEL='\033[1;33m' NC='\033[0m' umount -R /mnt cryptsetup close /dev/mapper/luksloop wipefs -a -f -i -q /dev/sda parted -s /dev/sda mklabel gpt parted -s /dev/sda mkpart primary fat32 1MiB 513MiB parted -s /dev/sda name 1 EFI parted -s /dev/sda set 1 boot on parted -s /dev/sda set 1 esp on parted -s /dev/sda mkpart primary 513MiB 100% mkfs.fat -F32 /dev/sda1 echo -n "test" > /tmp/disk.pw cryptsetup \ --batch-mode \ --verbose \ --type luks2 \ --pbkdf argon2i \ --hash sha512 \ --key-size 512 \ --iter-time 10 \ --key-file /tmp/disk.pw \ --use-urandom \ luksFormat /dev/sda2 cryptsetup open /dev/sda2 luksloop --key-file /tmp/disk.pw --type luks2 mkfs.ext4 /dev/mapper/luksloop mount /dev/mapper/luksloop /mnt mkdir -p /mnt/boot mount /dev/sda1 /mnt/boot pacstrap /mnt base linux efibootmgr arch-chroot /mnt bootctl --no-variables --path=/boot install lsblk -f -o+TYPE,SIZE umount -R /mnt cryptsetup close /dev/mapper/luksloop echo "" echo -e "${RED}Note:${NC} This is a release candidate! (Experimental release: v2.1.4)" echo -e "Do not bother Arch Linux support staff about issues in this specific release candidate!" echo -e "Instead, ${YEL}create an Issue ticket on the Upstream GithHub page for support:${NC}" echo -e " https://github.com/archlinux/archinstall/issues" echo "" echo "Run 'python -m archinstall' when you are ready to test (configure your network first if needed)!" fi EOF ( cd "${ARCHISO_FOLDER}/"; sudo mkarchiso -v -w work/ -o out/ ./; ) fi if [ ! -f "./test.qcow2" ]; then qemu-img create -f qcow2 ./test.qcow2 15G fi sudo qemu-system-x86_64 \ -cpu host \ -enable-kvm \ -machine q35,accel=kvm \ -device intel-iommu \ -m 8192 \ -drive if=pflash,format=raw,readonly,file=/usr/share/ovmf/x64/OVMF_CODE.fd \ -drive if=pflash,format=raw,readonly,file=/usr/share/ovmf/x64/OVMF_VARS.fd \ -device virtio-scsi-pci,bus=pcie.0,id=scsi0 \ -device scsi-hd,drive=hdd0,bus=scsi0.0,id=scsi0.0,bootindex=2 \ -drive file=./test.qcow2,if=none,format=qcow2,discard=unmap,aio=native,cache=none,id=hdd0 \ -device virtio-scsi-pci,bus=pcie.0,id=scsi1 \ -device scsi-cd,drive=cdrom0,bus=scsi1.0,bootindex=1 \ -drive file=$(ls -t $ARCHISO_FOLDER/out/*.iso | head -n 1),media=cdrom,if=none,format=raw,cache=none,id=cdrom0 ``` -------------------------------- ### Boot Arch ISO in QEMU/KVM VM with Audio Support Source: https://github.com/archlinux/archinstall/blob/master/README.md Boots an Arch Linux ISO in QEMU/KVM with audio output enabled. This configuration is useful for testing audio during installation or in the live environment. ```bash qemu-system-x86_64 -enable-kvm \ -machine q35,accel=kvm -device intel-iommu \ -cpu host -m 4096 -boot order=d \ -drive if=pflash,format=raw,readonly,file=/usr/share/edk2/x64/OVMF_CODE.4m.fd \ -drive if=pflash,format=raw,readonly,file=/usr/share/edk2/x64/OVMF_VARS.4m.fd \ -drive file=./archlinux-2025.12.01-x86_64.iso,format=raw \ -device intel-hda -device hda-duplex,audiodev=snd0 \ -audiodev pa,id=snd0,server=/run/user/1000/pulse/native ``` -------------------------------- ### Example Disk Configuration JSON Source: https://github.com/archlinux/archinstall/blob/master/docs/installing/guided.rst This JSON structure outlines disk configuration details, including partition types, sizes, and encryption settings. It is part of the overall archinstall configuration. ```json { "sector_size": { "sector_size": null, "total_size": null, "unit": "B", "value": 512 }, "total_size": { "sector_size": null, "total_size": null, "unit": "B", "value": 16106127360 }, "unit": "MB", "value": 301 }, "status": "create", "type": "primary" } ], "wipe": false } ] }, "disk_encryption": { "encryption_type": "luks", "partitions": [ "3e75d045-21a4-429d-897e-8ec19a006e8b" ] }, "hostname": "archlinux", "kernels": [ "linux" ], "locale_config": { "kb_layout": "us", "sys_enc": "UTF-8", "sys_lang": "en_US" }, "mirror_config": { "custom_servers": [ { "url": "https://mymirror.com/$repo/os/$arch" } ], "mirror_regions": { "Australia": [ "http://archlinux.mirror.digitalpacific.com.au/$repo/os/$arch" ] }, "optional_repositories": [ "testing" ], "custom_repositories": [ { "name": "myrepo", "url": "https://myrepo.com/$repo/os/$arch", "sign_check": "Required", "sign_option": "TrustAll" } ] }, "network_config": {}, "no_pkg_lookups": false, "ntp": true, "offline": false, "packages": [], "parallel downloads": 0, "profile_config": null, "save_config": null, "script": "guided", "silent": false, "swap": true, "timezone": "UTC", "version": "2.6.0" } ``` -------------------------------- ### Run Archinstall from Git Repository Source: https://github.com/archlinux/archinstall/blob/master/README.md Clone the archinstall repository and run the installer using Python. This method ensures you have the latest code. ```shell git clone https://github.com/archlinux/archinstall cd archinstall python -m archinstall $@ ``` -------------------------------- ### Uninstall Existing Archinstall Version Source: https://github.com/archlinux/archinstall/blob/master/README.md Removes the currently installed version of archinstall before installing from source. Use with caution. ```bash pip uninstall --break-system-packages archinstall ``` -------------------------------- ### Example base.po File Content Source: https://github.com/archlinux/archinstall/blob/master/archinstall/locales/README.md This is an example of the content that might be found in a base.po file after running the locales_generator.sh script. 'msgid' is the original string, and 'msgstr' is where the translation will be placed. ```gettext #: lib/user_interaction.py:82 msgid "Do you really want to abort?" msgstr "" ``` -------------------------------- ### Manual Translation Example Source: https://github.com/archlinux/archinstall/blob/master/archinstall/locales/README.md An example of how to manually add a translation to the msgstr field in a base.po file. After editing, rerun the script to generate the .mo file. ```gettext #: lib/user_interaction.py:82 msgid "Do you really want to abort?" msgstr "Wollen sie wirklich abbrechen?" ``` -------------------------------- ### Install Nvidia Driver Dependencies Source: https://github.com/archlinux/archinstall/blob/master/docs/help/known_issues.rst When encountering issues with the proprietary Nvidia driver, installing the `linux-headers` and `nvidia-dkms` packages can resolve missing dependencies. ```console pacman -S linux-headers nvidia-dkms ``` -------------------------------- ### Clone archinstall repository Source: https://github.com/archlinux/archinstall/blob/master/docs/installing/python.rst Clones the archinstall source code repository from GitHub using git. This is the first step for manual installation from source. ```console git clone https://github.com/archlinux/archinstall ``` -------------------------------- ### Upgrade Archinstall on Live ISO Source: https://github.com/archlinux/archinstall/blob/master/README.md Perform a full system upgrade to upgrade archinstall on a live Arch ISO image. This ensures you have the latest version of the installer. ```shell pacman -Syu ``` -------------------------------- ### Set Hostname with Custom Command Source: https://github.com/archlinux/archinstall/blob/master/docs/cli_parameters/config/custom_commands.rst This JSON configuration snippet demonstrates how to use the 'custom_commands' option to set a new hostname within the installed system. The command is executed via arch-chroot after the base installation. ```json { "custom_commands": [ "hostname new-hostname" ] } ``` -------------------------------- ### Update Arch Linux Keyring Source: https://github.com/archlinux/archinstall/blob/master/README.md Run this command to install the latest keyrings for Arch Linux. This is a quick fix for keyring-related issues. ```bash pacman -Sy archlinux-keyring ``` -------------------------------- ### Booting Qemu with UKI and Harddrives Source: https://github.com/archlinux/archinstall/blob/master/test_tooling/qemu/README.md Run this command after `mkosi -B build` to boot a Qemu instance with a specified UKI and harddrives. ```bash python test_tooling/qemu/qemu.py \ --uki ./test_tooling/mkosi/mkosi.output/image_13.efi \ --harddrive ~/test.qcow2:15G \ --harddrive ~/test_large.qcow2:25G ``` -------------------------------- ### Run Archinstall with Configuration Files Source: https://github.com/archlinux/archinstall/blob/master/README.md Launch archinstall using a user configuration file and optionally a credentials file. These files can be local paths or URLs. ```shell archinstall --config --creds ``` -------------------------------- ### Run Project in QEMU with Custom Drive and Device Source: https://github.com/archlinux/archinstall/blob/master/test_tooling/mkosi/README.md Execute a built project in QEMU, specifying a custom drive and attaching it as an NVMe device. This is useful for testing bootable images. ```bash mkosi qemu \ --drive=archinstall_small:25G \ -- \ -device nvme,serial=archinstall_small,drive=archinstall_small ``` -------------------------------- ### Boot Arch ISO in QEMU/KVM VM Source: https://github.com/archlinux/archinstall/blob/master/README.md Launches an Arch Linux ISO image in a QEMU/KVM virtual machine for testing archinstall. Ensure the ISO file path is correct. ```bash qemu-system-x86_64 -enable-kvm \ -machine q35,accel=kvm -device intel-iommu \ -cpu host -m 4096 -boot order=d \ -drive if=pflash,format=raw,readonly,file=/usr/share/edk2/x64/OVMF_CODE.4m.fd \ -drive if=pflash,format=raw,readonly,file=/usr/share/edk2/x64/OVMF_VARS.4m.fd \ -drive file=./archlinux-2025.12.01-x86_64.iso,format=raw ``` -------------------------------- ### Build Project with mkosi Source: https://github.com/archlinux/archinstall/blob/master/test_tooling/mkosi/README.md Use this command to build a project using mkosi. Ensure you are in the project directory. ```bash mkosi build -B ``` -------------------------------- ### Run Project in QEMU with Boot Index and No Kernel (Experimental) Source: https://github.com/archlinux/archinstall/blob/master/test_tooling/mkosi/README.md This is an experimental command for running a project in QEMU, attempting to disable UKI and set a specific boot index. It may not boot properly. ```bash mkosi qemu --drive=archinstall_small:25G -- -device nvme,serial=archinstall_small,drive=archinstall_small,bootindex=0 -kernel none ``` -------------------------------- ### Archinstall Testing Script Source: https://github.com/archlinux/archinstall/wiki/Testing-partitioning-over-old-windows-installation This script automates the process of building and running an Arch Linux ISO for testing purposes. It handles cloning the archinstall repository, configuring packages, and setting up the environment for QEMU testing. Ensure you have the necessary ISOs downloaded. ```bash #!/bin/bash if [ -z "$1" ] then echo "Need to define a output folder for the archiso:" echo "Example (build and run):" echo " ./test.sh ./archiso true" echo "Example (skip building and run ISO as given path):" echo " ./test.sh ./archiso" exit 1 fi REPO="https://github.com/Torxed/archinstall.git" ARCHISO_FOLDER=$1 REBUILD=$2 BRANCH="master" if [ $REBUILD ] then echo "Making a clean build!" `rm -rf "${ARCHISO_FOLDER}" 2>/dev/null` || ( echo "Could not delete protected folder:" echo "-> ${ARCHISO_FOLDER}" echo "Running as sudo." sudo rm -rf "${ARCHISO_FOLDER}" ) mkdir -p "${ARCHISO_FOLDER}" cp -r /usr/share/archiso/configs/releng/* "${ARCHISO_FOLDER}/" git clone "${REPO}" "${ARCHISO_FOLDER}/airootfs/root/archinstall-git" (cd "${ARCHISO_FOLDER}/airootfs/root/archinstall-git"; git checkout "${BRANCH}" ) echo "git" >> "${ARCHISO_FOLDER}/packages.x86_64" echo "python" >> "${ARCHISO_FOLDER}/packages.x86_64" echo "python-pip" >> "${ARCHISO_FOLDER}/packages.x86_64" echo "python-setuptools" >> "${ARCHISO_FOLDER}/packages.x86_64" cat <<\EOF >> "${ARCHISO_FOLDER}/airootfs/root/.zprofile" if [[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] then cd /root/archinstall-git pip uninstall archinstall -y >/dev/null 2>&1 git pull python setup.py install >/dev/null 2>&1 cd /root RED='\033[0;31m' YEL='\033[1;33m' NC='\033[0m' echo "" echo -e "${RED}Note:${NC} This is a release candidate! (Experimental release: v2.1.4)" echo -e "Do not bother Arch Linux support staff about issues in this specific release candidate!" echo -e "Instead, ${YEL}create an Issue ticket on the Upstream GithHub page for support:${NC}" echo -e " https://github.com/archlinux/archinstall/issues" echo "" echo "Run 'python -m archinstall' when you are ready to test (configure your network first if needed)!" fi EOF ( cd "${ARCHISO_FOLDER}/"; sudo mkarchiso -v -w work/ -o out/ ./; ) fi if [ ! -f "./test.qcow2" ]; then qemu-img create -f qcow2 ./test.qcow2 35G fi sudo qemu-system-x86_64 \ -cpu host \ -enable-kvm \ -machine q35,accel=kvm \ -device intel-iommu \ -m 8192 \ -nic none \ -drive if=pflash,format=raw,readonly,file=/usr/share/ovmf/x64/OVMF_CODE.fd \ -drive if=pflash,format=raw,readonly,file=/usr/share/ovmf/x64/OVMF_VARS.fd \ -device virtio-scsi-pci,bus=pcie.0,id=scsi0 \ -device scsi-hd,drive=hdd0,bus=scsi0.0,id=scsi0.0,bootindex=2 \ -drive file=./test.qcow2,if=none,format=qcow2,discard=unmap,aio=native,cache=none,id=hdd0 \ -device virtio-scsi-pci,bus=pcie.0,id=scsi1 \ -device scsi-cd,drive=cdrom0,bus=scsi1.0,bootindex=1 \ -drive file=$(ls ~/Downloads/Win10_*.iso | head -n 1),media=cdrom,if=none,format=raw,cache=none,id=cdrom0 \ -cdrom $(ls ~/Downloads/virtio-win*.iso | head -n 1) sudo qemu-system-x86_64 \ -cpu host \ -enable-kvm \ -machine q35,accel=kvm \ -device intel-iommu \ -m 8192 \ -drive if=pflash,format=raw,readonly,file=/usr/share/ovmf/x64/OVMF_CODE.fd \ -drive if=pflash,format=raw,readonly,file=/usr/share/ovmf/x64/OVMF_VARS.fd \ -device virtio-scsi-pci,bus=pcie.0,id=scsi0 \ -device scsi-hd,drive=hdd0,bus=scsi0.0,id=scsi0.0,bootindex=2 \ -drive file=./test.qcow2,if=none,format=qcow2,discard=unmap,aio=native,cache=none,id=hdd0 \ -device virtio-scsi-pci,bus=pcie.0,id=scsi1 \ -device scsi-cd,drive=cdrom0,bus=scsi1.0,bootindex=1 \ -drive file=$(ls -t $ARCHISO_FOLDER/out/*.iso | head -n 1),media=cdrom,if=none,format=raw,cache=none,id=cdrom0 ``` -------------------------------- ### Run Archinstall with AUR Plugin Source: https://github.com/archlinux/archinstall/blob/master/docs/help/known_issues.rst This command demonstrates how to use an AUR plugin with archinstall, allowing for features or fixes not present in the official package. ```console archinstall --plugin ``` -------------------------------- ### Run Alternative Archinstall Scripts Source: https://github.com/archlinux/archinstall/blob/master/README.md Execute specific scripts within the archinstall package using the --script parameter. Consult -h or --help for available options. ```shell archinstall --script ``` -------------------------------- ### List Hard Drives with Archinstall Source: https://github.com/archlinux/archinstall/blob/master/docs/examples/python.rst This Python script imports the device handler from archinstall and prints a list of all detected hard drives. It requires root privileges to run. ```python from archinstall.lib.disk.device_handler import device_handler from pprint import pprint pprint(device_handler.devices) ``` -------------------------------- ### Manual Partitioning Configuration Source: https://github.com/archlinux/archinstall/blob/master/docs/cli_parameters/config/disk_config.rst Enables near-endless flexibility for disk partitioning using pyparted. Requires detailed dictionary definitions for partitions. ```json { "disk_config": { "config_type": "manual_partitioning", "device_modifications": [ "filesystem struct" ] } } ``` -------------------------------- ### Add Packages for ISO Source: https://github.com/archlinux/archinstall/wiki/Building-and-Testing Lists packages to be included in the ISO. Ensure these are added to the `packages.x86_64` file. ```plaintext git python python-setuptools ``` -------------------------------- ### Run Archinstall from Source Source: https://github.com/archlinux/archinstall/blob/master/README.md Executes archinstall directly from the source code using Python. This method is suitable when no new dependencies have been introduced. ```bash python -m archinstall ``` -------------------------------- ### Build the ISO with mkarchiso Source: https://github.com/archlinux/archinstall/wiki/Building-and-Testing Command to build the ISO image using mkarchiso. It specifies verbose output, work directory, and output directory. ```bash # mkarchiso -v -w work/ -o out/ ./ ``` -------------------------------- ### Clone Archinstall Repository Source: https://github.com/archlinux/archinstall/blob/master/README.md Clones the archinstall GitHub repository to your local machine. This is the first step for testing development versions. ```bash git clone https://github.com/archlinux/archinstall ``` -------------------------------- ### Import archinstall library Source: https://github.com/archlinux/archinstall/blob/master/docs/installing/python.rst Imports the archinstall library into a Python script after cloning the source code and moving the folder into your project. ```python import archinstall ``` -------------------------------- ### Populate Translation Strings Source: https://github.com/archlinux/archinstall/blob/master/archinstall/locales/README.md Run this script to automatically populate the base.po file with strings that need translation. This should be run after creating the new language directory. ```bash ./locales_generator.sh ``` -------------------------------- ### Create New Language Template Source: https://github.com/archlinux/archinstall/blob/master/archinstall/locales/README.md Use this command to create the necessary directory structure and an empty base.po file for a new language translation. ```bash mkdir -p /LC_MESSAGES/ && touch /LC_MESSAGES/base.po ``` -------------------------------- ### Configure User Credentials for Archinstall Source: https://github.com/archlinux/archinstall/blob/master/docs/installing/guided.rst This JSON structure defines credentials for regular users, including username, hashed password, and sudo privileges. It is used with the --creds option. ```json { "username": "", "enc_password": "", "sudo": false } ``` -------------------------------- ### Clone Archinstall Repository Source: https://github.com/archlinux/archinstall/wiki/Building-and-Testing Clones the archinstall repository into the ISO's root filesystem. This makes the archinstall script available within the built ISO. ```bash # git clone https://github.com/Torxed/archinstall airootfs/root/archinstall-git ``` -------------------------------- ### Best Effort Disk Layout Configuration Source: https://github.com/archlinux/archinstall/blob/master/docs/cli_parameters/config/disk_config.rst This mode attempts to create a sane default disk layout, potentially wiping existing data. It's similar to manual partitioning but generated via the menu system. ```json { "disk_config": { "config_type": "default_layout", "device_modifications": [ { "device": "/dev/sda", "wipe": true, "partitions": "..." } ] } } ``` -------------------------------- ### Provide Archinstall Credentials Decryption Key Source: https://github.com/archlinux/archinstall/blob/master/README.md Decrypt the user credentials file when running archinstall. The key can be provided via a command-line argument or an environment variable. ```shell archinstall --creds --creds-decryption-key ``` -------------------------------- ### Btrfs Partition Configuration Source: https://github.com/archlinux/archinstall/blob/master/docs/cli_parameters/config/disk_config.rst Defines a Btrfs partition with specific subvolumes and mount options. The overall partition mountpoint is null, with individual subvolumes having their mountpoints set. ```json { "btrfs": [ { "mountpoint": "/", "name": "@", }, { "mountpoint": "/home", "name": "@home", }, { "mountpoint": "/var/log", "name": "@log", }, { "mountpoint": "/var/cache/pacman/pkg", "name": "@pkg" } ], "dev_path": null, "flags": [], "fs_type": "btrfs", "mount_options": [ "compress=zstd" ], "mountpoint": null, "obj_id": "d712357f-97cc-40f8-a095-24ff244d4539", "size": { "sector_size": { "unit": "B", "value": 512 }, "unit": "B", "value": 15568207872 }, "start": { "sector_size": { "unit": "B", "value": 512 }, "unit": "MiB", "value": 513 }, "status": "create", "type": "primary" } ``` -------------------------------- ### Configure LUKS Disk Encryption Source: https://github.com/archlinux/archinstall/blob/master/docs/cli_parameters/config/disk_encryption.rst Use this JSON structure in the user configuration to enable LUKS disk encryption. The 'partitions' list should contain internal references (obj_id) to disk configuration entries. ```json { "disk_encryption": { "encryption_type": "luks", "partitions": [ "d712357f-97cc-40f8-a095-24ff244d4539" ] } } ``` -------------------------------- ### Fix Arch Linux Keyring Sync Issues Source: https://github.com/archlinux/archinstall/blob/master/docs/help/known_issues.rst Use this command sequence to manually reset and update the Arch Linux keyring if the automatic sync service fails. This involves clearing existing GPG data and repopulating the keys. ```console # killall gpg-agent # rm -rf /etc/pacman.d/gnupg # pacman-key --init # pacman-key --populate # pacman -Sy archlinux-keyring # systemctl restart archlinux-keyring-wkd-sync.timer ``` -------------------------------- ### Set Root Password for Archinstall Source: https://github.com/archlinux/archinstall/blob/master/docs/installing/guided.rst Use this JSON snippet to set the root account password when using the --creds option. This is optional if disk encryption is not required. ```json { "root_enc_password" : "SecretSanta2022" } ``` -------------------------------- ### Checkout a Specific Branch Source: https://github.com/archlinux/archinstall/blob/master/README.md Switches to a specific feature branch within the cloned archinstall repository. Useful for testing particular versions or features. ```bash git checkout v2.3.1-rc1 ``` -------------------------------- ### Define a Pacstrap Plugin Function Source: https://github.com/archlinux/archinstall/blob/master/docs/archinstall/plugins.rst This Python function can be implemented in a plugin to hook into the pacstrap process. Archinstall will look for functions named 'on_pacstrap' to potentially modify the package list. ```python def on_pacstrap(*packages): ... ``` -------------------------------- ### Set Console Font Source: https://github.com/archlinux/archinstall/blob/master/archinstall/locales/README.md If a font for a specific language is not available on the ISO, you can manually set a console font using the 'setfont' command. Available fonts are located in /usr/share/kbd/consolefonts. ```bash setfont LatGrkCyr-8x16 ``` -------------------------------- ### Set Console Font Source: https://github.com/archlinux/archinstall/blob/master/README.md Command to set a specific console font. Ensure the font exists in the specified directory. ```shell setfont LatGrkCyr-8x16 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.