CFanのBlog

A good day for snow-viewing

Turning a diskless Dell Precision 3240 into a Docker development machine: ESXi + iPXE + iSCSI in practice

No comments on Turning a diskless Dell Precision 3240 into a Docker development machine: ESXi + iPXE + iSCSI in practice
345 views

Translated from the Chinese original by Claude.

I have a Dell Precision 3240 Compact sitting idle: i7-10700, 64GB of RAM, plus a 6GB Quadro RTX 3000. It would be just the thing for running a Docker development environment, except that there’s no drive in it, and drives cost an arm and a leg these days.

As it happens there’s still space on my ESXi host, and an Ubuntu VM already running on it, so I gave this a go: add a 100GiB virtual disk to the VM, have the 3240 boot from the network, and hand it its system disk over iSCSI. That way the development environment and the containers can move over to the 3240, saving some memory on my main machine.

In the end it’s the physical 3240 that runs Docker, with its own CPU, memory and GPU; the Ubuntu VM on ESXi provides the boot files and the system disk. After a reboot, files and the data in Docker volumes are all still there. Below I’ve written up how I actually built it and the pitfalls I ran into.

Overall architecture

Architecture of the diskless Dell 3240 Docker dev machine: RouterOS provides DHCP, the Ubuntu VM provides booting and the iSCSI system disk, and containers join the Lab network over VLAN 110
The host’s management network and the containers’ Lab network share one network cable but use different VLANs. The diagram contains no real internal addresses.

  • RouterOS: handles DHCP, telling the 3240 which server to go to and which UEFI boot file to fetch.
  • Ubuntu boot/storage VM: TFTP serves iPXE; Nginx serves the kernel and initramfs; Linux LIO exports the whole 100GiB virtual disk over iSCSI.
  • Dell 3240: UEFI network boot into Ubuntu with the root directory on the iSCSI disk, then runs Docker, Compose and the NVIDIA driver.
  • Switch: the host keeps using the original untagged management network; containers that need their own Lab address use tagged VLAN 110.

In this setup, ESXi only hosts the virtual disk and the storage VM; it’s the Ubuntu VM that serves iSCSI to the network. The VM’s own existing system disk must not be formatted for this; I added a separate VMDK just for the Dell.

Diskless boot flow: UEFI PXE, DHCP, iPXE, Linux downloaded over HTTP, initramfs logs in to iSCSI, Ubuntu and Docker start
PXE gets Linux going; once the iSCSI root directory is mounted, that network disk is still the system disk.

Environment and example addresses

This time I used ESXi 8.0 U3, Ubuntu 24.04 LTS, Mikrotik RouterOS, and a WNDR3800 doing the VLAN switching. The switch model doesn’t matter; what matters is that the Dell’s port can carry both the untagged management network and tagged VLAN 110.

Everything below uses example addresses and an example MAC; don’t take them as your own configuration. If your management network isn’t a /24, change the gateway, netmask, DHCP and access control to match.

PurposeExample value
Management network192.168.10.0/24
RouterOS management gateway / DNS192.168.10.1
Dell management address192.168.10.60
Dell MAC02:11:22:33:44:55
Lab VLAN110, 192.168.110.0/24
Lab gateway192.168.110.1
Ubuntu boot/storage VM192.168.110.10
Docker Lab address pool192.168.110.224/27, i.e. .224–.254
Lab DHCP poole.g. .50–.199, kept apart from the Docker pool

The host and the storage VM can be on different subnets, but there must be a route between them. At a minimum, check TFTP requests and their return traffic, HTTP 8088 and iSCSI TCP 3260; the firewall should only let through the clients that need access.

Step 1: give the Ubuntu VM a dedicated disk

In ESXi, add a 100GiB virtual disk to the existing Ubuntu VM. I put mine in a folder of its own so that it’s easy to recognise and back up later. Inside the VM, first confirm the new disk’s size, SCSI position and stable device path:

Partitioning and mkfs wipe the data on the chosen disk. First make sure it’s the newly added empty disk, not mounted and not used for anything else; don’t just run the commands with the /dev/sdb from someone else’s article. I’d recommend always using a by-path/by-id path you’ve checked.

I split the disk into a 512MiB FAT32 ESP and an ext4 root partition taking the rest of the space. The ESP is held in reserve for migrating or changing the way it boots later; for now PXE loads Linux directly, without relying on GRUB on the disk.

Step 2: prepare an Ubuntu root file system on the new disk

I built a Noble root file system with debootstrap rather than letting an installer touch the ESXi VM’s boot disk or EFI boot entries. The following commands run on the storage VM, and the target directories are all on the new disk:

Set up the package sources for the Ubuntu mirror you actually use, including noble, noble-updates and noble-security; if you’ll be installing NVIDIA packages later, enable restricted / universe / multiverse as well. These are the main packages to install in the chroot:

Also create your own login user, install your SSH public key, and enable services such as ssh, systemd-networkd and systemd-resolved. The following still runs in the chroot; put your own public key in authorized_keys. Don’t copy your private key to the server.

Set the local password yourself; for SSH, you can also explicitly turn off PasswordAuthentication, KbdInteractiveAuthentication and root login in sshd_config.d. The temporary policy-rc.d must be removed once the build is finished, or it will block services you install later.

I wrote the Netplan config to match the network card’s MAC, keeping the host on the original management network. An example /etc/netplan/10-dell-netboot.yaml:

The root directory’s fstab uses the UUIDs that blkid reports, so it doesn’t depend on whether the disk is called sda or sdb on the next boot:

Step 3: have the initramfs log in to iSCSI before mounting the root directory

This is what decides whether a diskless system comes up at all. In a normal install, networking and the iSCSI services may only start after the root directory is mounted; here the root directory itself is on the network, so these steps have to be brought forward into the initramfs.

Set a unique initiator IQN, for example:

Write it to /etc/iscsi/initiatorname.iscsi, and configure the target in /etc/iscsi/iscsi.initramfs:

The password here must match the CHAP settings in the server’s ACL. The file holding the credentials should be readable by root only. Then add the network card and storage modules to /etc/initramfs-tools/modules; this 3240’s wired network card uses e1000e:

Also check the system user, SSH host keys, Netplan, fstab and which services are enabled at this stage. When the build is finished, remove policy-rc.d and exit the chroot. First copy the kernel and initramfs you mean to boot to a private staging directory on the storage VM, then unmount the build mounts:

Step 4: export the whole new disk with LIO

On the storage VM, use targetcli/LIO to export the dedicated VMDK as iSCSI LUN 0. Once connected, the Dell sees a whole disk and finds the GPT, ESP and ext4 root partition on it by itself.

All the commands below run in an ordinary Bash terminal on the storage VM, having already left step 3’s chroot; each sudo targetcli ... is a one-off command, with no need to enter the targetcli interactive shell first. Run them section by section and stay in the same SSH session, as later commands use variables defined earlier.

4.1 Make sure the disk is unmounted; prepare variables and a configuration backup

This is the procedure for a first-time setup, when the Dell isn’t using the disk yet. First install the tools and look at the existing targets, then define this section’s example values. The two IQNs, the storage VM’s address and the CHAP user name must match step 3; for the disk path, use the whole-disk path of the new 100GiB VMDK you confirmed in step 1, without -part1 or -part2.

Check that the size and partitions match what you installed earlier, that MOUNTPOINTS is empty for the disk and all its partitions, and that findmnt no longer lists any mounts under the build directory. If anything is still mounted, go back to step 3 and finish unmounting first. This step only exports the disk: no more partitioning or formatting.

If targetcli ls already shows a backstore with the same name or the same Target IQN, check the existing configuration first: don’t create it a second time, and don’t use clearconfig to wipe out other targets. Before changing anything, you can back up the existing configuration:

With the Ubuntu 24.04 packages used here, the default save location is /etc/rtslib-fb-target/saveconfig.json; some distributions use /etc/target/saveconfig.json. Go by what saveconfig tells you on your own machine and the path the restore service actually uses, and don’t mix the two up. The configuration file and its backups may contain CHAP passwords and must be kept private.

The same ext4 file system must never be mounted read-write by the storage VM and the Dell at the same time, as two separate systems. While the system is being built, it’s mounted on the VM; in normal running, the Dell uses it. For maintenance later on, too, shut the Dell down cleanly and disable its LUN first, and only then think about mounting it on the VM to check it.

4.2 Create a block backstore and a dedicated Target

Register the whole disk you just confirmed as a block backstore named dell3240, then create the Target. targetcli creates tpg1 along with it; disable this new TPG first, and only open it up once the Portal, ACL and password are all configured.

generate_node_acls=0 means only ACLs created by hand are accepted; authentication=1 requires authentication at login. Don’t change these to the demo mode that lets any initiator in.

4.3 Remove the default all-addresses Portal and listen only on the storage address

First list this new TPG’s Portals:

If you see the default 0.0.0.0:3260, delete it:

Some versions show the IPv6 wildcard address [::0]:3260 instead; in that case use the command below. If it shows [::]:3260, change the argument to :: to match. Only delete wildcard Portals that are actually in the list; if the list is empty to begin with, skip the deletion.

Then create an explicit LAN address to listen on. That address must already be configured on the storage VM’s network card:

This Target’s Portal list should now contain only 192.168.110.10:3260. The delete here only removes a listening endpoint, not the disk, and the path always stays within the Dell Target you have just created.

4.4 Create LUN 0, the Dell’s ACL and an explicit mapping

First export the backstore as the TPG’s LUN 0, then create an ACL for the Dell’s initiator IQN. Turn off automatic mapping explicitly in both places, then map the LUN 0 the client sees to the TPG’s LUN 0 by hand:

In the last create, the first 0 is the client’s LUN number and the second 0 is the TPG’s LUN number; write_protect=0 allows reads and writes. Under the ACL you should see mapped_lun0 pointing to lun0, marked rw. With only the ACL and without this mapping, the client may not see the system disk even if authentication succeeds. You can check the command arguments against targetcli’s LUN/ACL implementation.

4.5 Set up CHAP for this ACL

The user name stays as dell3240 from step 3. The password must also be exactly the same as ISCSI_PASSWORD in step 3’s initramfs; I suggest 16 random ASCII letters and digits, to avoid spaces or quotation marks being parsed differently. Enter it privately with read, so the password itself never ends up in your command history:

Make sure the set command reported no errors before carrying on. This only sets one-way CHAP on the Dell’s ACL; mutual CHAP isn’t configured. If you change the password later, change the Dell’s initramfs configuration to match, then regenerate and republish the boot files; changing it only on the server means the next boot won’t be able to log in to the system disk.

4.6 Enable the Target, save, and turn on restore at boot

Once the configuration is complete, enable the TPG, save explicitly once, and restrict the configuration file’s permissions:

The output of saveconfig should point to the DELL_SAVE set earlier, and the last command should show enabled. Changes made with targetcli take effect in the kernel immediately; the saved file is what makes them persistent, and the systemd service is what restores them at the next boot: two separate things. See also the targetcli manual page for Ubuntu 24.04.

So that the service doesn’t fail to restore when the storage VM’s network address isn’t up yet, I also gave it start-up ordering and retry-on-failure settings. Run the edit command below and put the content that follows it into the drop-in:

Check that the drop-in you just added shows up. How long network-online actually waits also depends on the wait-online service of whichever network manager the VM uses, so this line alone doesn’t mean the network is ready.

Don’t casually stop or restart this restore service while the Dell is running. On this machine the service’s ExecStop calls targetctl clear, which removes the current target configuration from the kernel, affecting the iSCSI disk that’s in use. You don’t need a restart to make targetcli’s changes take effect; to test restoring after a reboot, shut the Dell down properly first, then schedule a maintenance window for the storage VM.

4.7 Check the listener, the ACL and the firewall rules

Check each item: the TPG is enabled; authentication is 1 and generate_node_acls is 0; only the specified Portal is there; LUN 0 points to the dell3240 backstore; mapped_lun0 under the Dell’s ACL is rw; the save file can be read and written by root only. TCP 3260 listening only proves the port is open; it’s no substitute for checking the ACL and CHAP.

There also needs to be routing both ways between the management network and the Lab network, and TCP 3260 from the Dell to the storage VM must be allowed. If UFW is already enabled on the VM, you can add a precise rule using this section’s example addresses; with another firewall, set up an equivalent rule:

There’s no need to switch on, remotely, a firewall you weren’t using before just for this tutorial. CHAP here is for authentication at login and doesn’t encrypt the iSCSI data; keep the port within a trusted internal network.

4.8 Verify the restore after the storage VM reboots

While the Dell isn’t running yet, and once you’ve made sure the other workloads on the storage VM can stand some maintenance, you can reboot the storage VM once; after reconnecting, check:

It’s normal for a oneshot service like this one to show active (exited); what matters is that the log shows no failure to restore and that the Target, Portal, LUN and ACL are all still there. If it did fail, first check whether the VMDK is still attached, whether the stable device path exists, and whether the bound IP is up. Don’t log in to and mount, on the storage VM, the ext4 disk it exports itself just to test it.

Once the storage side is ready, carry on with the PXE setup in steps 5 and 6. When the Dell has actually booted successfully, use sudo iscsiadm -m session and findmnt / on the Dell to check the iSCSI session and the root directory, then follow step 7 to verify that files and Docker volumes survive a reboot.

Step 5: set up TFTP, HTTP and iPXE

UEFI fetches a small loader first; the bulkier kernel and initramfs then come over HTTP. For iPXE I used the signed release package the project provides, taking snponly-shim.efi and snponly.efi from its x86_64-sb directory and putting them in the same TFTP directory, which is where autoexec.ipxe goes too.

The key tftpd-hpa settings:

Nginx listens on 8088 by itself, and only the Dell and the storage VM itself may fetch files:

Publish the matching vmlinuz and initrd.img you staged earlier in /root/dell-boot-staging to the HTTP directory, making sure the Nginx user can read them, but don’t turn on directory listing. shimx64.efi is Ubuntu’s signed shim; the file comes from the shim-signed package on the storage VM, and you can look up its exact path with dpkg -L shim-signed. The key part of autoexec.ipxe is as follows:

iPXE’s shim command is simply skipped when Secure Boot is off.

The initramfs contains the iSCSI credentials. Keep the file’s directory and permissions and the Nginx access restrictions in place; don’t treat it as a public download, and don’t upload it as an attachment to a post. HTTP itself isn’t encrypted, so use this setup only on a trusted internal network.

Set the services to start once the network is up, and check their start-up order. tftpd-hpa in particular: this time I ran into the service still not actually running after enable, so confirm with is-active, then verify by actually downloading from a client.

Step 6: have RouterOS send PXE options to this Dell only

Don’t switch DHCP for the whole LAN over to network booting. I gave the Dell a static lease, then added a DHCP network entry that matches only that address. The example management network is a /24, so although the matching rule says /32, the netmask sent to the client is still 24. RouterOS’s description of the netmask and next-server fields is worth reading alongside this.

DHCP network fieldExample value
Address192.168.10.60/32
Netmask24 (fill in to match your real management network)
Gateway / DNS192.168.10.1
Next Server192.168.110.10
Boot File Namesnponly-shim.efi

The static lease matches on the Dell’s MAC, with Client ID left empty. This is where I fell into a rather convoluted trap: the DHCP Client IDs sent by UEFI PXE, the initramfs and the installed system can all differ. At first the static lease was also tied to a Client ID, so the initramfs got a different, dynamic address. The next PXE boot then reused that old dynamic lease, and that address had no boot options, so it got stuck at Start PXE over IPv4 and then fell back to IPv6.

The fix was to check the MAC, change the lease to match on MAC, clear out the old dynamic leases confirmed to belong to this Dell, and PXE boot again. Don’t clear other machines’ leases while you’re at it, and don’t bring back into use an old address that another device is using.

After that, press F12 when the Dell powers on and choose UEFI Network / Onboard NIC IPv4. Once it has booted into Ubuntu, check:

Step 7: install Docker, and test persistence first

Docker comes from the official Ubuntu APT repository. Once the repository is set up, install Engine and the Buildx and Compose plugins:

The docker group can control the host, so treat adding a member as granting admin rights. Keep development data in explicit bind mounts or named volumes, so it survives when throwaway containers are deleted.

I did two kinds of reboot test: writing an ordinary file to the system disk, and using a throwaway container to write a marker into a named volume; after a normal reboot I read them back. Both had survived, confirming that this really is a persistent system, not a one-off live environment.

If the development services are only for you to access, you can still use the ordinary Docker bridge, bind the ports to the host’s loopback and forward them over SSH:

Step 8: keep the host’s IP and put containers in the Lab VLAN

Later I also connected the Lab VLAN to Docker. On the switch port the Dell is plugged into, the existing management network stays untagged, and VLAN 110 is added as tagged; the uplink ports to the router and to ESXi must already let this VLAN through as well. Don’t move the host’s management IP straight into the Lab, or you may also upset the routing to the iSCSI root disk.

Create a macvlan network whose parent interface ends in .110; Docker creates and manages the matching 802.1Q subinterface. The address pool is carved out separately, outside the DHCP range:

eno2 is the actual name of this machine’s wired network card; on other machines, check with ip -br link first. The host doesn’t need a Lab address or default route of its own on eno2.110. Docker’s macvlan documentation also explains this use with a VLAN subinterface and the limits on talking to the host.

In Compose, refer to it as an existing shared network:

This way each container has its own Lab IP, and services can simply listen on ports inside the container, with no need to map host ports. Only containers that join lab110 get a Lab address; Docker’s default bridge network is another matter. Static IPs have to be coordinated with the other VMs and devices: Docker won’t spot addresses that other machines have been given by hand.

Also bear in mind that macvlan isolates the host by default: the host can’t talk directly to its own macvlan containers through the same parent interface. Here the management network and the Lab are on different VLANs, so connectivity to the host’s management address goes the routed way; if the host needs to reach Lab containers directly, you’ll have to design a separate shim interface or route, and set aside an address for it.

This time, reaching the Lab gateway, the storage VM, the host, DNS and HTTPS from a container all worked; I also started a temporary HTTP service and reached its Lab IP from my main machine and from the storage VM, and once two-way traffic was confirmed I deleted the test container.

Optional: hand the RTX 3000 to Docker

Drivers for the Intel network card, integrated graphics, Wi-Fi and so on already come with the Ubuntu kernel. For the RTX 3000, install the NVIDIA server driver Ubuntu recommends and the prebuilt modules for your kernel, then install the Container Toolkit following NVIDIA’s official instructions.

What I tested on this machine was the 595.91.07 server open driver and Container Toolkit 1.20.1. Check the driver branch with ubuntu-drivers list --gpgpu first rather than applying this version number to every graphics card. Back up daemon.json before changing Docker’s configuration, as nvidia-ctk runtime configure --runtime=docker merges in the NVIDIA runtime; before restarting Docker, make sure no containers are in use.

Both the host and the container recognised the Quadro RTX 3000’s video memory. This check proves the GPU is visible to containers; real CUDA programs also need the matching user-space libraries in the image.

What’s easiest to forget in later maintenance

  • Power-on and shutdown order: start ESXi and the storage VM first, then the Dell; before shutting down the storage VM or ESXi, shut the Dell down properly first.
  • A kernel upgrade means updating the PXE files too: the files in /boot on the Dell and the copies in Nginx’s publishing directory are two separate sets. Once update-initramfs has run, you still have to publish the matching kernel and initramfs, check their hashes, and keep the old version.
  • Keep the modules for the kernel that’s booting now: NVIDIA’s prebuilt modules especially; don’t let apt autoremove delete a version that PXE is still using.
  • The network is the link to the system disk: before changing Netplan, VLANs or routes remotely, take the iSCSI root disk into account as well.
  • Persistence isn’t a backup: the VMDK, application data and configuration all need backing up separately; don’t casually run docker system prune --volumes on a shared development machine.

Two more little side stories to note. An unused USB-C control function on the GPU was reporting I2C/UCSI timeouts; after confirming what the port was for, I disabled only the automatic probing of i2c_nvidia_gpu, then rebuilt and published the initramfs. After a reboot the error was gone, and the GPU and ordinary USB still worked. This is a workaround for a feature this machine doesn’t use, not a general firmware fix, and certainly not suitable for machines that need the GPU’s USB-C.

Intel AMT out-of-band management

A diskless machine has one more practical problem: what do you do if you get the network settings wrong and can’t get in over SSH? Workstation platforms like the 3240 have Intel vPro AMT, but first make sure your CPU, motherboard, ME firmware and BIOS configuration really do support it and have it enabled.

SSH and Intel AMT compared: SSH depends on Ubuntu, while AMT runs in the Intel ME firmware and provides out-of-band access through a separate management endpoint
What AMT can do depends on the platform and configuration. What I verified this time is logging in to Ubuntu over SOL; remote power actions and KVM were not fully tested this time.

SSH is the everyday way into Ubuntu; AMT runs on the Intel ME firmware side and, given the right configuration and network conditions, can provide a way in for management when the operating system isn’t running properly. Its uses include checking the power state, remote power control and Serial over LAN. The AMT management address may be shared with Ubuntu or configured separately; when connecting, check it against the network settings actually configured in MEBx/AMT.

Start with the Manageability settings in the BIOS. Dell’s documentation for the 3240 lists Intel AMT Capability and MEBx Hotkey. Enable them as your management needs require, then go into MEBx, set separate management credentials and the network settings, and enable the features you need, such as SOL. How you get into MEBx depends on the BIOS configuration; there’s no guarantee that pressing Ctrl+P at power-on will bring it up on every machine.

For management connections, set up TLS and certificate checking first, and keep them on a trusted management network or behind a VPN; don’t map the AMT management ports straight to the internet. The usual TLS management port is 16993 and the TLS redirection port is 16995; whether they are actually open depends on the firmware version and configuration. Intel also explicitly recommends moving to TLS management connections.

This time the AMT client could already connect to the machine, so what was left to add was the SOL login on the Ubuntu side. First use lspci, dmesg and sysfs to confirm which serial port AMT maps to; on this machine the Comet Lake KT redirection device, 00:16.3, is ttyS4, and ttyS0 is a separate legacy serial port:

Enable serial-getty for whichever serial port it actually is. Here I fix it at 115200 8N1, without relying on carrier detect from the client; below is the drop-in for [email protected], but take care not to copy ttyS4 blindly onto different hardware:

You can also append console=ttyS4,115200n8 to the kernel command line in the iPXE script from earlier, keeping console=tty0. That way, the next time it boots with these parameters, Linux’s text output will go to the serial port as well; enabling getty alone makes the login prompt appear straight away, so there’s no need to reboot the machine just for the login prompt.

Logging in to AMT/MEBx and logging in to Ubuntu are two separate authentications. Once in SOL you still need a Linux user name and local password; at first I had only set up an SSH public key and ubuntu’s local password was locked, so I had to set one myself by running sudo passwd ubuntu over SSH. The password is only ever typed in the terminal; SSH password login can stay off, and there’s no need to turn on automatic root login either.

The client and Linux also need to agree on the terminal size. Intel Manageability Commander 2.2.0 defaults to 80 columns by 25 rows, and a serial port doesn’t negotiate the window size automatically the way SSH does, so if need be, match it with stty rows 25 cols 80 in the SOL shell. I’ve confirmed that my machine can log in to Ubuntu over SOL, but this version of Commander still has trouble drawing htop/top full-screen, and adjusting the size and terminal capabilities didn’t entirely fix it. I’m leaving that until I switch to a client with better support; everyday monitoring goes over SSH.

Summary

Diskless booting, repeated reboots, persistence of system files and Docker volumes, two-way traffic on the Lab network, and GPU detection in Docker have all been verified. Development code and containers can move over to run on the 3240, with my main machine connecting over SSH / Remote SSH.

The costs are just as clear: the storage VM and the network have become hard dependencies, and system-disk I/O has to go through a gigabit port. A gigabit link manages about 125MB/s in theory, and in practice you lose some of that to protocol and storage overheads; I didn’t benchmark storage throughput this time. If you already have room on ESXi, a switch and a small workstation sitting idle, borrowing a network system disk like this really can put the machine back to work.

Leave a comment

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.