{"record":{"id":"5aa236b51657976e","repo":"lima-vm/lima","slug":"disk-format-q-not-supported-use-qcow2-or-raw","errorCode":null,"errorMessage":"disk format %#q not supported, use `qcow2` or `raw` instead","messagePattern":"disk format %#q not supported, use `qcow2` or `raw` instead","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/limactl/disk.go","lineNumber":94,"sourceCode":"\tsize, err := cmd.Flags().GetString(\"size\")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tformat, err := cmd.Flags().GetString(\"format\")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdiskSize, err := units.RAMInBytes(size)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tswitch format {\n\tcase \"qcow2\", \"raw\":\n\tdefault:\n\t\treturn fmt.Errorf(\"disk format %#q not supported, use `qcow2` or `raw` instead\", format)\n\t}\n\n\t// only exactly one arg is allowed\n\tname := args[0]\n\n\tdiskDir, err := store.DiskDir(name)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif _, err := os.Stat(diskDir); !errors.Is(err, fs.ErrNotExist) {\n\t\treturn fmt.Errorf(\"disk %#q already exists (%#q)\", name, diskDir)\n\t}\n\n\tlogrus.Infof(\"Creating %s disk %#q with size %s\", format, name, units.BytesSize(float64(diskSize)))\n\n\tif err := os.MkdirAll(diskDir, 0o700); err != nil {\n\t\treturn err","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/cmd/limactl/disk.go#L76-L112","documentation":"`limactl disk create` was given a --format value other than qcow2 or raw. Lima disks only support these two formats, and diskCreateAction validates the format before touching the store. This is a plain argument-validation error.","triggerScenarios":"`limactl disk create <name> --format <x>` where <x> is anything else (e.g. vmdk, vdi, qcow, RAW with different case).","commonSituations":"Copy-pasting formats from other VM tools (VirtualBox/VMware); assuming case-insensitivity; typos like qcow.","solutions":["Pass --format qcow2 (default) or --format raw","Fix casing: the switch matches exactly \"qcow2\" and \"raw\"","Drop the flag entirely to use the default qcow2 format"],"exampleFix":"// before\n$ limactl disk create data --format vmdk\n// after\n$ limactl disk create data --format qcow2","handlingStrategy":"validation","validationCode":"const SUPPORTED = ['qcow2', 'raw']\nif (!SUPPORTED.includes(format)) {\n  throw new Error(`format ${format} unsupported; use qcow2 or raw`)\n}","typeGuard":"function isSupportedFormat(f: string): f is 'qcow2' | 'raw' {\n  return f === 'qcow2' || f === 'raw'\n}","tryCatchPattern":"try {\n  await createDisk(name, { format, size })\n} catch (err) {\n  if (/not supported/.test(err.message)) {\n    await createDisk(name, { format: 'qcow2', size })\n  } else throw err\n}","preventionTips":["Only pass --format qcow2 or raw; omit the flag for the default","Never copy format names from VirtualBox/VMware tooling","Lowercase the format value before passing it"],"tags":["disk","validation","cli"],"backgroundTag":"unsupported-disk-format","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}