lima-vm/lima · error
vz: CanRequestStop is not supported
Error message
vz: CanRequestStop is not supported
What it means
After the 30-second stop wait loop, the VZ driver falls through to this terminal error: it could not confirm the VM stopped and the VZ machine does not expose CanRequestStop support, so the driver has no remaining mechanism to stop the VM. Reaching this line means the normal stop/await paths both failed.
Source
Thrown at pkg/driver/vz/vz_driver_darwin.go:538
// Most Linux machines shutdown within 5 seconds, but macOS machines can take longer.
timeout := time.After(30 * time.Second)
ticker := time.NewTicker(500 * time.Millisecond)
for {
select {
case <-timeout:
return errors.New("vz timeout while waiting for stop status")
case <-ticker.C:
l.machine.mu.Lock()
stopped := l.machine.stopped
l.machine.mu.Unlock()
if stopped {
return nil
}
}
}
}
return errors.New("vz: CanRequestStop is not supported")
}
func (l *LimaVzDriver) GuestAgentConn(_ context.Context) (net.Conn, string, error) {
for _, socket := range l.machine.SocketDevices() {
connect, err := socket.Connect(uint32(l.vSockPort))
return connect, "vsock", err
}
return nil, "", errors.New("unable to connect to guest agent via vsock port 2222")
}
func (l *LimaVzDriver) Info(_ context.Context) driver.Info {
var info driver.Info
info.Name = "vz"
info.VsockPort = l.vSockPort
info.VirtioPort = l.virtioPort
if l.Instance != nil {View on GitHub (pinned to dd909d0973)
Solutions
- Force-stop: `limactl stop --force <instance>` which bypasses the graceful path
- Verify with `limactl list` whether the instance still reports Running; kill leftover VM processes if orphaned
- Restart the host's Virtualization.framework usage by quitting any VM-consuming processes, then retry stop
- Upgrade macOS/Lima — CanRequestStop support depends on Virtualization.framework capabilities
- If reproducible, file an issue; reaching this line usually indicates the machine object was not properly initialized
Example fix
// before
err := driver.Stop(ctx) // "vz: CanRequestStop is not supported"
// after
if err := driver.Stop(ctx); err != nil {
// hard kill path
driver.Stop(ctx /* force */)
} Defensive patterns
Strategy: fallback
Validate before calling
// detect state before stop
st, _ := limactlListState(inst)
if st != "Running" { return nil } // nothing to stop Try / catch
if err := driver.Stop(ctx); err != nil {
if strings.Contains(err.Error(), "CanRequestStop") {
return forceStop(ctx) // hard-kill fallback
}
return err
} Prevention
- Never ignore a prior failed stop; resolve state before re-attempting
- Run on macOS versions where VZ stop callbacks are supported
- Recreate broken instances instead of repeatedly stopping them
- Monitor limactl list for stuck Running state
When it happens
Trigger: Stop() is called and neither the graceful shutdown check nor the stopped-flag polling succeeded, and the underlying VZ virtual machine object does not implement/support the CanRequestStop path (or the machine is in a state where none of the stop branches returned).
Common situations: Guest never actually powered off after `shutdown -h now`; VZ machine in a weird state after a failed start; older macOS/VZ where CanRequestStop is unavailable; a bug where the machine object's stop support was never wired up.
Related errors
- failed to run %v: %w (output=%s)
- vz timeout while waiting for stop status
- failed to get macOS product version: %w
- failed to create a new rosetta directory share caching optio
- vz driver state stopped
AI-assisted analysis of lima-vm/lima@dd909d0973 (2026-09-01).
Data as JSON: /api/errors/1a6307e336ab8441.
Report an issue: GitHub.