An Ubuntu installer ISO is a frozen snapshot. The 22.04 image ships a kernel and drivers older than NVIDIA’s RTX 50-series (Blackwell) cards, so a plain install can leave a new GPU without a working driver. Remastering means unpacking the ISO, installing newer packages into its root filesystem, and packing it back into a bootable image, so the installed system gets the right kernel and driver without an internet connection.
I built one at work for a new PC with an RTX 50-series card. Thirteen separate problems came up on the way, and most of them taught me something about how an ISO is put together.
How a remaster works
The ISO holds a compressed copy of the whole installed system (a squashfs image) plus the files that make it bootable. You unpack the squashfs into a folder and chroot into it, which runs apt as if that folder were a running Ubuntu. Then you compress it again, update the small files the installer reads about it, and rebuild the ISO around it with the same boot settings the original used.
Which NVIDIA driver Blackwell needs
RTX 50-series support on Linux arrived with NVIDIA’s 570 driver branch. The 570.86.16 beta, released at the end of January 2025, is the release that lists the RTX 5090 and RTX 5080. Lower-end cards came later in the branch: the desktop RTX 5060 is missing from the supported-GPU list of 570.153.02 and present in 570.169 and in 575.57.08. Any later branch that lists your card works. My build used 580 only because it was current.
The driver’s flavour matters more than its number. NVIDIA’s README says Blackwell and later GPUs are supported only by its open kernel modules. On Ubuntu that means the package ending in -open, such as nvidia-driver-580-open. The plain nvidia-driver-580 builds the proprietary modules, which don’t support Blackwell. My build used the plain package. I only caught that afterwards, when I checked NVIDIA’s documentation, so the image needs rebuilding with the -open package.
The build machine’s own GPU doesn’t have to match the target’s. DKMS compiles the driver module against the kernel headers, not against the hardware in the machine doing the build.
What went wrong, and why
| Problem | Why it happened | Fix |
|---|---|---|
| The build machine froze | The driver compile ran one job per CPU thread with no memory limit, and ran a small-RAM machine out of memory | Run the chroot inside a memory-capped systemd scope and limit the compile’s parallel jobs |
| System files owned by a normal user | Unpacking a squashfs without root can’t set file owners, so files such as /etc/shadow came out wrong | Unpack and repack as root |
| Package version conflicts | A crashed attempt left extra files behind, and the base packages were older than the new kernel expected | Delete the folder before every re-extract, and upgrade the base packages before adding the kernel |
| A stray initrd for the wrong kernel | update-initramfs saw the build machine’s running kernel through the shared /proc | Delete it before repacking |
| A tiny, unbootable ISO | xorriso’s recursive-remove command takes a list of paths with no end, so it swallowed every option after it | End its list with -- |
| xorriso refused to write the boot record | Editing the ISO in place doesn’t move the EFI boot partition when the image changes size | Build a fresh ISO, replaying the boot options xorriso reports for the original |
| No DNS on the installed system | /etc/resolv.conf is a symlink, and copying a file over it replaced the link, which cleanup then deleted | Record the link’s target first and recreate the link afterwards |
Checking and installing
No virtual machine was available, so I checked the image’s structure instead: both the BIOS and UEFI boot entries were present, the partition table was valid, and I recorded the image’s checksum. A Ventoy USB stick makes testing cheap, because you copy the ISO onto it as an ordinary file and Ventoy lists it in its boot menu.
The driver module is signed with a key that was created on the build machine. The target’s firmware doesn’t know that key, so either turn Secure Boot off before installing or enroll the key on the target.
A chroot shares the real machine's hardware
A chroot isn’t a virtual machine. With
/dev,/procand/sysbind-mounted, a package script that loads or unloads a kernel module acts on the build machine itself, including its running GPU driver. Replacemodprobe,insmodandrmmodwith do-nothing stubs for the build, and put the real ones back afterwards.
Related: windows11-vmd-nvme