lima-vm/lima · info
timesync: not supported on this platform
Error message
timesync: not supported on this platform
What it means
The timesync package only implements SetSystemTime on platforms with the required clock-setting capability (e.g. Linux). On other platforms a sentinel error errNotSupported is returned, signaling the guestagent to skip time synchronization instead of failing.
Source
Thrown at pkg/guestagent/timesync/timesync_others.go:13
// SPDX-FileCopyrightText: Copyright The Lima Authors
// SPDX-License-Identifier: Apache-2.0
//go:build !linux
package timesync
import (
"errors"
"time"
)
var errNotSupported = errors.New("timesync: not supported on this platform")
func SetSystemTime(_ time.Time) error {
return errNotSupported
}
View on GitHub (pinned to dd909d0973)
Solutions
- Treat this as a no-op: callers should log and skip timesync on unsupported platforms.
- Use build-tag-specific code paths so timesync is only invoked where supported.
- If time sync is needed, implement a platform-specific SetSystemTime (e.g. via `date`/system APIs) in a new _GOOS file.
Example fix
// before: assuming success
caller.SetSystemTime(now)
// after: tolerate unsupported platforms
if err := timesync.SetSystemTime(now); err != nil && !errors.Is(err, timesync.ErrNotSupported) {
logrus.WithError(err).Warn("failed to set system time")
} Defensive patterns
Strategy: try-catch
Validate before calling
// gate timesync calls on build tags
//go:build linux
// timesync only invoked in linux-built paths; use runtime.GOOS at runtime otherwise
if runtime.GOOS != "linux" {
return // timesync unsupported
} Try / catch
if err := timesync.SetSystemTime(t); err != nil {
if errors.Is(err, errNotSupported) {
log.Debug("timesync unsupported on this platform; skipping")
return
}
log.WithError(err).Warn("failed to set system time")
} Prevention
- Use per-platform build tags so timesync is only called where supported.
- Check errors.Is(err, errNotSupported) and treat as an expected no-op.
- Don't alarm/retire the agent for this sentinel error.
- Add platform coverage to CI to catch accidental calls on unsupported GOOS.
When it happens
Trigger: SetSystemTime called on any build of pkg/guestagent/timesync/timesync_others.go (non-Linux GOOS) whenever the guestagent attempts a time sync.
Common situations: Running or developing the guestagent on macOS/BSD/Windows builds; CI compiling for multiple GOOS; a host clock drift handler invoking SetSystemTime on an unsupported guest OS.
Related errors
- unable to connect to guest agent via vsock port 2222
- failed to enable SSHD: %w
- failed to write password file for user %#q: %w
- failed to create .ssh directory for user %#q: %w
- failed to write authorized_keys file for user %#q: %w
AI-assisted analysis of lima-vm/lima@dd909d0973 (2026-09-01).
Data as JSON: /api/errors/1eff03d0f376ce13.
Report an issue: GitHub.