Saturday, 20. February 2021

Multi-OS PXE-booting from FreeBSD 12: Linux, illumos and more (pt. 4)

[This article has been bi-posted to Gemini and the Web]

Post 1 of this mini series is about what lead me to do this in the first place, features a little excursion for people new to PXE and details the setup of a FreeBSD router.

Post 2 discusses setting up the required daemons for DHCP, TFTP and HTTP / FTP. Each component that is not in FreeBSD's base system is briefly discussed and two options to pick from are covered.

Post 3 covers the NBP (pxelinux), boot menu configuration and adding all the major BSD operating systems (with the exception of DragonFly that I could not get to work) as PXE-boot options.

Multi-OS PXE-booting from FreeBSD 12: Introduction (pt. 1)

Multi-OS PXE-booting from FreeBSD 12: Required services (pt. 2)

Multi-OS PXE-booting from FreeBSD 12: PXE menu and *BSD (pt. 3)

In this post we are going to add some Linux distributions to the list as well as illumos and some other Open Source operating systems. If you are not familiar with pxelinux and configuring its menu, please see the previous post for more information. You will also find an explanation on going with flat menus if you prefer that - in this article I'll make use of sub-menus.

Menu preparations

First is a bit of preparation work. I'm going to add three more sub-menus to the main menu - follow along with any or all that are relevant to you. On your PXE boot server, edit the file main configuration file for pxelinux:

# vi /usr/local/tftpboot/pxelinux.cfg/default

Append the following blocks:

LABEL linux-distros
MENU LABEL Linux Distributions
KERNEL vesamenu.c32
APPEND pxelinux.cfg/linux
LABEL illumos-distros
MENU LABEL illumos Distributions
KERNEL vesamenu.c32
APPEND pxelinux.cfg/illumos
LABEL other-oses
MENU LABEL Other Operating Systems
KERNEL vesamenu.c32
APPEND pxelinux.cfg/other

Next is creating the configuration files for the sub-menus we just referenced. We'll start with Linux:

# vi /usr/local/tftpboot/pxelinux.cfg/linux

Let's put the menu title and an option to go back to the main menu in there:

MENU TITLE PXE Boot Menu (Linux)
LABEL main-menu
MENU LABEL Main Menu
KERNEL vesamenu.c32
APPEND pxelinux.cfg/default

Now the same thing for illumos:

# vi /usr/local/tftpboot/pxelinux.cfg/illumos

Insert this text:

MENU TITLE PXE Boot Menu (illumos)
LABEL main-menu
MENU LABEL Main Menu
KERNEL vesamenu.c32
APPEND pxelinux.cfg/default

And finally for the other systems:

# vi /usr/local/tftpboot/pxelinux.cfg/other

Again put the default stuff in there:

MENU TITLE PXE Boot Menu (Other)
LABEL main-menu
MENU LABEL Main Menu
KERNEL vesamenu.c32
APPEND pxelinux.cfg/default

Alright, everything is prepared. So we can add some actual boot options for our PXE boot server!

Ubuntu

Making Ubuntu available over PXE is not very hard to do.

https://ubuntu.com

We first need the (very recently released) ISO. It's a big file and thus it makes sense to check the downloaded image for transmission errors - for that reason we're getting the checksum file, too. The ISO is needed for the installation, so we're going to make it available over HTTP by putting it in the right location:

# mkdir -p /usr/local/www/pxe/linux/ubuntu
# fetch https://releases.ubuntu.com/20.04/ubuntu-20.04.2-live-server-amd64.iso -o /usr/local/www/pxe/linux/ubuntu/ubuntu-20.04.2-live-server-amd64.iso
# fetch https://releases.ubuntu.com/20.04/SHA256SUMS -o /tmp/SHA256SUMS
# grep -c `sha256 /usr/local/www/pxe/linux/ubuntu/ubuntu-20.04.2-live-server-amd64.iso | awk '{ print $NF }'` /tmp/SHA256SUMS
# rm /tmp/SHA256SUMS

Make sure that the _grep_ command line returns 1. If it doesn't, remove the ISO and checksum file and re-download. We need the kernel and the init ramdisk available via TFTP, so we first extract the ISO to a temporary location. I found _7zip_ a good fit for extracting, so install it if you don't have it on your system. Now copy off what we need and remove the directory again:

# 7z x /usr/local/www/pxe/linux/ubuntu/ubuntu-20.04.2-live-server-amd64.iso -o/tmp/ubuntu
# mkdir -p /usr/local/tftpboot/linux/ubuntu
# cp /tmp/ubuntu/casper/vmlinuz /usr/local/tftpboot/linux/ubuntu
# cp /tmp/ubuntu/casper/initrd /usr/local/tftpboot/linux/ubuntu
# rm -r /tmp/ubuntu

With all the system data in place we only need to add a boot menu entry for it:

# vi /usr/local/tftpboot/pxelinux.cfg/linux

Add the following to the file and save:

LABEL ubuntu-server-pxe-install
MENU LABEL Install Ubuntu 20.04 (PXE)
KERNEL linux/ubuntu/vmlinuz
INITRD linux/ubuntu/initrd
APPEND root=/dev/ram0 ramdisk_size=1500000 ip=dhcp url=http://10.11.12.1/linux/ubuntu/ubuntu-20.04.2-live-server-amd64.iso

Since pxelinux supports fetching via HTTP, you can also serve both the kernel and initrd via that protocol instead. If you want to do that, simply move the files to the other location:

# mv /usr/local/tftpboot/linux/ubuntu/vmlinuz /usr/local/tftpboot/linux/ubuntu/initrd /usr/local/www/pxe/linux/ubuntu

Then edit the menu definition again:

# vi /usr/local/tftpboot/pxelinux.cfg/linux

And adjust the menu definition like this:

KERNEL http://10.11.12.1/linux/ubuntu/vmlinuz
INITRD http://10.11.12.1/linux/ubuntu/initrd

And that's it. Once you've restarted _inetd_, Ubuntu will be available as an option for PXE clients booting off of your server. It takes quite a while to push all the bits of the large ISO across the wire ('cause Ubuntu...) but it works.

AlmaLinux

What's _AlmaLinux_ some people may ask? Well, it's one of the candidates for the succession of CentOS 8 after that was killed off by IBM. There are other candidates, but if you ask me, this one is the most promising right now. And since it's available already (though in Beta currently), we're not going to waste our time with dying CentOS but rather aim for the future of an enterprisy Linux distribution with Alma.

https://almalinux.org

gemini://gemini.circumlunar.space/users/kraileth/neunix/2020/centos_killed.gmi

Obviously the first thing to do is getting it on our machine. I suggest getting the DVD which comes with all the packages available; if you know that you only do very basic installations, you may get the _x86_64-minimal.iso_ one instead. Since it's a pretty big ISO (8 GB!), checking for integrity is something I wouldn't recommend skipping:

# mkdir -p /usr/local/www/pxe/linux/alma
# fetch https://repo.almalinux.org/almalinux/8.3-beta/isos/x86_64/AlmaLinux-8.3-beta-1-x86_64-dvd1.iso -o /usr/local/www/pxe/linux/alma/AlmaLinux-8.3-beta-1-x86_64-dvd1.iso
# fetch https://repo.almalinux.org/almalinux/8.3-beta/isos/x86_64/CHECKSUM -o /tmp/CHECKSUM
# grep -c `sha256 /usr/local/www/pxe/linux/alma/AlmaLinux-8.3-beta-1-x86_64-dvd1.iso | awk '{ print $NF }'` /tmp/CHECKSUM
# rm /tmp/CHECKSUM

If the _grep_ command line does not return 1, delete both files and re-fetch, then run the check again. As soon as we have a good copy, we can extract the contents, making it available over HTTP. Permissions are wrong after extraction with all the directories missing the executable bit (rendering all their content inaccessible to the web server). So we fix this quickly, too:

# 7z x /usr/local/www/pxe/linux/alma/AlmaLinux-8.3-beta-1-x86_64-dvd1.iso -o/usr/local/www/pxe/linux/alma/sysroot
# find /usr/local/www/pxe/linux/alma -type d | xargs chmod 0755

The next step is to make kernel and init ramdisk available via TFTP:

# mkdir /usr/local/tftpboot/linux/alma
# cp /usr/local/www/pxe/linux/alma/sysroot/images/pxeboot/vmlinuz /usr/local/www/pxe/linux/alma/sysroot/images/pxeboot/initrd.img /usr/local/tftpboot/linux/alma

And finally we need to edit the Linux menu:

# vi /usr/local/tftpboot/pxelinux.cfg/linux

The definition to append looks like this:

LABEL alma-pxe-install
MENU LABEL Install AlmaLinux 8.3 BETA (PXE)
KERNEL linux/alma/vmlinuz
INITRD linux/alma/initrd.img
APPEND ip=dhcp inst.stage2=http://10.11.12.1/linux/alma/sysroot inst.xdriver=vesa

If you think that requiring X11 to install an OS is a reasonable choice and prefer the graphical installer, leave out the _inst.xdriver=vesa_ option in the APPEND line. Also you can serve kernel and initrd via HTTP if you like. To do so, move the boot files:

# mv /usr/local/tftpboot/linux/alma/vmlinuz /usr/local/tftpboot/linux/alma/initrd.img /usr/local/www/pxe/linux/alma

Then edit the menu again:

# vi /usr/local/tftpboot/pxelinux.cfg/linux

And make the following changes:

KERNEL http://10.11.12.1/linux/alma/vmlinuz
INITRD http://10.11.12.1/linux/alma/initrd.img

Now your PXE server is ready to serve AlmaLinux.

Devuan Beowulf

Let's add Devuan to the list next. Why Devuan and not Debian proper you ask? Well, because it has much cooler release names! Ok, of course not (the names _are_ cooler, though!). Because of __Init freedom__.

https://www.devuan.org/os/init-freedom

While I don't use Devuan (or Debian) myself, I've been supporting the fork since it started, sharing the first ISOs via Torrent and such. I very much dislike the "Bwahaha, you'll _never_ manage to fork XYZ!!!!11" stance that some very loud people in the Linux community display. I felt ashamed for my fellow Open Source supporters when it happened to the MATE desktop and I did again when people dismissed Devuan like that. Let me emphasize: This ridiculing is not the Debian project's fault. But the choice of opening their doors widely to Systemd while discriminating against everything else _is_. Hence: Devuan.

If you prefer Debian instead, there's not too much to change: Substitute the directory name, grab Debian's netboot archive instead and you're good to go. First thing to do is to get the netboot image, extract it and copying kernel and initrd over:

# fetch https://pkgmaster.devuan.org/devuan/dists/beowulf/main/installer-amd64/current/images/netboot/netboot.tar.gz -o /tmp/netboot.tar.gz
# mkdir /tmp/devuan && tar -C /tmp/devuan -xvf /tmp/netboot.tar.gz
# mkdir /usr/local/tftpboot/linux/devuan
# cp /tmp/devuan/debian-installer/amd64/linux /tmp/devuan/debian-installer/amd64/initrd.gz /usr/local/tftpboot/linux/devuan
# rm -r /tmp/devuan /tmp/netboot.tar.gz

Then we have to edit the Linux boot menu configuration:

# vi /usr/local/tftpboot/pxelinux.cfg/linux

Simply add the following block to the file and save:

LABEL devuan-pxe-install
MENU LABEL Install Devuan Beowulf (PXE)
KERNEL linux/devuan/linux
INITRD linux/devuan/initrd.gz
APPEND vga=788

And yes, that's already it. Debian does a pretty good job when it comes to PXE installing! If you prefer to serve the boot files via HTTP, just move the files:

# mkdir -p /usr/local/www/pxe/linux/devuan
# mv /usr/local/tftpboot/linux/devuan/linux /usr/local/tftpboot/linux/devuan/initrd.gz /usr/local/www/pxe/linux/devuan

Then edit the menu config again:

# vi /usr/local/tftpboot/pxelinux.cfg/linux

Now substitute the respective lines with these:

KERNEL http://10.11.12.1/linux/devuan/linux
INITRD http://10.11.12.1/linux/devuan/initrd.gz

Done. You can boot into the Devuan installer via PXE.

Alpine Linux 3.13

One last Linux example here is for a long-time favorite distribution of mine: _Alpine Linux_. It's a very light-weight, security-oriented distribution based on _Musl Libc_. Alpine is well fit for embedded use and can run diskless and entirely from RAM - of course traditional installations are possible, too. Most people probably know it because it's used frequently with Docker.

https://alpinelinux.org

Adding Alpine to the mix is very simple. Let's get and extract the netboot archive first:

# fetch https://dl-cdn.alpinelinux.org/alpine/v3.13/releases/x86_64/alpine-netboot-3.13.1-x86_64.tar.gz -o /tmp/alpine-netboot-3.13.1-x86_64.tar.gz
# mkdir /tmp/alpine && tar -C /tmp/alpine -xvf /tmp/alpine-netboot-3.13.1-x86_64.tar.gz

Now we copy off kernel, initrd as well as the modloop:

# cp /tmp/alpine/boot/vmlinuz-lts /tmp/alpine/boot/initramfs-lts /usr/local/tftpboot/linux/alpine
# mkdir /usr/local/www/pxe/linux/alpine
# cp /tmp/alpine/boot/modloop-lts /usr/local/www/pxe/linux/alpine

Finally edit the Linux menu config:

# vi /usr/local/tftpboot/pxelinux.cfg/linux

Put the following in there and save:

LABEL alpine-pxe-install
MENU DEFAULT
MENU LABEL Alpine Linux 3.13 (PXE)
KERNEL linux/alpine/vmlinuz-lts
INITRD linux/alpine/initramfs-lts
APPEND ip=dhcp modloop=http://10.11.12.1/linux/alpine/modloop-lts alpine_repo=http://dl-cdn.alpinelinux.org/alpine/edge/main

And that's really it! If you wish to use HTTP only, move two files:

# mv /usr/local/tftpboot/linux/alpine/* /usr/local/www/pxe/linux/alpine

Then edit the menu again:

# vi /usr/local/tftpboot/pxelinux.cfg/linux

And change the following lines:

KERNEL http://10.11.12.1/linux/alpine/vmlinuz-lts
INITRD http://10.11.12.1/linux/alpine/initramfs-lts

That's all, you're good to go.

SmartOS

SmartOS is a gem unknown to many. It's an illumos distribution (OpenSolaris-derivative) meant to operate fully in live-mode. That is: It uses the machine's hard disk(s) only for storage - the OS is always booted via PXE. This means updating is as easy as booting a newer image!

https://www.joyent.com/smartos

Due to its nature it's really no wonder that it has the most advanced, stunningly simple PXE process of all the systems that I've covered so far. You just get the image file:

# mkdir -p /usr/local/www/pxe/illumos/smartos
# fetch https://us-east.manta.joyent.com/Joyent_Dev/public/SmartOS/smartos-latest-USB.img.gz -o /usr/local/www/pxe/illumos/smartos/smartos-latest-USB.img.gz

Then you edit the illumos menu config:

# vi /usr/local/tftpboot/pxelinux.cfg/illumos

Paste in the following block and save:

LABEL smartos-pxe
MENU LABEL SmartOS (PXE)
KERNEL memdisk
INITRD http://10.11.12.1/illumos/smartos/smartos-latest-USB.img.gz
APPEND harddisk raw

And that's really it! There is no next step (except for enjoying your new system(s))!

Tribblix

Tribblix is a retro style illumos distribution that you might enjoy if you are a Solaris veteran. I did not succeed to get it working with _pxelinux_ which seems to have trouble loading the illumos kernel.

http://tribblix.org

Fortunately, PXE-booting Tribblix using iPXE is officially supported. Yes, in a previous article I wrote that I decided to use pxelinux instead, but since there's no other way (that I know of... please comment if you know how to get it work with just pxelinux!), we're going down that route here.

https://ipxe.org

The first thing to do is to make sure we're able to chain-load iPXE. FreeBSD provides a package for it which we're going to install. Then we make the required program available via http:

# pkg install -y ipxe
# mkdir -p /usr/local/www/pxe/other/ipxe
# cp /usr/local/share/ipxe/ipxe.pxe /usr/local/www/pxe/other/ipxe

Next is adding a menu item to select iPXE. So we need to edit the respective config file:

# vi /usr/local/tftpboot/pxelinux.cfg/illumos

Let's add the following block and save the file:

LABEL tribblix-over-ipxe
MENU LABEL Tribblix 0m24 (iPXE)
KERNEL pxechn.c32
APPEND http://10.11.12.1/other/ipxe/ipxe.pxe

This will be enough to chain-load iPXE. It's not of too much use, yet, though. If you select it, it'll request an IP address and use the PXE-related info it gets from the DHCP server to - load pxelinux. Press __CTRL-B__ when it loads to break the automatic behavior and be dropped to a console prompt. However we can't do much with it, yet, since we're missing the OS data.

The location to use is a bit odd here. This is due to hard-coded paths in the image, I assume. At least I could not get it working using the scheme that I use for the other examples. Anyway, time to fetch the kernel and the ramdisk image:

# mkdir -p /usr/local/www/pxe/m24/platform/i86pc/kernel/amd64
# fetch http://pkgs.tribblix.org/m24/platform/i86pc/kernel/amd64/unix -o /usr/local/www/pxe/m24/platform/i86pc/kernel/amd64/unix
# fetch http://pkgs.tribblix.org/m24/platform/i86pc/boot_archive -o /usr/local/www/pxe/m24/platform/i86pc/boot_archive

Now that we have the data in place, we could manually boot up Tribblix. But there's an easier way by creating a script which we can invoke and that simply does the rest. Let's create it in the tftp directory (it's small and using TFTP means we have less to type because we can omit the "http://10.11.12.1/" part):

# vi /usr/local/tftpboot/tribblix.ipxe

Paste the following into the file and save:

#!ipxe
kernel http://10.11.12.1/m24/platform/i86pc/kernel/amd64/unix
initrd http://10.11.12.1/m24/platform/i86pc/boot_archive
boot

That's it. Drop to iPXE's prompt as described above and request an IP address; then simply chainload the script. Tribblix will boot to the installer:

iPXE> dhcp
Waiting for link-up on net0... ok
Configuring (net0 10:bf:48:df:e9:65)...... ok
iPXE> chain tribblix.pxe

Yes, this is somewhat less convenient than other options shown here. And in fact it can be avoided. The problem being that creating a more convenient solution is also a little bit more involved and simply beyond the scope of this article. If you're interested in doing it, do some reading on your own. What you want to research is _embedding the script_ into iPXE.

OmniOSce r151036

After struggeling with getting OmniOSce to PXE-boot to no avail for days I gave up and moved on to Tribblix.

https://omnios.org

I wish I had done it the other way round; Peter Tribble has posted an article on his blog on how to do it with iPXE. And since I gave in and used it in my example above, I figured that I might as well return and give OmniOSce a try again. And really: Using iPXE instead of pure pxelinux - I got it working.

https://ptribble.blogspot.com/2020/12/installing-omnios-on-vultr-with-ipxe.html

!!!!!!!!!!!!!!!!!!!!!!!

Caution, though: What is described here is a __fully automated__ (unattended) installation. It **will destroy any data on the target machine _without asking_**. If that's not what you want, stay away. I wish I knew a way to just invoke the installer instead, but I don't.

!!!!!!!!!!!!!!!!!!!!!!!

Of course we need the operating system kernel and image as well as the zfs stream to install:

# mkdir -p /usr/local/www/pxe/illumos/omniosce/platform/i86pc/amd64 /usr/local/www/pxe/illumos/omniosce/platform/i86pc/kernel/amd64
# fetch https://downloads.omnios.org/media/r151036/omniosce-r151036m.unix -o /usr/local/www/pxe/illumos/omniosce/platform/i86pc/kernel/amd64/unix
# fetch https://downloads.omnios.org/media/r151036/omniosce-r151036m.miniroot.gz -o /usr/local/www/pxe/illumos/omniosce/platform/i86pc/amd64/omniosce-r151036m.miniroot.gz
# gunzip /usr/local/www/pxe/illumos/omniosce/platform/i86pc/amd64/omniosce-r151036m.miniroot.gz
# fetch https://downloads.omnios.org/media/r151036/omniosce-r151036.zfs.xz -o /usr/local/www/pxe/illumos/omniosce/platform/i86pc/amd64/omniosce-r151036.zfs.xz

Next is the installer configuration. Kayak will look for a file at the location told to (see below in the script) - the filename it tries first is named after the MAC address of the interface used for DHCP. In my case the MAC is 10:bf:48:df:e9:65, so the file matching only this single machine would be called 10BF48DFE965 (use uppercase for the Hex values above 9 resembled by the letter symbols).

If it cannot find that file, it will look for a file with the name of the first 11 digits, i.e. 10BF48DFE96. That would also match MAC addresses like 10BF48DFE961, 10BF48DFE96A, 10BF48DFE96E and the like. If there's no such file, it will try to get one named after the first 10 digits and so on until it eventually tries "1" in my case (if your MAC starts with a different digit, you will have to use that).

I'm lazy here and use a single-digit name (and thus choose to play with fire since this configuration will potentially nuke the previous installation of any machine having a network card with a MAC address that starts with 1 and would be PXE-booting OmniOS by accident!):

# vi /usr/local/www/pxe/kayak/1

I put the following in there:

BuildRpool c3t0d0
RootPW '$5$JQkyMDvv$pPzEUsvP/rLwURyrpwz5i1SfVqx2QiEoIdDA9ZrG271'
SetRootPW
SetHostname omnios
SetTimezone UTC
EnableDNS example.com
SetDNS 1.1.1.1 80.80.80.80
Postboot '/sbin/ipadm create-if rge0'
Postboot '/sbin/ipadm create-addr -T dhcp rge0/v4'
SendInstallLog

Your machines are likely different from mine; refer to the OmniOSce documentation for more information about about the configuration script.

https://omnios.org/setup/pxe

Now I create a menu entry for pxelinux by editing the configuration file:

# vi /usr/local/tftpboot/pxelinux.cfg/illumos

I add the following block and save:

LABEL omniosce-auto-over-ipxe
MENU LABEL OmniOSce r151036 AUTOMATED INSTALLATION [dangerous!] (iPXE)
KERNEL pxechn.c32
APPEND http://10.11.12.1/other/ipxe/ipxe.pxe

Finally I create the script to "chainload" from iPXE:

# vi /usr/local/tftpboot/omniosce.ipxe

Here's the content for that script:

!ipxe
kernel http://10.11.12.1/illumos/omniosce/platform/i86pc/kernel/amd64/unix -B install_media=http://10.11.12.1/illumos/omniosce/platform/i86pc/amd64/omniosce-r151036.zfs.xz,in
stall_config=http://10.11.12.1/illumos/omniosce
initrd http://10.11.12.1/illumos/omniosce/platform/i86pc/amd64/omniosce-r151036m.miniroot
boot

And that's it. Like with Tribblix, use _CTRL-B_ to get to an iPXE prompt, obtain an IP address and chainload the iPXE script - in this case the one for OmniOSce. If you did everything correct for your machine (depending on its MAC), kayak should erase your data and install OmniOSce on it instead.

FreeDOS 1.2

Why add FreeDOS? Well, why not? I've played with it quite a bit in my youth and happen to like it.

https://freedos.org

It's also simple to do and can in fact be useful (e.g. when you want to flash some firmware). As always, the first thing is to get and extract the archive. The zip file contains a virtual machine image, too, but we don't need it and thus skip unzipping it:

# fetch http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.2/FD12FULL.zip -o /tmp/FD12FULL.zip
# unzip -d /tmp -x '*.vmdk' /tmp/FD12FULL.zip

Next step is putting the extracted image into the right place, to correct permissions and to compress it to save a fair bit of space:

# mkdir -p /usr/local/www/pxe/other/fdos
# mv /tmp/FD12FULL.img /usr/local/www/pxe/other/fdos
# chmod 0644 /usr/local/www/pxe/other/fdos/FD12FULL.img.gz
# gzip -9 /usr/local/www/pxe/other/fdos/FD12FULL.img

Finally edit the "other" boot menu config file:

# vi /usr/local/tftpboot/pxelinux.cfg/other

And add the following block:

LABEL fdos-pxe-install
MENU LABEL Install FreeDOS 1.2 (PXE)
KERNEL memdisk
INITRD http://10.11.12.1/other/fdos/FD12FULL.img.gz
APPEND harddisk raw

Done. You should be able to PXE-boot into FreeDOS now.

Plan 9

Back to the Unixy stuff - and (disregarding Inferno) the one OS that is more Unixy that Unix itself: Plan 9! I'm going with the 9front distribution here; it's basically an example, anyway. There are not that many people out there who will want to actually provision a lot of servers with Plan 9, right? (If you are one of those, get in touch with me! I'd be interested in what you're doing with it.)

http://www.vitanuova.com/inferno/index.html

https://9p.io/plan9

http://9fs.net

As always we first need to get the image and put it in place:

# mkdir /usr/local/www/pxe/other/9front
# fetch http://9front.org/iso/9front-8013.d9e940a768d1.amd64.iso.gz -o /usr/local/www/pxe/other/9front/9front-8013.d9e940a768d1.amd64.iso.gz

Then the menu configuration needs to be edited:

# vi /usr/local/tftpboot/pxelinux.cfg/other

Paste in the following block:

LABEL 9front-pxe-install
MENU LABEL Install 9front (PXE)
KERNEL memdisk
INITRD http://10.11.12.1/other/9front/9front-8013.d9e940a768d1.amd64.iso.gz
APPEND iso raw

And that's all there is to it.

Redox 0.6

Redox is an experimental OS is about implementing a POSIX-like operating system written in Rust. It's using a modern microkernel architecture and made amazingly quick progress after the project started. I'm including it here because I think it's a very interesting thing to follow.

https://www.redox-os.org

To add Redox to the mix, you have to download the ISO first:

# mkdir /usr/local/www/pxe/other/redox
# fetch https://gitlab.redox-os.org/redox-os/redox/-/jobs/31100/artifacts/raw/build/img/redox_0.6.0_livedisk.iso.gz -o /usr/local/www/pxe/other/redox/redox_0.6.0_livedisk.iso.gz

Next and final step is editing the the menu configuration:

# vi /usr/local/tftpboot/pxelinux.cfg/other

and adding a block for Redox' menu item:

LABEL redox-pxe-install
MENU LABEL Install Redox OS (PXE)
KERNEL memdisk
INITRD http://10.11.12.1/other/redox/redox_0.6.0_livedisk.iso.gz
APPEND iso raw

The current version seems to have introduced a regression regarding my test hardware. It boots but after setting the resolution, the computer simply restarts. Version 0.4.0 could boot up to the graphical login, though (but I couldn't login due to missing input drivers I assume).

What's missing?

I would have liked to add OpenIndiana, Haiku, Minix and ReactOS as well.

https://www.openindiana.org

https://www.haiku-os.org

https://www.minix3.org

https://reactos.org

With both Haiku and ReactOS I failed to get them even booting. It might be possible to do it, but I ran out of ideas to try quickly and because of a lack of time didn't try harder.

For OpenIndiana I didn't even find proper documentation. Since I'm not very knowledgable with illumos, anyway, I eventually settled on having three other distributions covered and didn't really try it out.

Minix is a special case. According to the documentation, PXE-booting should be possible with a ramdisk image.

https://wiki.minix3.org/doku.php?id=usersguide:bootingovernetworkusingpxe

The project doesn't provide them for download (or I didn't find them) but building one from source is documented. So I checked out the source and ran the script to build it - and it failed. I tried again on a 64-bit machine and it failed again. Looks like cross-building Minix on FreeBSD did once work (documentation mentions FreeBSD 10), but this no longer seems to be the case. Not having any Linux machines around to try it on, I decided to skip it.

Conclusion

The 4 articles of this mini series detail how you can setup a PXE server on FreeBSD that will serve multiple operating systems depending on the menu item chosen by the user. With all the examples of Linux, illumos and various other Open Source operating systems in this article, you have plenty of choice for experimenting in your home lab!

This does not mean that there are not many, many more options available for free. If you know how to add more options - why not write about it yourself? Be sure to let me know, I'll happily place a link to your work.

And as always: Feedback, suggestions for improvements and such are very welcome. Have fun!

BACK TO NEUNIX INDEX