Archlinux Live

Posted on  by

The Linux kernel, initramfs and squashfs files for the live system are downloaded from an Arch Linux mirror. The integrity of all downloaded files is verified with cryptographic signatures. To use netboot, the following requirements must be met: Wired (ethernet) internet connection with DHCP autoconfiguration. Arch Linux Downloads Release Info. The image can be burned to a CD, mounted as an ISO file, or be directly written to a USB stick using a utility like dd.It is intended for new installations only; an existing Arch Linux system can always be updated with pacman -Syu. Current Release: 2020.12.01 Included Kernel: 5.9.11 ISO Size: 682.3 MB.

Archiso is a tool for building Arch Linux live CD ISO images. The official images are built with Archiso. Archiso is configurable and can be used as the basis for different systems, for example rescue systems, or linux installers. This wiki article explains how to install Archiso, and how to configure it to control aspects of the resulting ISO image such as included packages and files. Technical requirements and build steps can be found in the official project documentation. Archiso is implemented with a number of bash scripts. The core component of Archiso is the mkarchiso command. Its options are documented in its usage output and not covered here.

Installation

Install the archiso or archiso-gitAUR package.

Prepare a custom profile

Archiso comes with two profiles, releng and baseline.

  • releng is used to create the official monthly installation ISO. It can be used as a starting point for creating a customized ISO image.
  • baseline is a minimalistic configuration, that includes only the bare minimum packages required to boot the live environment from the medium.

To build an unmodified version of the profiles, skip to #Build the ISO. Otherwise, if you wish to adapt or customize one of archiso's shipped profiles, copy it from /usr/share/archiso/configs/profile-name/ to a writable directory with a name of your choice. For example:

Proceed to the following sections to customize and build the custom profile.

Profile structure

An archiso profile contains configuration that defines the resulting ISO image. The profile structure is documented in README.profile.rst.

Selecting packages

Edit packages.x86_64 to select which packages are to be installed on the live system image, listing packages line by line.

Custom local repository

To add packages not located in standard Arch repositories (e.g. custom packages or packages from AUR/ABS), set up a custom local repository and add your custom packages to it. Then add your repository to pacman.conf as follows:

Note: The ordering within pacman.conf matters. To give top priority to your custom repository, place it above the other repository entries.

Packages from multilib

To install packages from the multilib repository, simply uncomment that repository in pacman.conf.

Adding files to image

The airootfs directory is used as the starting point for the root directory (/) of the live system on the image. All its contents will be copied over to the working directory before packages are installed.

Place any custom files and/or directories in the desired location under airootfs/. For example, if you have a set of iptables scripts on your current system you want to be used on you live image, copy them over as such:

Similarly, some care is required for special configuration files that reside somewhere down the hierarchy. Missing parts of the directory structure can be simply created with mkdir(1).

Tip: To add a file to all users home directories, place it in archlive/airootfs/etc/skel/.
Note: Custom files that conflict with those provided by packages will be overwritten unless a package specifies them as backup files.

By default, permissions will be 644 for files and 755 for directories. All of them will be owned by the root user. To set different permissions or ownership for specific files and/or folders, use the file_permissions associative array in profiledef.sh. See README.profile.rst for details.

Kernel

Although both archiso's included profiles only have linux, ISOs can be made to include other or even multiple kernels.

First, edit packages.x86_64 to include kernel package names that you want. When mkarchiso runs, it will include all work_dir/airootfs/boot/vmlinuz-* and work_dir/boot/initramfs-*.img files in the ISO (and additionally in the FAT image used for UEFI booting).

mkinitcpio presets by default will build fallback initramfs images. For an ISO, the main initramfs image would not typically include the autodetect hook, thus making an additional fallback image unnecessary. To prevent the creation of an fallback initramfs image, so that it does not take up space or slow down the build process, place a custom preset in archlive/airootfs/etc/mkinitcpio.d/pkgbase.preset. For example, for linux-lts:

Finally create boot loader configuration to allow booting the kernel(s).

Boot loader

Archiso supports syslinux for BIOS booting and systemd-boot for UEFI booting. Refer to the articles of the boot loaders for information on their configuration syntax.

Tip:
  • The releng profile by default builds into an ISO that supports both BIOS and UEFI booting when burned to an optical disc using El Torito when written to a hard disk (or USB flash drive, or similar) using Isohybrid.
  • Due to the modular nature of isolinux, you are able to use lots of addons since all .c32 files are copied and available to you. Take a look at the official syslinux site and the archiso git repo. Using said addons, it is possible to make visually attractive and complex menus. See [1].

mkarchiso expects that systemd-boot configuration is in the efiboot directory, and syslinux configuration in syslinux and isolinux directories.

Archlinux

UEFI Secure Boot

If you want to make your Archiso bootable on a UEFI Secure Boot enabled environment, you must use a signed boot loader. You can follow the instructions on Secure Boot#Booting an installation medium.

systemd units

To enable systemd services/sockets/timers for the live environment, you need to manually create the symbolic links just as systemctl enable does it.

For example, to enable gpm.service, which contains WantedBy=multi-user.target, run:

The required symlinks can be found out by reading the systemd unit, or if you have the service installed, by enabling it and observing the systemctl output.

Login manager

Starting X at boot is done by enabling your login manager's systemd service. If you do not know which .service enable, you can easily find out in case you are using the same program on the system you build your ISO on. Just use:

Now create the same symlink in archlive/airootfs/etc/systemd/system/. For LXDM:

This will enable LXDM at system start on your live system.

Changing automatic login

The configuration for getty's automatic login is located under airootfs/etc/systemd/system/getty@tty1.service.d/autologin.conf.

You can modify this file to change the auto login user:

Or remove it altogether to disable auto login.

Users and passwords

To create a user which will be available in the live environment, you must manually edit archlive/airootfs/etc/passwd, archlive/airootfs/etc/shadow, archlive/airootfs/etc/group and archlive/airootfs/etc/gshadow.

Note: If these files exist, they must contain the root user and group.

For example, to add a user archie. Add them to archlive/airootfs/etc/passwd following the passwd(5) syntax:

Generate a password hash with openssl passwd -6 and add it to archlive/airootfs/etc/shadow following the syntax of shadow(5). For example:

Add the user's group and the groups which they will part of to archlive/airootfs/etc/group according to group(5). For example:

Create the appropriate archlive/airootfs/etc/gshadow according to gshadow(5):

Make sure /etc/shadow and /etc/gshadow have the correct permissions:

Archlinux Live

After package installation, mkarchiso will create all specified home directories for users listed in archlive/airootfs/etc/passwd and copy work_directory/x86_64/airootfs/etc/skel/* to them. The copied files will have proper user and group ownership.

Build the ISO

Build an ISO which you can then burn to CD or USB by running:

  • -w specifies the working directory. If the option is not specified, it will default to work in the current directory.
  • -o specifies the directory where the built ISO image will be placed. If the option is not specified, it will default to out in the current directory.
  • It should be noted the profile file profiledef.sh cannot be specified when running mkarchiso, only the path to the file

Replace /path/to/profile/ with /usr/share/archiso/configs/releng/ if you are building an unmodified profile or with the path to your custom profile.

Tip: If memory allows, it is preferred to place the working directory on tmpfs. E.g.:

When run, the script will download and install the packages you specified to work_directory/x86_64/airootfs, create the kernel and init images, apply your customizations and finally build the ISO into the output directory.

Removal of work directory

Warning: If mkarchiso is interrupted, run findmnt(8) to make sure there are no mount binds before deleting it - otherwise, you may lose data (e.g. an external device mounted at /run/media/user/label gets bound within work/x86_64/airootfs/run/media/user/label during the build process).

The temporary files are copied into work directory. After successfully building the ISO , the work directory and its contents can be deleted. E.g.:

Using the ISO

See Installation guide#Prepare an installation medium for various options.

Test the ISO in QEMU

Install the optional dependencies qemu and edk2-ovmf.

Use the convenience script run_archiso to run a built image using QEMU. Ion vcr2pc drivers.

The virtual machine can also be run using UEFI emulation:

Tips and tricks

Prepare an ISO for an installation via SSH

To install Arch Linux via SSH without any interraction with the system, the installation ISO must have openssh installed, sshd.service enabled and a public SSH key must be placed in authorized_keys.

First copy Archiso's releng profile to writable directory. The following examples will use archlive.

As described in #systemd units, systemd services in the live environment are enabled by creating the correct symbolic links. Use the following commands to enable sshd.service so that it gets started when the live environment boots:

Create a .ssh directory in the home directory of the user which will be used to log in. The following examples will be using the root user.

Add the public SSH key(s), which will be used to log in, to authorized_keys:

Archlinux Live

Set the correct permissions and ownership for the .ssh directory and the authorized_keys file:

Finally build the ISO. Upon booting the ISO, OpenSSH will start and it will be possible to log in using the SSH key.

Automatically connect to a Wi-Fi network using iwd

Create /var/lib/iwd/ inside the profile's airootfs directory and set the correct permissions:

Follow the instructions in iwd#Network configuration and iwd.network(5) to create a network configuration file for your Wi-Fi network.

Save the configuration file inside archlive/airootfs/var/lib/iwd/.

Troubleshooting

Window manager freezes

If you want to use a window manager in the Live CD then you must add the necessary and correct video drivers, or the WM may freeze on loading.

See also

Retrieved from 'https://wiki.archlinux.org/index.php?title=Archiso&oldid=644131'
Live
  • Categories: bash , cli , linux
  • 3 minutes read

Creating a Arch Linux live USB is easy. In this post, I will walk you throughdownloading and verifying the image, finding your USB drive and copying theimage onto it, all from the convenience of the command line.

Arch Linux Live Download

Download image and PGP signature

Download the latest Arch Linux image from https://www.archlinux.org/download/.The preferred option is to download the image using BitTorrent, in order not toburden the Arch servers unnecessarily.

Verify downloaded image

Aac2010 keygen 64 bit free download. If this disk is being created on an Arch Linux system, you could alsoinvoke:

The -v switch is short for --verify.

Insert USB drive and check the device name

Arch Linux Live Iso

The -l is short for --list, and will display the device names andpartition tables.

Output will look like:

Check the output and find the device name of the USB (for instance/dev/sdc). Make sure this device is not mounted, otherwise thenext command will fail. Also make sure you note the device name, andnot a partition (indicated by a numeral at the end: /dev/sdc1, forexample).

Copy Arch Linux image to USB drive

Breakdown:

Archlinux Live Download

  • if indicates the input file (the .iso of the live Linux distro).
  • of, likewise, points to the output file, which is a device in thiscase. Note that /dev/sdX needs to be replaced with the device namewe found in the previous step.
  • bs=64K indicates the block size, which means that dd will readand write up to 64K bytes at a time. The default is 512 bytes. Itreally depends what the optimal block size is, but severalsourcesindicate that 64K is a good bet on somewhat modern to modernhardware.
  • oflag stands for “output flag”. The sync flag will make surethat all data is written to the USB stick when the dd commandexits, so it will be safe to remove the USB stick.
  • status=progress indicates the level of information that is printedduring file transfer. progress shows periodic transfer statistics.

How To Install Arch Linux

Notice that the device does not need to be partitioned or empty beforethis operation. When dd writes to a device rather than a partition,all data on the drive – including partitions – will be erased anyway.