{"record":{"id":"71b6cbff93af5aaf","repo":"lima-vm/lima","slug":"field-vmopts-vz-diskimageformat-must-be-q-or","errorCode":null,"errorMessage":"field `vmOpts.vz.diskImageFormat` must be %#q or %#q, got %#q","messagePattern":"field `vmOpts\\.vz\\.diskImageFormat` must be %#q or %#q, got %#q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/driver/vz/vz_driver_darwin.go","lineNumber":356,"sourceCode":"\t}\n\n\tswitch videoDisplay := *cfg.Video.Display; videoDisplay {\n\tcase \"vz\", \"default\", \"none\":\n\tdefault:\n\t\tlogrus.Warnf(\"field `video.display` must be `vz`, `default`, or `none` for VZ driver , got %#q\", videoDisplay)\n\t}\n\tvar vzOpts limatype.VZOpts\n\tif err := limayaml.Convert(cfg.VMOpts[limatype.VZ], &vzOpts, \"vmOpts.vz\"); err != nil {\n\t\tlogrus.WithError(err).Warnf(\"Couldn't convert %#q\", cfg.VMOpts[limatype.VZ])\n\t}\n\tswitch *vzOpts.DiskImageFormat {\n\tcase raw.Type:\n\tcase asif.Type:\n\t\tif macOSProductVersion.LessThan(*semver.New(\"26.0.0\")) {\n\t\t\treturn fmt.Errorf(\"vmOpts.vz.diskImageFormat=%#q requires macOS 26 or higher to run, got %#q\", asif.Type, macOSProductVersion)\n\t\t}\n\tdefault:\n\t\treturn fmt.Errorf(\"field `vmOpts.vz.diskImageFormat` must be %#q or %#q, got %#q\", raw.Type, asif.Type, *vzOpts.DiskImageFormat)\n\t}\n\treturn nil\n}\n\nfunc (l *LimaVzDriver) Create(_ context.Context) error {\n\tidentifierFile := filepath.Join(l.Instance.Dir, filenames.VzIdentifier)\n\tif *l.Instance.Config.OS == limatype.DARWIN {\n\t\t_, err := getMacMachineIdentifier(identifierFile)\n\t\treturn err\n\t}\n\t_, err := getGenericMachineIdentifier(identifierFile)\n\treturn err\n}\n\nfunc (l *LimaVzDriver) CreateDisk(ctx context.Context) error {\n\tif *l.Instance.Config.OS == limatype.DARWIN {\n\t\tdisk := filepath.Join(l.Instance.Dir, filenames.Disk)\n\t\tif !osutil.FileExists(disk) {","sourceCodeStart":338,"sourceCodeEnd":374,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/pkg/driver/vz/vz_driver_darwin.go#L338-L374","documentation":"The `vmOpts.vz.diskImageFormat` field only accepts 'raw' or 'asif' for the VZ driver. validateConfig's switch falls through to the default case for any other value and returns this validation error quoting the accepted values and the offending one.","triggerScenarios":"Setting `vmOpts.vz.diskImageFormat` to a string other than 'raw' or 'asif' (e.g. 'qcow2', 'raw2', typo values) and starting/validating a VZ instance.","commonSituations":"Copying diskImageFormat settings from a QEMU template (qcow2 is QEMU-only); typos in the YAML; assuming VZ supports the same formats as QEMU.","solutions":["Change diskImageFormat to 'raw' (the default)","Change it to 'asif' if running macOS 26+ and ASIF is desired","Remove the `diskImageFormat` key entirely to accept the default"],"exampleFix":"# before\nvmOpts:\n  vz:\n    diskImageFormat: qcow2\n# after\nvmOpts:\n  vz:\n    diskImageFormat: raw","handlingStrategy":"validation","validationCode":"var vzOpts struct{ DiskImageFormat string `yaml:\"diskImageFormat\"` }\n_ = yaml.Unmarshal(cfg.VMOpts[\"vz\"], &vzOpts)\nif f := vzOpts.DiskImageFormat; f != \"\" && f != \"raw\" && f != \"asif\" {\n    // fix to \"raw\" or \"asif\" before starting\n}","typeGuard":"func validVZDiskFormat(f string) bool {\n    return f == \"\" || f == \"raw\" || f == \"asif\"\n}","tryCatchPattern":null,"preventionTips":["Only use 'raw' or 'asif' under vmOpts.vz","Do not reuse QEMU disk format names (qcow2, vhd) in VZ configs","Run `limactl validate` before starting"],"tags":["macos","vz","config-validation","disk-image"],"backgroundTag":"invalid-enum-value","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}