-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
Summary
Replace systemd with a minimal init system to reduce guest boot time by 3-5 seconds.
Problem
Current guest image uses systemd as init system:
- systemd has inherent startup overhead
- Even with services stripped, systemd does dependency resolution
- journald, udev stubs, and other subsystems still initialize
- Estimated overhead: 3-5 seconds
Proposed Solution
Replace systemd with a minimal init script that only:
- Sets up network interface (already configured via kernel args)
- Starts SSH daemon
- (Optional) Starts vsock agent
Target Boot Sequence
kernel boot → minimal init → sshd ready
vs current:
kernel boot → systemd → service resolution → sshd ready
Technical Approach
Option A: Custom Shell Init
#!/bin/sh
# /sbin/init
mount -t proc proc /proc
mount -t sysfs sys /sys
mount -t devtmpfs dev /dev
# Network already configured via kernel ip= parameter
/usr/sbin/sshd -D &
# Keep init running
exec /bin/shOption B: Busybox Init
Use busybox init with minimal inittab.
Option C: tini/dumb-init
Minimal init designed for containers, adapted for VM.
Key Files
turbo/scripts/deploy-runner/Dockerfile- Replace systemdturbo/scripts/deploy-runner/build-rootfs.sh- Update verification
Expected Impact
- Time saved: ~3-5 seconds per VM startup
- Image size: Smaller (no systemd packages)
Trade-offs
| Aspect | systemd | Minimal Init |
|---|---|---|
| Boot time | Slower | Faster |
| Service management | Full | Manual |
| Debugging | journalctl | Manual logs |
| Maintenance | Familiar | Custom |
Considerations
- Lose systemd service management
- Need custom scripts for any additional services
- Less debugging tooling available
- Consider keeping systemd as fallback option
Alternative: Alpine Linux
Could also consider Alpine Linux base image which uses OpenRC (lighter than systemd) and has much smaller footprint (~100MB vs 2GB).
Metadata
Metadata
Assignees
Labels
No labels