Boot URL:
boot.ipxe.org/demo/boot….
Tutorial:
www.rmprepusb.com/tutori…
Script:
ipxe.org/scripting
Create bootable iPXE images with automated scripts:
www.rom-o-matic.eu/
Example:
Add the following chunk to your existing ISC dhcpd.conf
file.
if exists user-class and ( option user-class = "iPXE" ) {
filename "http://boot.smidsrod.lan/boot.ipxe";
}
else {
filename "undionly.kpxe";
}
(or see gist.github.com/4008017 for a more elaborate setup
that chainloads a more featureful version of iPXE from a stripped-down
version burned in ROM)
Put undionly.kpxe
(or ipxe.pxe
) at the root of your TFTP server.
Change boot-url (and sanboot-url and other values) in boot.ipxe.cfg
to match your setup.
Put the following files in your web root:
- boot.ipxe
- boot.ipxe.cfg
- menu.ipxe
Add a folder named boot
in your web root and put any of these files there:
- hostname-testvm.ipxe
- mac-0050dadd426f.ipxe
- uuid-f84a339b-9e36-456e-8ccf-4c51ea6cb42d.ipxe
- pci-8086100e.ipxe
If you want more features you might want these files in your web root too:
- wimboot
- memdisk
- memtest.0
- memtest86plus-4.20.elf.img
- memtest-report.cgi (if you want a place to send your memtest reports)
UPDATE: See gist.github.com/robinsmi… for a better menu item for SystemRescueCD than the one included below.
#!ipxe | |
# Global variables used by all other iPXE scripts | |
chain –autofree boot.ipxe.cfg || | |
# Boot <boot-url>/<boot-dir>/hostname-<hostname>.ipxe | |
# if hostname DHCP variable is set and script is present | |
isset ${hostname} && chain –replace –autofree ${boot-dir}hostname-${hostname}.ipxe || | |
# Boot <boot-url>/<boot-dir>/uuid-<UUID>.ipxe | |
# if SMBIOS UUID variable is set and script is present | |
isset ${uuid} && chain –replace –autofree ${boot-dir}uuid-${uuid}.ipxe || | |
# Boot <boot-url>/<boot-dir>/mac-010203040506.ipxe if script is present | |
chain –replace –autofree ${boot-dir}mac-${mac:hexraw}.ipxe || | |
# Boot <boot-url>/<boot-dir>/pci-8086100e.ipxe if one type of | |
# PCI Intel adapter is present and script is present | |
chain –replace –autofree ${boot-dir}pci-${pci/${busloc}.0.2}${pci/${busloc}.2.2}.ipxe || | |
# Boot <boot-url>/<boot-dir>/chip-82541pi.ipxe if one type of | |
# PCI Intel adapter is present and script is present | |
chain –replace –autofree ${boot-dir}chip-${chip}.ipxe || | |
# Boot <boot-url>/menu.ipxe script if all other options have been exhausted | |
chain –replace –autofree ${menu-url} || |
#!ipxe | |
# OPTIONAL: NFS server used for menu files and other things | |
# Must be specified as IP, as some distros don't do proper name resolution | |
set nfs-server 10.1.1.10 | |
set nfs-root /raid/boot/ | |
# OPTIONAL: Base URL used to resolve most other resources | |
# Should always end with a slash | |
#set boot-url boot.smidsrod.lan/ | |
set boot-url {nfs-server}${nfs-root} | |
# OPTIONAL: What URL to use when sanbooting | |
# Usually ${boot-url} is used, but required until NFS supports block device API | |
# Should always end with a slash | |
set sanboot-url boot.smidsrod.lan/ | |
# OPTIONAL: Relative directory to boot.ipxe used to | |
# override boot script for specific clients | |
set boot-dir boot/ | |
# REQUIRED: Absolute URL to the menu script, used by boot.ipxe | |
# and commonly used at the end of simple override scripts | |
# in ${boot-dir}. | |
set menu-url ${boot-url}menu.ipxe | |
# OPTIONAL: iSCSI server location and iSCSI IQNs | |
# Must be specified as an IP, some clients have issues with name resolution | |
# Initiator IQN is also calculated to use hostname, if present | |
set iscsi-server 10.1.1.10 | |
set base-iqn iqn.2011–02.lan.smidsrod | |
set base-iscsi iscsi:${iscsi-server}::::${base-iqn} | |
isset ${hostname} && set initiator-iqn ${base-iqn}:${hostname} || set initiator-iqn ${base-iqn}:${mac} | |
# OPTIONAL: Hashed password used by some distros, e.g. SmartOS | |
set root-shadow $1$RKvIqeyXXXXXS6F3WAeQCWk. | |
# OPTIONAL: URL to report memtest results to | |
set memtest-report-url boot.smidsrod.lan/memtes… | |
# OPTIONAL: Where to store the OpenELEC configuration and database | |
# and version number | |
set openelec-version 3.2.2 | |
set openelec-storage-dir ${nfs-server}:/raid/misc/openelec-storage/ | |
# OPTIONAL: TinyCore customizable information | |
set tc-version 4.7.6 | |
# OPTIONAL: CoreOS customizable information | |
set coreos-version 94.0.0 | |
set coreos-sshkey ssh-dss AAAAB3NzaC1kXXXXXz636QEs3kA9jPVI8qcCOkgDAf2BwiUIawbRTWvncJMAp315VhYY= [email protected] | |
# OPTIONAL: Macrium Reflect customizable information | |
set macrium-version 5.2 | |
# OPTIONAL: Firefly Solaris recovery environment customizable information | |
set firefly-version 0613 | |
# OPTIONAL: SpinRite customizable information | |
set spinrite-version 6.0 | |
# OPTIONAL: SystemRescueCD customizable information | |
set sysrcd-version 3.8.0 | |
# OPTIONAL: HDT customizable information | |
set hdt-version 0.5.2 |
#!ipxe | |
echo | |
echo Booting TestVM | |
set menu-default menu-live | |
set submenu-default ubuntu-live-1204-amd64 | |
chain –replace –autofree ${menu-url} |
# Disable framebuffer, it's usually slower, especially on VMs | |
d-i debian-installer/framebuffer boolean false | |
# Locale, language and country | |
d-i debconf/language string en_US:en | |
d-i debian-installer/country string NO | |
d-i debian-installer/language string en_US:en | |
d-i debian-installer/locale string en_US.UTF-8 | |
d-i localechooser/preferred-locale string en_US.UTF-8 | |
d-i localechooser/supported-locales en_US.UTF-8, nb_NO.UTF-8 | |
# Keyboard selection | |
d-i keyboard-configuration/layoutcode string no | |
d-i keyboard-configuration/variantcode string | |
# Controls whether or not the hardware clock is set to UTC | |
d-i clock-setup/utc boolean true | |
# You may set this to any valid setting for $TZ; see the contents of | |
# /usr/share/zoneinfo/ for valid values | |
d-i time/zone string Europe/Oslo | |
# Controls whether to use NTP to set the clock during the install | |
d-i clock-setup/ntp boolean true | |
# Skip creation of a root account (normal user account will be able to | |
# use sudo). The default is false; preseed this to true if you want to set | |
# a root password. | |
d-i passwd/root-login boolean true | |
# Root password, either in clear text | |
#d-i passwd/root-password password r00tme | |
#d-i passwd/root-password-again password r00tme | |
# or encrypted using an MD5 hash. | |
d-i passwd/root-password-crypted password $1$92PDztZI$asdkfljhasdf2UR8il9Lz0 | |
# To create a normal user account. | |
d-i passwd/user-fullname string Robin Smidsrød | |
d-i passwd/username string robin | |
# Normal user's password, either in clear text | |
#d-i passwd/user-password password insecure | |
#d-i passwd/user-password-again password insecure | |
# or encrypted using an MD5 hash. | |
d-i passwd/user-password-crypted password $1$92PDztZI$OnXkjhasdfuweu2UR8il9Lz0 | |
# Do not encrypt home directory | |
d-i user-setup/encrypt-home boolean false | |
# If you select ftp, the mirror/country string does not need to be set | |
# Location: boot.smidsrod.lan/ubuntu… | |
d-i mirror/protocol string http | |
d-i mirror/country string manual | |
d-i mirror/http/hostname string boot.smidsrod.lan | |
d-i mirror/http/directory string /ubuntu-12.04-server-amd64 | |
d-i mirror/http/proxy string | |
# Suite to install | |
d-i mirror/suite string precise | |
# Suite to use for loading installer components (optional) | |
d-i mirror/udeb/suite string precise | |
# Components to use for loading installer components (optional) | |
d-i mirror/udeb/components multiselect main, restricted | |
# The kernel image (meta) package to be installed; "none" can be used if no | |
# kernel is to be installed. | |
d-i base-installer/kernel/image string linux-generic | |
# Disk setup (partman) | |
# Suppress question if it is okay to not have swap | |
# We don't use disk for swap on iSCSI, we have enough memory | |
d-i partman-basicfilesystems/no_swap boolean false | |
# Package selection | |
tasksel tasksel/first multiselect openssh-server | |
# Individual additional packages to install | |
d-i pkgsel/include string build-essential ntp | |
# Whether to upgrade packages after debootstrap. | |
# Allowed values: none, safe-upgrade, full-upgrade | |
d-i pkgsel/upgrade string full-upgrade | |
# Policy for applying updates. May be "none" (no automatic updates), | |
# "unattended-upgrades" (install security updates automatically), or | |
# "landscape" (manage system with Landscape). | |
d-i pkgsel/update-policy string unattended-upgrades | |
# Install language packs for apps | |
d-i pkgsel/install-language-support boolean true | |
# By default, the system's locate database will be updated after the | |
# installer has finished installing most packages. This may take a while, so | |
# if you don't want it, you can set this to "false" to turn it off. | |
d-i pkgsel/updatedb boolean true | |
# Some versions of the installer can report back on what software you have | |
# installed, and what software you use. The default is not to report back, | |
# but sending reports helps the project determine what software is most | |
# popular and include it on CDs. | |
popularity-contest popularity-contest/participate boolean true | |
# This is fairly safe to set, it makes grub install automatically to the MBR | |
# if no other operating system is detected on the machine. | |
d-i grub-installer/only_debian boolean true | |
# This one makes grub-installer NOT install to the MBR if it also finds some other | |
# OS, which is less safe as it might not be able to boot that other OS. | |
d-i grub-installer/with_other_os boolean false | |
# This will prevent the installer from ejecting the CD during the reboot, | |
# which is useful in some situations. | |
d-i cdrom-detect/eject boolean false | |
# This command is run just before the install finishes, but when there is | |
# still a usable /target directory. You can chroot to /target and use it | |
# directly, or use the apt-install and in-target commands to easily install | |
# packages and run commands in the target system. | |
# Fix broken resolvconf setup | |
# Change apt to use public mirror and refresh apt database | |
# Set proper initator IQN and remove quiet flag in grub | |
# Update grub | |
d-i preseed/late_command string \ | |
in-target mv /etc/resolvconf/resolv.conf.d/original /etc/resolvconf/resolv.conf.d/tail; \ | |
in-target sed -i -e 's/http:\/\/boot.smidsrod.lan\/ubuntu-12.04-server-amd64/http:\/\/no.archive.ubuntu.com\/ubuntu/' /etc/apt/sources.list; \ | |
in-target apt-get -qq update; \ | |
apt-install joe; \ | |
in-target sed -i -e 's/GRUB_CMDLINE_LINUX_DEFAULT=\"quiet\"/GRUB_CMDLINE_LINUX_DEFAULT=\"\"/' /etc/default/grub; \ | |
in-target sed -i -e 's/GRUB_CMDLINE_LINUX=\"\"/GRUB_CMDLINE_LINUX=\"iscsi_initiator=iqn.2011–02.lan.smidsrod:$(hostname)\"/' /etc/default/grub; \ | |
in-target update-grub; |