Difference between revisions of "Netboot"

From ArchWiki
Jump to navigation Jump to search
(Remove OCSP FS#58470 related workaround section.)
(style; wording; wikilinks)
Line 2: Line 2:
 
[[ja:Netboot]]
 
[[ja:Netboot]]
 
[[lt:Netboot]]
 
[[lt:Netboot]]
Netboot images are small (<1MB) images that can be used to download the latest Arch Linux release on the fly upon system boot. It is unnecessary to update the netboot image, the newest release will be available automatically. Netboot images can be downloaded from the [https://www.archlinux.org/releng/netboot/ Arch Linux website].
+
Netboot images are small (< 1 MiB) images that can be used to download the latest Arch Linux release on the fly upon system boot. It is unnecessary to update the netboot image, the newest release will be available automatically. Netboot images can be downloaded from the [https://www.archlinux.org/releng/netboot/ Arch Linux website].
  
 
== BIOS ==
 
== BIOS ==
  
To use netboot on a BIOS-based computer, you need either the ipxe.lkrn or ipxe.pxe image.
+
To use netboot on a BIOS-based computer, you need either the {{ic|ipxe.lkrn}} or {{ic|ipxe.pxe}} image.
  
 
=== Using ipxe.lkrn ===
 
=== Using ipxe.lkrn ===
  
The ipxe.lkrn image can be booted like a Linux kernel. Any Linux bootloader (like Grub or syslinux) can be used to load it from your hard drive, a CD or a USB drive. For example, the Syslinux wiki gives instructions to install[https://wiki.syslinux.org/wiki/index.php?title=Install] and configure[https://wiki.syslinux.org/wiki/index.php?title=Config] Syslinux on a bootable medium.
+
The {{ic|ipxe.lkrn}} image can be booted like a Linux kernel. Any Linux [[boot loader]] (like [[GRUB]] or [[Syslinux]]) can be used to load it from your hard drive, a CD or a USB drive. For example, the Syslinux wiki gives instructions to install[https://wiki.syslinux.org/wiki/index.php?title=Install] and configure[https://wiki.syslinux.org/wiki/index.php?title=Config] Syslinux on a bootable medium.
 +
 
 +
You can make flash drive that boots {{ic|ipxe.lkrn}} with the following steps:
 +
 
 +
* Find out your device path using [[lsblk]]. Let us assume it is {{ic|/dev/sdc}}.
 +
* Create MBR partition table on the device.
 +
* Create a primary partition with [[FAT32]] file system and flag it as active.
 +
* Mount partition, create {{ic|boot/syslinux}} directory there and copy {{ic|ipxe.lkrn}} to it
  
You can make flash drive that boots ipxe.lkrn with the following steps:
 
* Find out your device path using [[lsblk]]. Let's assume it is /dev/sdc.
 
* Create ms-dos partition table on the device.
 
* Create a primary partition with FAT32 file system and flag it as active.
 
* Mount partition, create ./boot/syslinux directory there and copy ipxe.lkrn to boot directory
 
 
  # mount /dev/sdc /mnt
 
  # mount /dev/sdc /mnt
 
  # mkdir -p /mnt/boot/syslinux
 
  # mkdir -p /mnt/boot/syslinux
 
  # cp ipxe.lkrn /mnt/boot
 
  # cp ipxe.lkrn /mnt/boot
 +
 
* Create config for syslinux
 
* Create config for syslinux
 +
 
{{hc|/mnt/boot/syslinux/syslinux.cfg |2=
 
{{hc|/mnt/boot/syslinux/syslinux.cfg |2=
 
DEFAULT arch_netboot
 
DEFAULT arch_netboot
Line 27: Line 31:
 
   KERNEL /boot/ipxe.lkrn
 
   KERNEL /boot/ipxe.lkrn
 
}}
 
}}
 +
 
* Unmount partition
 
* Unmount partition
 +
 
  # umount /mnt
 
  # umount /mnt
* Install syslinux mbr and syslinux itself
+
 
 +
* Install Syslinux MBR and Syslinux itself
 +
 
 
  # ms-sys --mbrsyslinux /dev/sdc
 
  # ms-sys --mbrsyslinux /dev/sdc
 
  # syslinux --directory /boot/syslinux/ --install /dev/sdc1
 
  # syslinux --directory /boot/syslinux/ --install /dev/sdc1
 +
 
* Now you should be able to boot your usb stick with ipxe.lkrn.
 
* Now you should be able to boot your usb stick with ipxe.lkrn.
  
 +
Alternatively, you can also try the image with [[QEMU]] by running the following command:
  
Alternatively, you can also try the image with qemu by running the following command:
+
$ qemu-system-x86_64 -enable-kvm -m 2G -kernel ipxe.lkrn
 
 
    qemu-system-x86_64 -enable-kvm -m 2G -kernel ipxe.lkrn
 
  
 
=== Using ipxe.pxe ===
 
=== Using ipxe.pxe ===
  
The ipxe.pxe image is a PXE image. It can be chainloaded from an existing PXE environment. This allows configuring a DHCP server such that booting from the network will always boot into Arch Linux netboot.
+
The {{ic|ipxe.pxe}} image is a PXE image. It can be chainloaded from an existing PXE environment. This allows configuring a DHCP server such that booting from the network will always boot into Arch Linux netboot.
  
 
== UEFI ==
 
== UEFI ==
  
The ipxe.efi image can be used to launch Arch Linux netboot in UEFI mode. Only 64 Bit UEFI is supported. The ipxe.efi image can be added as a boot option via efibootmgr, chainloaded from a boot manager like [[systemd-boot]] or launched directly from the UEFI shell.
+
The {{ic|ipxe.efi}} image can be used to launch Arch Linux netboot in UEFI mode. Only 64-bit UEFI is supported. The {{ic|ipxe.efi}} image can be added as a boot option via [[efibootmgr]], launched from a [[boot manager]], like [[systemd-boot]], or directly from the [[Unified Extensible Firmware Interface#UEFI Shell|UEFI shell]].
  
 
=== Installation with efibootmgr ===
 
=== Installation with efibootmgr ===
Line 51: Line 59:
 
First install the {{Pkg|efibootmgr}} package, then download the [https://www.archlinux.org/releng/netboot/ UEFI netboot image].
 
First install the {{Pkg|efibootmgr}} package, then download the [https://www.archlinux.org/releng/netboot/ UEFI netboot image].
  
Assuming your [[EFI system partition]] (ESP) is mounted under {{ic|''esp''}}, you should move it as follows - let's also give it a more friendly name:
+
Assuming your [[EFI system partition]] (ESP) is mounted under {{ic|''esp''}}, you should move it as follows - let us also give it a more friendly name:
  
 
  # mkdir ''esp''/EFI/arch_netboot
 
  # mkdir ''esp''/EFI/arch_netboot

Revision as of 07:56, 16 March 2019

Netboot images are small (< 1 MiB) images that can be used to download the latest Arch Linux release on the fly upon system boot. It is unnecessary to update the netboot image, the newest release will be available automatically. Netboot images can be downloaded from the Arch Linux website.

BIOS

To use netboot on a BIOS-based computer, you need either the ipxe.lkrn or ipxe.pxe image.

Using ipxe.lkrn

The ipxe.lkrn image can be booted like a Linux kernel. Any Linux boot loader (like GRUB or Syslinux) can be used to load it from your hard drive, a CD or a USB drive. For example, the Syslinux wiki gives instructions to install[1] and configure[2] Syslinux on a bootable medium.

You can make flash drive that boots ipxe.lkrn with the following steps:

  • Find out your device path using lsblk. Let us assume it is /dev/sdc.
  • Create MBR partition table on the device.
  • Create a primary partition with FAT32 file system and flag it as active.
  • Mount partition, create boot/syslinux directory there and copy ipxe.lkrn to it
# mount /dev/sdc /mnt
# mkdir -p /mnt/boot/syslinux
# cp ipxe.lkrn /mnt/boot
  • Create config for syslinux
/mnt/boot/syslinux/syslinux.cfg 
DEFAULT arch_netboot
   SAY Booting Arch over the network.
LABEL arch_netboot
   KERNEL /boot/ipxe.lkrn
  • Unmount partition
# umount /mnt
  • Install Syslinux MBR and Syslinux itself
# ms-sys --mbrsyslinux /dev/sdc
# syslinux --directory /boot/syslinux/ --install /dev/sdc1
  • Now you should be able to boot your usb stick with ipxe.lkrn.

Alternatively, you can also try the image with QEMU by running the following command:

$ qemu-system-x86_64 -enable-kvm -m 2G -kernel ipxe.lkrn

Using ipxe.pxe

The ipxe.pxe image is a PXE image. It can be chainloaded from an existing PXE environment. This allows configuring a DHCP server such that booting from the network will always boot into Arch Linux netboot.

UEFI

The ipxe.efi image can be used to launch Arch Linux netboot in UEFI mode. Only 64-bit UEFI is supported. The ipxe.efi image can be added as a boot option via efibootmgr, launched from a boot manager, like systemd-boot, or directly from the UEFI shell.

Installation with efibootmgr

First install the efibootmgr package, then download the UEFI netboot image.

Assuming your EFI system partition (ESP) is mounted under esp, you should move it as follows - let us also give it a more friendly name:

# mkdir esp/EFI/arch_netboot
# mv ipxe.*.efi esp/EFI/arch_netboot/arch_netboot.efi

Then you can create a boot entry as follows:

# efibootmgr --create --disk /dev/sda --part 1 --loader /EFI/arch_netboot/arch_netboot.efi --label "Arch Linux Netboot"