iPXE Downloading Debian Installer via HTTP

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

    image

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


    Let's get started


    Booting a virtual machine 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) ...
    


    Succeeding, 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]
    


    Configure the interface via 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 ......... 
    dns ............ 192.168.1.1
    filename ....... 
    next-server .... 
    root-path ...... 
    initiator-iqn .. 
    skip-san-boot .. 
    keep-san ....... 
    ...
    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 an HTTP server. Raise a web server for this task - no need. You can use ready-made solutions.
    For example, pastebin.com.

    To download the current stable version of Debian, we 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 access 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
    


    HTTP upload has gone

    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 up is the debian installer download.
    Mission accomplished.

    P.S.


    1. There is still a wonderful resource www.netboot.me
    But some of the records on it no longer work, and the creation of custom records requires registration.

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


    Also popular now: