{"record":{"id":"597bae63ae78a374","repo":"lima-vm/lima","slug":"unimplemented-597bae","errorCode":null,"errorMessage":"unimplemented","messagePattern":"unimplemented","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"pkg/driver/wsl2/errors_windows.go","lineNumber":10,"sourceCode":"//go:build windows && !no_wsl\n\n// SPDX-FileCopyrightText: Copyright The Lima Authors\n// SPDX-License-Identifier: Apache-2.0\n\npackage wsl2\n\nimport \"errors\"\n\nvar errUnimplemented = errors.New(\"unimplemented\")\n","sourceCodeStart":1,"sourceCodeEnd":11,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/pkg/driver/wsl2/errors_windows.go#L1-L11","documentation":"The WSL2 driver does not implement snapshot or display-connection operations. Callers of CreateSnapshot, ApplySnapshot, DeleteSnapshot, ListSnapshots, ChangeDisplayPassword, or DisplayConnection receive this sentinel error (errUnimplemented) unconditionally — the feature simply does not exist on the WSL2 backend.","triggerScenarios":"Calling any of the snapshot-related driver methods (CreateSnapshot, ApplySnapshot, DeleteSnapshot, ListSnapshots) or display methods (ChangeDisplayPassword, DisplayConnection) on an instance driven by the wsl2 driver on Windows.","commonSituations":"Scripts or tools written against the QEMU driver ported to Windows/WSL2; automation that snapshots VMs before changes; UI/tooling probing capabilities without checking the driver type first.","solutions":["Check driver type before calling: only the QEMU/VZ backends support these operations","Use WSL-native alternatives (export/import the distro: `wsl.exe --export/--import`) for snapshot-like backups","Skip display-password calls on WSL2 — there is no VNC-style display; use `wsl.exe` direct shell access","Guard feature probes by treating this error as 'not supported' rather than retrying"],"exampleFix":"// before\nerr := driver.CreateSnapshot(ctx, \"snap1\") // \"unimplemented\"\n// after\nif driverName == \"wsl2\" {\n    return errors.New(\"snapshots unsupported on wsl2; use wsl --export instead\")\n}\nerr := driver.CreateSnapshot(ctx, \"snap1\")","handlingStrategy":"validation","validationCode":"var snapshotCapable = map[string]bool{\"qemu\": true, \"vz\": true}\nfunc canSnapshot(driverName string) bool { return snapshotCapable[driverName] }","typeGuard":"func supportsSnapshots(driver driver.Driver) bool {\n    type snapper interface { CreateSnapshot(context.Context, string) error }\n    _, ok := driver.(snapper)\n    return ok\n}","tryCatchPattern":"if err := driver.CreateSnapshot(ctx, name); err != nil {\n    if errors.Is(err, errUnimplemented) || err.Error() == \"unimplemented\" {\n        return fallbackExportDistro(ctx) // wsl --export based backup\n    }\n    return err\n}","preventionTips":["Check the driver type (qemu/vz vs wsl2) before snapshot operations","Use `wsl --export/--import` as the WSL2 backup mechanism","Probe capabilities once at startup and store them","Treat 'unimplemented' as a permanent capability gap, not a transient error"],"tags":["wsl2","windows","unimplemented","snapshots"],"backgroundTag":"feature-not-implemented","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}