Docker remains stopped after persistent data-disk provisioning during headless boot
I originally reported this as a follow-up comment on Lima PR #5489 while testing headless autostart. After isolating the behavior further, this appears to be a Colima persistent data-disk provisioning issue, so I am opening it here for proper tracking.
Environment
- 2018 Intel Mac mini (Macmini8,1)
- Intel x86_64
- macOS Sequoia 15.7.9
- Colima 0.10.3
- Docker runtime
- Lima VM started headlessly by a LaunchDaemon
- Dedicated service user:
containerserver
The Lima LIMA_HOME autostart problem was handled separately by lima-vm/lima#5489.
After that problem was resolved, Lima successfully started the Colima VM at boot, but Docker and restart-policy containers still did not become available until the first Docker API access.
Observed behavior
During a true headless boot:
- Lima starts the Colima VM successfully.
- Docker starts inside the VM.
- Colima persistent data-disk provisioning runs:
systemctl stop docker.servicesystemctl stop containerd.service
- Colima bind-mounts the persistent runtime directories.
- Provisioning completes without explicitly starting Docker again.
docker.serviceremains inactive/dead.docker.socketremains available.- The first Docker API access, such as
docker ps, socket-activates Docker. - Restart-policy containers then start.
Before the first Docker API access, a DokuWiki container with
restart: unless-stopped was not reachable on port 5555.
This means the Lima VM itself is awake and running, but the Docker service does not return automatically after Colima's persistent data-disk provisioning.
Source investigation
In the current Colima source, Docker's DataDisk() includes:
PreMount: []string{
"systemctl stop docker.service",
"systemctl stop containerd.service",
},
I did not find a corresponding post-mount start of docker.service.
The Lima disk-mount provisioning runs the PreMount commands and then performs the persistent bind mounts, but there was no post-mount stage to start Docker again.
Experimental fix tested
I added a generic PostMount field to DataDisk:
type DataDisk struct {
Dirs []DiskDir
PreMount []string
PostMount []string
FSType string
}
For the Docker data disk:
PostMount: []string{
"systemctl start docker.service",
},
I then extended the Lima disk provisioning in Colima to append the PostMount commands after all persistent bind mounts.
The resulting provisioning order is:
stop Docker/containerd
→ mount persistent runtime directories
→ start Docker
Test result
I built the modified Colima natively on the Intel Mac:
colima version v0.10.3-19-gc3a5f91
git commit: c3a5f9184d83a197184f897a9f07eb3c01b3bc88
The real headless containerserver Colima instance was regenerated with the modified binary.
The resulting lima.yaml contained:
script: systemctl start docker.service
after the persistent bind mounts.
I then tested:
normal reboot — PASS
reboot with no GUI login — PASS
SSH-initiated reboot — PASS
physical monitor disconnected — PASS
no docker ps or other Docker API wake-up — PASS
DokuWiki container on port 5555 returned automatically — PASS
This changed the behavior from:
VM running → Docker inactive until first Docker API access
to:
VM running → persistent mounts complete → Docker starts → restart-policy containers start automatically
Question
Would a generic PostMount stage on DataDisk be an appropriate way to handle this, or would the Colima maintainers prefer Docker to be restarted through a more Docker-specific mechanism after the persistent runtime directories are mounted?
I have kept the working local patch unchanged for further testing if useful.
Tested-by: CFBancroft — 2018 Intel Mac mini (x86_64)
Assisted-by: ChatGPT (GPT-5.6 Sol)Source: abiosoft/colima