{"record":{"id":"dd284b0ca7e46d6c","repo":"lima-vm/lima","slug":"driver-q-w","errorCode":null,"errorMessage":"driver %q: %w","messagePattern":"driver %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/hostagent/hostagent.go","lineNumber":551,"sourceCode":"\tif closeErr := a.close(); closeErr != nil {\n\t\tlogrus.WithError(closeErr).Warn(\"an error during shutting down the host agent\")\n\t}\n\tcancelHA()\n\tstopErr := a.driver.Stop(ctx)\n\t// Stop the external driver gRPC server now that the instance is shutting down.\n\tserver.Stop(a.instDir, false)\n\treturn stopErr\n}\n\nfunc (a *HostAgent) Screenshot(ctx context.Context, format string) ([]byte, error) {\n\t// ConfiguredDriver wraps the concrete driver; unwrap to reach optional interfaces.\n\tinner := a.driver\n\tif cd, ok := a.driver.(*driver.ConfiguredDriver); ok {\n\t\tinner = cd.Driver\n\t}\n\ts, ok := inner.(driver.Screenshotter)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"driver %q: %w\", a.driver.Info(ctx).Name, driver.ErrDriverNotScreenshotter)\n\t}\n\treturn s.CaptureScreenshot(format)\n}\n\nfunc (a *HostAgent) Info(_ context.Context) (*hostagentapi.Info, error) {\n\tinfo := &hostagentapi.Info{\n\t\tAutoStartedIdentifier: autostart.AutoStartedIdentifier(),\n\t\tSSHLocalPort:          a.sshLocalPort,\n\t}\n\treturn info, nil\n}\n\nfunc (a *HostAgent) sshAddressPort() (sshAddress string, sshPort int) {\n\tsshAddress = a.instSSHAddress\n\tsshPort = a.sshLocalPort\n\treturn sshAddress, sshPort\n}\n","sourceCodeStart":533,"sourceCodeEnd":569,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/pkg/hostagent/hostagent.go#L533-L569","documentation":"HostAgent.Screenshot requires the active driver to implement the driver.Screenshotter interface (CaptureScreenshot). If the underlying driver (after unwrapping ConfiguredDriver) does not support screenshots, this error wrapping ErrDriverNotScreenshotter is returned naming the driver.","triggerScenarios":"Calling 'limactl screenshot <instance>' (or the Screenshot API) on an instance whose vmType/driver has no screenshot capability — e.g. a driver backend that has not implemented CaptureScreenshot.","commonSituations":"Requesting a screenshot on wsl2 or other backends lacking screenshot support; running limactl screenshot against an instance on a platform where only qemu/vz implement it; driver feature mismatch after switching vmType.","solutions":["Use a backend that supports screenshots (qemu or vz on macOS) if you need limactl screenshot","Check Lima release notes / driver docs for which vmType implements Screenshotter","Use an alternative screen-capture route for the VM (e.g. VNC/display forwarding) when your driver lacks support"],"exampleFix":"// before (lima.yaml)\nvmType: \"wsl2\"   # no screenshot support\n// after\nvmType: \"qemu\"","handlingStrategy":"type-guard","validationCode":"// before calling screenshot, check driver support\ndrv := a.driver\nif cd, ok := drv.(*driver.ConfiguredDriver); ok { drv = cd.Driver }\nif _, ok := drv.(driver.Screenshotter); !ok {\n\treturn fmt.Errorf(\"screenshots unsupported for vmType %q\", inst.Config.VMType)\n}","typeGuard":"func supportsScreenshot(d driver.Driver) bool {\n\t_, ok := d.(driver.Screenshotter)\n\treturn ok\n}","tryCatchPattern":"img, err := ha.Screenshot(ctx, format)\nif errors.Is(err, driver.ErrDriverNotScreenshotter) {\n\treturn nil, fmt.Errorf(\"use qemu/vz for screenshots: %w\", err)\n}","preventionTips":["Check driver feature matrices before relying on screenshot functionality","Use qemu or vz (macOS) vmType when screenshots are required","Wrap capability-dependent features in interface type-guards","Handle ErrDriverNotScreenshotter explicitly in tooling UIs"],"tags":["driver","screenshot","unsupported-feature"],"backgroundTag":"driver-capability-not-supported","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}