Add an unattended-install ISO builder
Boot the stick, pick one GRUB entry, walk away: it wipes the target disk, installs Ubuntu 26.04.1 with the NVIDIA driver and codecs, and runs setup.sh on first boot to install the apps. build-iso.sh does the image surgery in a container, so the build machine needs nothing but podman. The wipe is pinned to one disk serial (the 990 PRO). The Data drive can't match it, and an unmatched disk stops the install rather than guessing — so the stick can't eat another machine either. The autoinstall entry is not the GRUB default, so an accidental boot lands in the ordinary Ubuntu installer. Verified by running the install in a VM with two virtual NVMe drives carrying the real serials: unattended start to finish, target partitioned and installed, Data disk byte-for-byte identical, and late-commands left /opt/main-desktop plus the enabled first-boot service in place. Testing caught the autoinstall args landing after '---' (where they reach the installed system instead of the installer, and do nothing), and the first-boot run adding root rather than ckoch to the docker group, since runuser leaves $USER alone. setup.sh gains an unattended mode for that first-boot run, waits out the dpkg lock that Ubuntu's own boot-time upgrades hold, waits for snapd to finish seeding before removing the Firefox snap, and skips the driver step on machines with no NVIDIA card. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,13 +1,18 @@
|
||||
# main-desktop
|
||||
|
||||
**Ubuntu 26.04 LTS** on my desktop (Ryzen 7 9800X3D, RTX 5090, 49" 5120x1440), set up by one
|
||||
script. This replaces the Bazzite/BlueBuild image that used to live here — that version is still
|
||||
in the git history.
|
||||
**Ubuntu 26.04 LTS** on my desktop (Ryzen 7 9800X3D, RTX 5090, 49" 5120x1440), installed from a
|
||||
custom ISO that wipes the drive and sets the whole machine up without being watched. This replaces
|
||||
the Bazzite/BlueBuild image that used to live here — that version is still in the git history.
|
||||
|
||||
[scripts/setup.sh](scripts/setup.sh) turns a fresh Ubuntu install into this machine: NVIDIA
|
||||
driver, Docker with GPU access, Steam, the apps in [flatpaks.txt](flatpaks.txt), and the drive
|
||||
mounts. It's safe to re-run. Copying files over and signing in to apps are deliberately **not**
|
||||
its job — I do those by hand.
|
||||
| File | What it is |
|
||||
|---|---|
|
||||
| [scripts/build-iso.sh](scripts/build-iso.sh) | Builds the install ISO: stock Ubuntu desktop ISO + this repo + the autoinstall config |
|
||||
| [iso/user-data.in](iso/user-data.in) | The autoinstall config — which disk to wipe, the user, the driver and codec choices |
|
||||
| [scripts/setup.sh](scripts/setup.sh) | Installs everything (drivers, Docker, Steam, Flatpaks, mounts). Runs itself on first boot; also runnable by hand on a stock Ubuntu install |
|
||||
| [scripts/firstboot.sh](scripts/firstboot.sh) | The one-shot first-boot wrapper that calls setup.sh |
|
||||
| [flatpaks.txt](flatpaks.txt) | The app list |
|
||||
|
||||
Copying files over and signing in to apps are deliberately **not** automated — I do those by hand.
|
||||
|
||||
## Why leave Bazzite
|
||||
|
||||
@@ -15,39 +20,62 @@ The read-only base made ordinary things into projects. VS Code had to be layered
|
||||
Node and .NET came from Homebrew, and Claude desktop ran inside an Ubuntu distrobox because it
|
||||
only ships for Ubuntu/Debian. On Ubuntu, each of those is an `apt install`.
|
||||
|
||||
## 1. Install Ubuntu 26.04 LTS
|
||||
|
||||
> **⚠ Two identical 1 TB NVMe drives.** Install to the **Samsung SSD 990 PRO**. Never pick the
|
||||
> **Samsung SSD 970 EVO Plus** — that's the "Data" drive holding the second Steam library and the
|
||||
> emulator files, and it stays untouched. `nvme0`/`nvme1` can swap between boots, so go by the
|
||||
> model name the installer shows.
|
||||
|
||||
- "Erase disk and install Ubuntu" on the 990 PRO is fine.
|
||||
- Make the user **`ckoch`**. The first user gets UID 1000, which matches the file ownership
|
||||
already on the Data drive.
|
||||
- The "third-party drivers" checkbox doesn't matter; setup.sh installs the NVIDIA driver either
|
||||
way.
|
||||
- Prefer KDE? Install **Kubuntu 26.04** instead. The script doesn't care which desktop you run.
|
||||
|
||||
## 2. Run the script
|
||||
## 1. Build the ISO
|
||||
|
||||
```bash
|
||||
sudo apt install -y git
|
||||
git clone https://git.lazypugs.com/ckoch/main-desktop.git ~/Documents/git/main-desktop
|
||||
cd ~/Documents/git/main-desktop && scripts/setup.sh
|
||||
scripts/build-iso.sh
|
||||
```
|
||||
|
||||
It asks for your sudo password once, then for the server-marvin SMB credentials — press Enter
|
||||
there to skip that mount. Flatpaks take most of the run. **Reboot** when it finishes.
|
||||
It asks for the login password to bake in, downloads the Ubuntu 26.04.1 desktop ISO if `build/`
|
||||
doesn't have it (~6 GB, resumable, checksum-verified), and writes
|
||||
`build/main-desktop-<date>.iso`. The image surgery runs in a container, so the build machine needs
|
||||
nothing but podman — it works from Bazzite as-is.
|
||||
|
||||
What it installs:
|
||||
**The ISO holds your password hash, so treat the stick as private.**
|
||||
|
||||
- **NVIDIA driver:** Ubuntu's recommended **open-kernel** branch (595 today) with the prebuilt,
|
||||
signed modules, so no DKMS. The script stops if it ends up with a non-open driver, since
|
||||
Blackwell only runs on the open modules. Also 32-bit GL for Steam and Proton.
|
||||
- **Gaming:** Steam (`steam-installer` plus `steam-devices` for controllers), Lutris, GameMode,
|
||||
MangoHud, and ProtonUp-Qt for Proton-GE. The Xbox Bluetooth fix (`disable_ertm`) carries over
|
||||
from Bazzite.
|
||||
Write it to a USB stick — check the device name first, `lsblk` before you `dd`:
|
||||
|
||||
```bash
|
||||
sudo dd if=build/main-desktop-<date>.iso of=/dev/sdX bs=4M status=progress oflag=direct conv=fsync
|
||||
```
|
||||
|
||||
## 2. Boot it and pick the last GRUB entry
|
||||
|
||||
> **Install main-desktop UNATTENDED — ERASES the target disk**
|
||||
|
||||
It is deliberately **not** the default entry: left alone, the stick boots into the ordinary Ubuntu
|
||||
installer, so an accidental boot can't wipe anything. The other entries are untouched.
|
||||
|
||||
### What keeps this from eating the wrong disk
|
||||
|
||||
The autoinstall config matches **one disk by serial** — `S73VNU0Y101555E`, the 1 TB Samsung
|
||||
990 PRO. The other NVMe in this machine (the 970 EVO Plus, "Data", serial `S6P7NS0X656465Z`,
|
||||
holding the second Steam library and the emulator files) never matches, and if no disk matches
|
||||
the installer stops instead of guessing. The same goes for any other machine you boot the stick
|
||||
on: it refuses rather than picking something.
|
||||
|
||||
Verified by installing from this ISO in a VM with two virtual NVMe drives carrying exactly those
|
||||
two serials: the 990 PRO one came out partitioned (1 GB ESP + root) with Ubuntu on it, and the
|
||||
Data one was byte-for-byte identical afterwards, marker file and all. The whole install ran
|
||||
without a keypress and rebooted on its own.
|
||||
|
||||
From there it runs on its own: partition, install Ubuntu desktop, install the NVIDIA driver and
|
||||
media codecs, then reboot.
|
||||
|
||||
## 3. First boot installs the apps
|
||||
|
||||
A one-shot service runs [setup.sh](scripts/setup.sh) the first time the new system boots. It
|
||||
needs the network, takes a while (roughly 12 GB of Flatpaks), and logs to
|
||||
`/var/log/main-desktop-firstboot.log`:
|
||||
|
||||
```bash
|
||||
tail -f /var/log/main-desktop-firstboot.log
|
||||
```
|
||||
|
||||
You can log in and use the machine while it works. It installs:
|
||||
|
||||
- **Gaming:** Steam (plus `steam-devices` for controllers), Lutris, GameMode, MangoHud, and
|
||||
ProtonUp-Qt for Proton-GE. The Xbox Bluetooth fix (`disable_ertm`) carries over from Bazzite.
|
||||
- **Containers:** Docker CE from Docker's repo (not the snap), with `--gpus all` wired up through
|
||||
nvidia-container-toolkit. You're added to `docker` and `kvm`.
|
||||
- **Apps:** the 27 Flatpaks in [flatpaks.txt](flatpaks.txt), picked from the 42 that were on
|
||||
@@ -57,26 +85,19 @@ What it installs:
|
||||
cmake, and git credentials kept in the GNOME keyring. **No Node or .NET on the host** by
|
||||
choice — LudosData and landingPage build in Docker. To add them:
|
||||
`sudo add-apt-repository ppa:jdxcode/mise && sudo apt install mise dotnet-sdk-10.0`.
|
||||
- **Mounts:** the Data drive at **`/mnt/data`**, and server-marvin at
|
||||
**`/mnt/server-marvin-personal`** if you gave it credentials.
|
||||
- **Mounts:** the Data drive at **`/mnt/data`**. The server-marvin share is skipped on an
|
||||
unattended run; run setup.sh again by hand if you want it, and it'll ask for the credentials.
|
||||
|
||||
## 3. After the reboot
|
||||
The installer grants passwordless sudo for that one run; firstboot.sh takes it away again on its
|
||||
way out, whether setup.sh succeeded or not.
|
||||
|
||||
```bash
|
||||
sudo flatpak update # fetches the NVIDIA GL runtime the Flatpak apps need
|
||||
```
|
||||
|
||||
Flatpak can only match that runtime to the driver once the driver is actually loaded, which is why
|
||||
it waits until after the reboot. Skip it and apps fall back to software rendering until the daily
|
||||
timer catches up about 10 minutes after boot.
|
||||
|
||||
Then, by hand:
|
||||
## 4. Then, by hand
|
||||
|
||||
- **Log out and back in** — the `docker` and `kvm` groups need a fresh session.
|
||||
- **Steam:** sign in, then **Settings → Storage → Add drive → `/mnt/data/SteamLibrary`**. Those
|
||||
games need no redownload.
|
||||
- **Display:** Settings → Displays. The monitor does **5120x1440 @ 240 Hz**; Bazzite was running
|
||||
it at 120. Turn on variable refresh rate while you're there. Ubuntu's built-in tiling earns its
|
||||
keep at this width.
|
||||
it at 120. Turn on variable refresh rate while you're there.
|
||||
- **PIA VPN:** the official Linux app works on Ubuntu (it couldn't on Bazzite's read-only `/usr`).
|
||||
Download the installer from PIA and run it.
|
||||
- **Gitea:** the first `git push` asks for your username and password once, then the GNOME keyring
|
||||
@@ -84,15 +105,11 @@ Then, by hand:
|
||||
|
||||
### Moving files across by hand
|
||||
|
||||
Worth knowing while you copy things over from the old install:
|
||||
|
||||
- **Flatpak app data** lives in `~/.var/app/<app-id>`. Copying one app's folder across brings that
|
||||
app's logins, profile and settings with it — Firefox and Thunderbird profiles included — as long
|
||||
as the app ID matches.
|
||||
- **Steam saves** are in `~/.local/share/Steam/userdata` (and Proton prefixes in
|
||||
app's logins, profile and settings with it — Firefox and Thunderbird profiles included.
|
||||
- **Steam saves** are in `~/.local/share/Steam/userdata` (Proton prefixes in
|
||||
`steamapps/compatdata`). Game files themselves redownload.
|
||||
- **FFXIV** is `~/.xlcore`, ~124 GB. Worth copying rather than re-fetching from Square's patch
|
||||
servers.
|
||||
- **FFXIV** is `~/.xlcore`, ~124 GB. Worth copying rather than re-fetching from Square's servers.
|
||||
- **ComfyUI:** copy the folder but not its `venv` — rebuild that with
|
||||
`python3 -m venv venv && venv/bin/pip install -r requirements.txt`.
|
||||
- **Don't copy** Fedora's `.bashrc`/`.bash_profile`, `~/.local/bin` (pip shims built against
|
||||
@@ -108,12 +125,29 @@ docker run --rm --gpus all nvidia/cuda:12.8.0-base-ubuntu24.04 nvidia-smi
|
||||
flatpak list --app | wc -l # 27
|
||||
findmnt /mnt/data
|
||||
claude --version && code --version
|
||||
systemctl status main-desktop-firstboot # should be a completed one-shot, now disabled
|
||||
```
|
||||
|
||||
Podman's `--device nvidia.com/gpu=all` needs a CDI spec. The toolkit normally generates one at
|
||||
boot; if Podman says the device is unknown, run
|
||||
`sudo nvidia-ctk cdi generate --output=/etc/cdi/nvidia.yaml`.
|
||||
|
||||
## Without the ISO
|
||||
|
||||
Install Ubuntu 26.04 by hand (user **`ckoch`** — the first user gets UID 1000, which matches the
|
||||
file ownership on the Data drive), then:
|
||||
|
||||
```bash
|
||||
sudo apt install -y git
|
||||
git clone https://git.lazypugs.com/ckoch/main-desktop.git ~/Documents/git/main-desktop
|
||||
cd ~/Documents/git/main-desktop && scripts/setup.sh # safe to re-run
|
||||
```
|
||||
|
||||
Reboot when it finishes, then `sudo flatpak update` once — Flatpak can only match its NVIDIA GL
|
||||
runtime to a driver that's already loaded, so apps render in software until that happens (the
|
||||
daily timer catches it about 10 minutes after boot anyway). The ISO route avoids this, because the
|
||||
driver is already installed before the apps are.
|
||||
|
||||
## Coming from Bazzite: what moved
|
||||
|
||||
| Was | Now |
|
||||
@@ -129,8 +163,13 @@ boot; if Podman says the device is unknown, run
|
||||
|
||||
## Maintenance
|
||||
|
||||
- **Add or remove an app:** edit [flatpaks.txt](flatpaks.txt) and re-run `scripts/setup.sh`.
|
||||
Removing a line doesn't uninstall anything; `flatpak uninstall <id>` once by hand.
|
||||
- **Add or remove an app:** edit [flatpaks.txt](flatpaks.txt), then re-run `scripts/setup.sh` on
|
||||
the machine (or rebuild the ISO for the next install). Removing a line doesn't uninstall
|
||||
anything; `flatpak uninstall <id>` once by hand.
|
||||
- **New Ubuntu point release:** bump `UBUNTU_POINT` in
|
||||
[scripts/build-iso.sh](scripts/build-iso.sh) and rebuild.
|
||||
- **Next LTS (28.04):** Ubuntu offers the upgrade in Software Updater once 28.04.1 is out. The
|
||||
upgrader disables third-party repos (Docker, NVIDIA toolkit, and so on) — turn them back on in
|
||||
Software & Updates → Other Software afterwards.
|
||||
- The ISO's own "Check disc for defects" option will report mismatches, since the added files
|
||||
aren't in the stock `md5sum.txt`. That's expected and doesn't affect installing.
|
||||
|
||||
Reference in New Issue
Block a user