Syslinux

On this page 7

Syslinux is a family of lightweight bootloaders that load the Linux kernel and initramfs from FAT file systems, optical media, the network or ext partitions. In Linux system initialization, it occupies the stage between firmware and kernel, the same position GRUB or systemd-boot holds on other systems, but with a deliberately small feature set and plain text configuration.

Started by H. Peter Anvin in 1994, the project became the standard way to boot installation media, live systems and rescue disks. Its variants SYSLINUX, ISOLINUX, PXELINUX and EXTLINUX share one configuration language and one module system, which made it popular with distribution builders who needed the same boot menu on USB sticks, CDs and PXE servers.

How Syslinux boots a Linux system

On BIOS machines, Syslinux works in two stages. A tiny piece of code in the boot sector or Master Boot Record loads the core file ldlinux.sys, which knows just enough of the file system to read its configuration file, display a prompt or menu and load the selected kernel and initramfs into memory.

Once the kernel and initial RAM disk are loaded, Syslinux passes the kernel command line from the APPEND directive and jumps to the kernel entry point. From that moment the bootloader is gone; the kernel unpacks the initramfs, and the init system such as systemd takes over.

The stages and their responsibilities are summarized in the following table.

StageComponentTask
FirmwareBIOSReads the first sector of the boot device
Boot sector codembr.bin or gptmbr.bin plus VBRFinds and loads the core image
Core loaderldlinux.sys and ldlinux.c32Reads config, shows prompt or menu
ModulesCOM32 .c32 filesMenus, chainloading, hardware detection
HandoffKernel and initramfsKernel starts, init system takes over
Boot stages with Syslinux on BIOS hardware

Since version 6.00, Syslinux also produces UEFI executables (syslinux.efi for x86-64 and IA-32). The UEFI build reads its files from the EFI System Partition, but it has never gained the maturity of the BIOS build and does not ship with Secure Boot signatures.

The Syslinux family of loaders

Each variant targets a different boot medium while sharing the configuration syntax. The name of the variant usually tells which file system or protocol it understands.

VariantBoot mediumDefault configuration file
SYSLINUXFAT12, FAT16, FAT32, NTFS partitionssyslinux.cfg
ISOLINUXISO 9660 CDs, DVDs and hybrid ISOsisolinux.cfg
PXELINUXNetwork boot through PXE and TFTPpxelinux.cfg/default
EXTLINUXext2, ext3, ext4, Btrfs, XFS partitionsextlinux.conf
MEMDISKFloppy or disk images loaded into RAMInvoked from another variant
Syslinux variants and their media

PXELINUX searches for configuration files in a fixed order: the client UUID, the MAC address prefixed with 01-, the IP address in hexadecimal form shortened one digit at a time, and finally default. This lookup lets one TFTP server give each machine or subnet its own menu without extra software.

ISOLINUX combined with the isohybrid tool produces images that boot both from optical media and when written directly to a USB stick, which is why many live distributions adopted it for years.

Configuration directives and modules

A Syslinux configuration is a plain text file of keyword lines, read top to bottom. A minimal entry needs a label, a kernel path and kernel parameters, which makes the format easy to generate from build scripts.

DirectiveMeaningExample
DEFAULTEntry booted when the user does nothingDEFAULT linux
LABELStarts a named boot entryLABEL rescue
LINUXKernel image to loadLINUX /vmlinuz
INITRDInitial RAM disk to loadINITRD /initramfs.img
APPENDKernel command line parametersAPPEND root=/dev/sda2 ro quiet
TIMEOUTWait in tenths of a secondTIMEOUT 50 for five seconds
UILoads a menu moduleUI vesamenu.c32
Frequently used Syslinux directives

Features beyond loading a kernel live in COM32 modules with the .c32 extension. menu.c32 draws a text menu, vesamenu.c32 adds a graphical background, chain.c32 chainloads another bootloader or Windows, and hdt.c32 reports detected hardware. From version 5.00, modules depend on shared libraries such as libutil.c32 and libcom32.c32, so versions must match the installed core.

Syslinux compared with other bootloaders

Syslinux trades flexibility for simplicity and a small footprint. The comparison below places it next to the other bootloaders in the same Topic.

BootloaderStrengthsWeaknesses
SyslinuxTiny, simple config, strong PXE and ISO supportLimited UEFI, no LVM, dormant development
GRUBMany file systems, LVM, RAID, encryption, scriptingComplex, generated configuration
systemd-bootSimple UEFI menu, Boot Loader SpecificationUEFI only, kernels must sit on the ESP
LILOHistoric simplicityBlock lists must be rewritten after kernel changes
rEFIndAutomatic detection of UEFI loadersUEFI only, a boot manager rather than a full loader
Syslinux and alternative Linux bootloaders

Unlike LILO, Syslinux reads files by name through its own file system drivers, so replacing a kernel does not require reinstalling the loader. Unlike GRUB, it cannot read kernels from LVM volumes or encrypted partitions, so /boot must sit on a plain supported file system.

Installation, limitations and common mistakes

Installation is done with the matching tool: syslinux --install /dev/sdb1 for FAT, extlinux --install /boot/syslinux for ext partitions, then writing mbr.bin or gptmbr.bin to the disk and marking the partition active or setting the GPT legacy BIOS bootable attribute.

  • Mismatched module versions produce errors such as a failed load of a .c32 file; copy modules from the same release as the core.
  • A missing active flag or legacy BIOS bootable attribute leaves the MBR code with nothing to load.
  • TIMEOUT is in tenths of a second, so TIMEOUT 5 waits only half a second.
  • The last stable release, 6.03 from 2014, means new file system features can be unreadable to EXTLINUX, for example some ext4 or Btrfs options.
  • Without Secure Boot support, UEFI machines with Secure Boot enabled will refuse the UEFI build.

Because of the slow upstream development, several distributions have moved their installation media to GRUB or systemd-boot, while Syslinux remains common in PXE environments, embedded images and older BIOS hardware.

In everyday language

When a computer is switched on, something has to find the operating system and start it. That small helper is called a bootloader. Syslinux is a small, simple bootloader that has been used for decades to start Linux from USB sticks, CDs and even over the office network.

Think of it as a short instruction card at the door of a building: it lists a few rooms, lets a visitor pick one, and then walks them there. It does not do much else, which is exactly why it is fast, tiny and easy to set up.

Seen in the real world

A university computer lab has 120 desktop machines that must be reinstalled every semester. The lab administrator configures the network so that every machine boots through PXE, and the TFTP server delivers PXELINUX together with a vesamenu.c32 menu offering three choices: local disk, automated Linux installation and a memory test.

The default entry boots the local disk after a TIMEOUT of 100, so ordinary students never notice the menu. When reinstallation is due, the administrator places a file named after each classroom subnet in hexadecimal IP form in pxelinux.cfg, which makes the installation entry the default for that room only. A full classroom of 30 machines is reinstalled in under an hour without anyone carrying USB sticks between desks.