Installing Slackware in QEMU

Last update: 2025-05-15 00:27:41 +0800 +0800
Available translations: 日本語 / 中文(简体) / 中文(繁體)

Slackware retains a direct relationship between its mirror tree, installation media, package series, and text-mode installer. Understanding that structure helps when selecting packages and diagnosing an installation. The examples below install Slackware64 15.0 in a UEFI QEMU virtual machine.

Slackware Resources and Mirror Tree #

The primary project resources are:

A mirror root contains historical releases, stable-release aliases, development trees, ISO images, and unsupported additions:

text
slackware/
├── slackware-15.0/          # 32-bit x86 release
├── slackware/               # current stable 32-bit release
├── slackware-current/       # development branch
├── slackware64-15.0/        # 64-bit x86 release
├── slackware64/             # current stable 64-bit release
├── slackware64-current/     # 64-bit development branch
├── slackware-iso/           # release ISO images and verification files
├── slackware-pre-1.0-beta/  # early historical material
└── unsupported/             # contributed boot media, packages, and add-ons

slackware-current and slackware64-current are development branches, not aliases for the latest stable release. The version sequence jumps from 4.0 to 7.0; versions 5 and 6 were skipped when the project aligned its version number with contemporary distributions.

A release directory is also an installable repository. Slackware64 15.0, for example, contains:

text
slackware64-15.0/
├── ChangeLog.txt
├── CHECKSUMS.md5
├── CHECKSUMS.md5.asc
├── FILELIST.TXT
├── GPG-KEY
├── PACKAGES.TXT
├── README_UEFI.TXT
├── Slackware-HOWTO
├── EFI/
├── extra/
├── isolinux/
├── kernels/
├── patches/
├── slackware64/
├── source/
├── testing/
└── usb-and-pxe-installers/

slackware64/ contains the release package series. patches/ receives security and correctness updates for the stable release, while source/ contains the corresponding build material. PACKAGES.TXT describes packages, and FILELIST.TXT lists the complete tree.

Boot Media #

Slackware originally divided its packages into floppy-sized disk sets because downloading an entire distribution was impractical. Floppy installation is no longer supported, but the package-series organization remains.

The Slackware64 15.0 ISO directory provides slackware64-15.0-install-dvd.iso together with an MD5 file, a detached signature, and a text file containing the ISO manifest. The installation DVD contains the binary package tree but omits the source tree so that the image fits on single-layer DVD media. A mirror tree can also be used for HTTP, FTP, NFS, PXE, or manually mounted installation sources.

The installer ISO is hybrid media with BIOS and UEFI boot data. QEMU can attach it directly as a virtual CD-ROM, so writing it to physical media is unnecessary.

Download the image and its signature from the same release directory, import the project’s GPG-KEY, and verify the signature before booting:

sh
curl -O https://mirrors.slackware.com/slackware/slackware-iso/slackware64-15.0-iso/slackware64-15.0-install-dvd.iso
curl -O https://mirrors.slackware.com/slackware/slackware-iso/slackware64-15.0-iso/slackware64-15.0-install-dvd.iso.asc
curl -O https://mirrors.slackware.com/slackware/slackware64-15.0/GPG-KEY

gpg --import GPG-KEY
gpg --verify slackware64-15.0-install-dvd.iso.asc \
  slackware64-15.0-install-dvd.iso

Package Series #

Slackware64 15.0 divides its binary packages into the following series:

SeriesContents
aBase system; the installer requires this series
apConsole applications and other non-X programs
dCompilers, debuggers, interpreters, and development tools
eGNU Emacs
fFAQs, HOWTOs, and other documentation
kLinux kernel source
kdeKDE Plasma and its applications
lShared libraries and supporting software
nNetworking programs and services
tTeX typesetting software
tclTcl, Tk, and related tools
xX Window System
xapGraphical applications outside a desktop series
xfceXfce desktop environment
yText-mode BSD games

The series are categories rather than independently resolved dependency groups. For example, Slackware64 15.0 places Vim in ap and one of its shared libraries, libsodium, in l. Removing an entire series by category can therefore break programs retained from another series.

The Slackware64 15.0 HOWTO calculates about 16 GB for all series. A 32 GiB virtual disk leaves room for the installed system, package updates, logs, and working data. A full installation is the least error-prone choice when disk space is available.

Creating the Virtual Machine #

Install QEMU and OVMF through the host package manager. OVMF package paths vary by distribution; locate the code and variable-store images before running the commands below. Copy the variable-store template because QEMU must write UEFI variables without modifying the packaged template.

sh
qemu-img create -f qcow2 slackware64-15.0.qcow2 32G
cp /usr/share/OVMF/OVMF_VARS.fd ./OVMF_VARS.fd

qemu-system-x86_64 \
  -machine q35 \
  -m 4G \
  -smp 4 \
  -drive if=pflash,format=raw,readonly=on,file=/usr/share/OVMF/OVMF_CODE.fd \
  -drive if=pflash,format=raw,file=OVMF_VARS.fd \
  -drive file=slackware64-15.0.qcow2,format=qcow2,if=virtio \
  -drive file=slackware64-15.0-install-dvd.iso,media=cdrom,readonly=on \
  -nic user,model=virtio-net-pci \
  -boot order=d

The virtio disk appears as /dev/vda, and the virtual CD-ROM normally appears as /dev/sr0. Omitting both pflash drives starts QEMU with its default legacy BIOS instead; a BIOS installation uses LILO rather than ELILO.

Partitioning the Virtual Disk #

Accept the default installer kernel, select a keyboard map if required, and log in as root without a password. Inspect the devices before changing the partition table:

sh
lsblk
cgdisk /dev/vda

Create a GPT with these partitions:

PartitionSizeGPT typePurpose
/dev/vda1512 MiBEF00EFI System Partition
/dev/vda24 GiB8200Swap
/dev/vda3Remaining space8300Linux root filesystem

Write the table and quit cgdisk. The installer formats the swap and root partitions later. Setup also detects the EFI System Partition, formats it as FAT when required, and mounts it at /boot/efi.

Running Setup #

Start the installer:

sh
setup

A standard installation follows the setup menu in this order:

  1. KEYMAP is optional when the default US layout is suitable.
  2. ADDSWAP detects /dev/vda2, formats it as swap, activates it, and adds it to the future /etc/fstab.
  3. TARGET selects /dev/vda3 as / and formats it. Ext4 is a suitable default for this virtual machine.
  4. SOURCE selects Install from a Slackware CD or DVD and scans for the media. The attached ISO should be detected as /dev/sr0.
  5. SELECT chooses package series. Retain a; choose all series for a full installation or remove only sets whose dependency consequences are known.
  6. INSTALL chooses a package-prompting mode and copies the selected packages.
  7. CONFIGURE installs the kernel and configures the boot loader, network, services, console, clock, time zone, and root password.

The installation modes control prompting rather than dependency resolution:

ModeBehavior
fullInstalls every package in each selected series
tersePerforms the same installation as full with one-line progress
menu or expertPresents per-series package checklists
newbiePrompts for each package not marked as required
custom or tagpathApplies administrator-supplied tagfiles

full or terse avoids omissions caused by cross-series dependencies. Tagfiles are useful when reproducing the same package selection across multiple machines.

During package installation, Alt+F2 opens another installer console. Commands such as df -hT can then monitor the target filesystem. Alt+F1 returns to setup. The mounted installation tree can also be inspected from the second console, commonly below /mnt/cdrom.

Configuring UEFI Boot #

Because the virtual machine booted the installer through OVMF, setup detects a UEFI installation. Skip LILO when prompted, install ELILO, and allow setup to create the Slackware firmware entry. ELILO places its files under /boot/efi/EFI/Slackware.

Finish the remaining configuration screens and set a root password. Exit setup, shut down the guest, remove the ISO drive from the QEMU command, and start the virtual machine with the disk first:

sh
qemu-system-x86_64 \
  -machine q35 \
  -m 4G \
  -smp 4 \
  -drive if=pflash,format=raw,readonly=on,file=/usr/share/OVMF/OVMF_CODE.fd \
  -drive if=pflash,format=raw,file=OVMF_VARS.fd \
  -drive file=slackware64-15.0.qcow2,format=qcow2,if=virtio \
  -nic user,model=virtio-net-pci \
  -boot order=c

After the first boot, select one repository in /etc/slackpkg/mirrors and apply stable-release patches:

sh
slackpkg update gpg
slackpkg update
slackpkg upgrade-all

Post-Installation Verification #

Create an unprivileged account with adduser and grant only the administrative group access required by local policy. Review enabled startup scripts with ls -l /etc/rc.d/; Slackware starts a service when its corresponding script is executable, so disable an unused service by removing execute permission rather than deleting the packaged file.

Verify the installed boot and network state before treating the disk image as a reusable base:

sh
findmnt /
swapon --show
ip address
ip route
efibootmgr --verbose
uname -a

efibootmgr requires access to UEFI variables and therefore reports useful data only when the guest booted through OVMF with a writable variable store. Shut down the guest cleanly before copying or snapshotting the qcow2 image.

Comments

Read or comment on GitHub (sign-in required to comment)