Fully automated bootc Anaconda installation testing with:
- Automated boot (1 second timeout, no media check)
- Host container storage access via virtiofs (using
podman unshare) - Real-time log streaming to host via virtio serial ports
- SSH access for debugging during installation
# Download Anaconda ISO to ./anaconda.iso
# Customize example-kickstart.ks with your bootc image
# Run automated installation
./run-anaconda.shThat's it! The script will:
- Auto-create
anaconda-auto.iso(automated boot, no media check) - Launch virtiofsd with
podman unshare(no sudo needed) - Boot VM and install automatically via kickstart
- Stream logs to
anaconda-install.logandanaconda-program.log
Watch installation logs in real-time:
tail -f anaconda-program.log # /tmp/program.log from installer
tail -f anaconda-install.log # Anaconda's built-in loggingOr SSH into the installer:
ssh -p 10022 root@localhost # Password: testcase
journalctl -f # Watch system logs
tail -f /tmp/program.log # Watch installation progressrun-anaconda.sh- Main script: Automated installation with loggingprepare-automated-iso.sh- Create automated boot ISO (used by run-anaconda.sh)example-kickstart.ks- Kickstart template with virtiofs + storage.confenable-anaconda-debug.sh- Add inst.debug for verbose loggingupdate-iso-kickstart.sh- Manual kickstart injection utility
prepare-automated-iso.sh modifies the base ISO:
- Sets 1 second boot timeout (immediate start)
- Removes
rd.live.check(skips media check) - Removes
quiet(shows boot messages) - Keeps
inst.sshdandinst.ksfor automation
Uses podman unshare to run virtiofsd in user namespace:
podman unshare virtiofsd \
--socket-path ./virtiofs-hoststorage.sock \
--shared-dir ~/.local/share/containers/storage \
--translate-uid "host:0:0:1" \
--translate-gid "host:0:0:1" \
--modcaps=+dac_read_searchWhy podman unshare:
- No sudo required
- Runs in same namespace as podman containers
- Automatic permission mapping
- Access to restrictive ostree repository files
In the VM:
- Mounted at
/run/virtiofs-mnt-hoststorage/ - Configured as
additionalimagestorein/etc/containers/storage.conf - Bootc can pull from
containers-storage:localhost/imageusing host layers
Two virtio serial ports stream logs to host:
anaconda-install.log - Anaconda's built-in logging via virtio
- Configured by Anaconda when it detects
/dev/virtio-ports/org.fedoraproject.anaconda.log.0
anaconda-program.log - /tmp/program.log via systemd unit
- Injected via SMBIOS credentials (
systemd.extra-unit) - Runs in initramfs, streams with
tail -f - Shows bootc installation progress
The example-kickstart.ks %pre section:
# 10GB tmpfs for fast container operations
mkdir -p /var/lib/containers
mount -t tmpfs -o size=10485760k tmpfs /var/lib/containers
# Mount host container storage
mkdir -p /run/virtiofs-mnt-hoststorage
mount -t virtiofs hoststorage /run/virtiofs-mnt-hoststorage
# Configure storage.conf for additionalimagestore
cat > /etc/containers/storage.conf << 'EOF'
[storage]
driver = "overlay"
[storage.options]
additionalimagestores = [
"/run/virtiofs-mnt-hoststorage"
]
EOFThen bootc installs from: containers-storage:localhost/bootc
Edit example-kickstart.ks line 31:
bootc --source-imgref=containers-storage:localhost/myimage --stateroot=defaultThen build your image locally so it's in ~/.local/share/containers/storage.
Simply edit example-kickstart.ks - the ISO is regenerated on every run.
For a different kickstart file, modify prepare-automated-iso.sh:
# Change line 10 in prepare-automated-iso.sh:
KICKSTART="${SCRIPT_DIR}/my-custom.ks"In kickstart %pre section, change size parameter:
mount -t tmpfs -o size=5242880k tmpfs /var/lib/containers # 5GB instead of 10GBCheck if systemd unit is running:
ssh -p 10022 root@localhost
systemctl status anaconda-program-log.service
ls -la /dev/virtio-ports/The podman unshare + --modcaps=+dac_read_search approach should handle this.
Verify virtiofsd started:
ps aux | grep virtiofsd
ls -la virtiofs-hoststorage.sockSSH in and check:
ssh -p 10022 root@localhost
journalctl -u bootc-install # Bootc service logs
cat /tmp/program.log # Installation progress
ls -la /run/virtiofs-mnt-hoststorage/ # Verify host storage access
podman images --storage-driver overlay --storage-opt additionalimagestore=/run/virtiofs-mnt-hoststoragesudo dnf install virtiofsdExtract kickstart from ISO:
isoinfo -i anaconda.iso -x /KICKSTART.KS\;1 > current.ksList ISO contents:
osirrox -indev anaconda.iso -find / 2>/dev/null | lessmemory-backend-memfdwithshare=on(required for virtiofs)--cache neverprevents fd exhaustion--sandbox nonefor container compatibility- Queue size: 1024
- Uses
io.systemd.credential.binary:systemd.extra-unit.*via SMBIOS - Unit runs in initramfs (no
ConditionPathExists=!/etc/initrd-release) - Streams logs continuously during installation
- Runs virtiofsd in the user namespace where you appear as root
- Same namespace as rootless podman containers
- Can read ostree objects with
---s--x--xpermissions via DAC_READ_SEARCH capability - No actual root privileges required