📜 ⬆️ ⬇️

iPXE Debian Installer Download over HTTP

In this article I want to tell a fast and convenient way to install debian on a virtual machine via iPXE.
I like this option the most, because does not require downloading any ISO images or additional configuration of DHCP and TFTP servers. All download will go via HTTP over the Internet.

image

We assume that we have a virtual machine with ipxe (in the case of qemu, ipxe is loaded by default)
We want to download debian wheezy or squeeze
')

Let's get started


Virtual machine booting starts like this:
 SeaBIOS (version pre-0.6.3-20120507_233324-palmer)


 iPXE (http://ipxe.org) 00: 03.0 C900 PCI2.10 PnP PMM + 3FFC9200 + 3FF89200 C900
 Press Ctrl-B to configure iPXE (PCI 00: 03.0) ...


We have time, press Ctrl-B
Get the iPXE console:

 iPXE (PCI 00: 03.0) starting execution ... ok
 iPXE initialising devices ... ok



 iPXE 1.0.0+ - Open Source Network Boot Firmware - http://ipxe.org
 Features: HTTP iSCSI DNS TFTP AoE bzImage COMBOOT ELF MBOOT PXE PXEXT

 iPXE>


We look at network interfaces.
In my example, one interface.

 iPXE> ifstat
 net0: 52: 54: 00: 75: a6: 01 using virtio-net on PCI00: 03.0 (closed)
 [Link: up, TX: 0 TXE: 0 RX: 0 RXE: 0]


We configure the interface through dhcp
At the same time, no special settings on the DHCP server.
We get only the address, mask, gateway and DNS.

 iPXE> dhcp net0
 DHCP (net0 52: 54: 00: 75: a6: 01) ...... ok 


If there is no dhcp, no problem.
Can be customized by hand.

 iPXE> config net0


We get a convenient text interface

 iPXE configuration settings - net0

 ../
 dhcp /
 busid .......... 01: 1a: f4: 10: 00
 mac ............ 52: 54: 00: 75: a6: 01
 gateway ........ 192.168.1.1
 netmask ........ 255.255.255.0
 ip ............. 192.168.1.6
 domain ......... <not specified>
 dns ............ 192.168.1.1
 filename ....... <not specified>
 next-server .... <not specified>
 root-path ...... <not specified>
 initiator-iqn .. <not specified>
 skip-san-boot .. <not specified>
 keep-san ....... <not specified>
 ...
 net0.dhcp / netmask: ipv4 - Subnet mask
 http://ipxe.org/cfg/netmask

 Ctrl-X - exit configuration utility



Next, we need to specify the path to the kernel and to the initrd image to boot.
In order not to write the full path with your hands (and Debian has a long path), we will use an automatic download script and place it on the HTTP server. To raise a web server for this task is not necessary. You can use ready-made solutions.
For example pastebin.com

To download the current stable version of Debian, post the following text:
#!ipxe kernel http://mirror.yandex.ru/debian/dists/stable/main/installer-i386/current/images/netboot/debian-installer/i386/linux initrd http://mirror.yandex.ru/debian/dists/stable/main/installer-i386/current/images/netboot/debian-installer/i386/initrd.gz boot 


We get a link to appeal to the raw text: pastebin.com/raw.php?i=j2rHY5h0
We give the command to the loader:

 
  iPXE> chain http://pastebin.com/raw.php?i=j2rHY5h0 
 


I went download HTTP

 
  http: //pastebin.com/raw.php? i = j2rHY5h0 ... ok 
  http: //mirror.yandex.ru/debian/dists/stable/main/installer-i386/current/images/netboot/debian-installer/i386/linux ... ok 
  http: //mirror.yandex.ru/debian/dists/stable/main/installer-i386/current/images/netboot/debian-installer/i386/initrd.gz ... 57% 
 


Next is the debian installer download.
Mission accomplished.

P.S.


1. There is another great resource www.netboot.me
But some of the entries on it no longer work, and the creation of custom entries requires registration.

2. In a similar way you can download and real equipment.
For example, loading iPXE from USB flash boot.ipxe.org/ipxe.usb (400K)
Or other media. See: www.ipxe.org
Ready images: boot.ipxe.org

Source: https://habr.com/ru/post/188308/


All Articles