iPXE Infrastructure and SmartOS on Packet

Joseph D. Marhee
Mar 19, 2017 · 3 min read

Note: If you’d like to jump ahead and see how I provision this infrastructure with Terraform, and manage the service stack on these hosts with SaltStack, feel free to checkout these repos on Github:

— — — — — — — — — — — — — — — — — — — — — — — — — — — —

Packet recently made available their custom iPXE feature, allowing users to PXE boot an OS of their choice, and I found this incredibly intriguing, so I decided to try something out; running SmartOS on Packet’s bare-metal platform.

I didn’t need much to get started:

  1. A SmartOS ISO (or the platform release archive): https://wiki.smartos.org/display/DOC/Download+SmartOS
  2. I elected to setup a simple webserver on an Ubuntu host, and mounted my SmartOS ISO, copied the files to my webroot:
apt-get update; apt-get install apache2 -y; mkdir /var/www/html/smartoswget https://us-east.manta.joyent.com/Joyent_Dev/public/SmartOS/smartos-latest.isomount -o loop smartos-latest.io /mnt/cp -fr /mnt/* /var/www/html/smartos/

3. Added to my webroot:

set base-url http://YOUR_HOST_IP_ADDRESS
kernel ${base-url}/smartos/platform/i86pc/kernel/amd64/unix
initrd ${base-url}/smartos/platform/i86pc/amd64/boot_archive

— — — — — — — — — —
based on a tip from the folks at Quatumsi.com, if you’d like to have the system treat this as a host using a physical USB would (i.e. mounting over this iPXE boot in order to persist many kinds of data between reboots), you should modify the above configuration with the additional kernel arguments:

kernel ${base-url}/smartos/platform/i86pc/kernel/amd64/unix -B smartos=true,console=ttyb,ttyb-mode="115200,8,n,1,-"
module ${base-url}/smartos/platform/i86pc/amd64/boot_archive type=rootfs name=ramdisk

— — — — — — — — — —

Note: if you do this on an existing Apache host, make sure to update the relative path to your base-url to your smartos directory.

This does:

i. calls out the network DHCP server for an address

ii. sets the base URL for your ipxe configuration to the Apache host you specified above, and sets the kernel and initrd path relative to that Apache webroot.

iii. boots according to this specification.

4. Login to your Packet.net account, and deploy a new server. In your Operating System selection, select “Custom iPXE” and provide the URL for your setup script (i.e. )

5. Once deployed, on your Packet node page, you can access the newly deployed node’s console:

and you’ll see the iPXE prompt pull down the configuration, required files, and boot according to this specification.

As with any SmartOS build, you’ll find the default root password in and you can login via the above console and begin configuring your SmartOS node:

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store