{"record":{"id":"5040879c0c55d1a1","repo":"lima-vm/lima","slug":"base-disk-q-must-not-have-multiple-children","errorCode":null,"errorMessage":"base disk (%#q) must not have multiple children: %+v","messagePattern":"base disk \\(%#q\\) must not have multiple children: %\\+v","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/qemuimgutil/qemuimgutil.go","lineNumber":292,"sourceCode":"\t\tlogrus.WithField(\"filename\", info.Filename).\n\t\t\tWarnf(\"Unsupported image format %#q. The image may not boot, or may have an extra privilege to access the host filesystem. Use with caution.\", info.Format)\n\t}\n\tif err := rejectExternalFileReferences(info); err != nil {\n\t\treturn err\n\t}\n\t// info.Children is set since QEMU 8.0\n\tswitch len(info.Children) {\n\tcase 0:\n\t// NOP\n\tcase 1:\n\t\tif info.Filename != info.Children[0].Info.Filename {\n\t\t\treturn fmt.Errorf(\"base disk (%#q) child must not have a different filename (%#q)\", info.Filename, info.Children[0].Info.Filename)\n\t\t}\n\t\tif len(info.Children[0].Info.Children) > 0 {\n\t\t\treturn fmt.Errorf(\"base disk (%#q) child must not have children of its own\", info.Filename)\n\t\t}\n\tdefault:\n\t\treturn fmt.Errorf(\"base disk (%#q) must not have multiple children: %+v\", info.Filename, info.Children)\n\t}\n\treturn nil\n}\n","sourceCodeStart":274,"sourceCodeEnd":296,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/pkg/qemuimgutil/qemuimgutil.go#L274-L296","documentation":"AcceptableAsBaseDisk rejects base disks that report more than one child in `qemu-img info` output (Children populated since QEMU 8.0). Multiple children means the image has several attached references — e.g. multiple VMDK extents whose filenames differ, or an image opened with multiple links — which Lima cannot verify as self-contained, so it fails closed rather than allow untrusted external file references into the guest disk.","triggerScenarios":"Calling AcceptableAsBaseDisk (via EnsureDisk) on an image whose qemu-img info JSON contains 2+ entries in info.Children — e.g. a streamOptimized/split VMDK with multiple external extent files, or any format exposing multiple child nodes.","commonSituations":"Importing a split VMDK (multiple -s001.vmdk extent files) converted only partially to qcow2; using an image produced by a hypervisor export that kept multi-file layout; inspecting an image with QEMU 8.0+ where the multi-child structure becomes visible.","solutions":["Convert the image to a single-file qcow2: `qemu-img convert -O qcow2 image.vmdk image.qcow2`, ensuring all extents are in one directory or embedded during conversion.","If the source is a split VMDK, re-download/re-export it as a monolithic (single-file) VMDK or directly as qcow2/raw, then retry.","Verify with `qemu-img info image.qcow2` that children/backing files are gone before using it as a base disk."],"exampleFix":"// before: split VMDK (disk-s001.vmdk, disk-s002.vmdk, ...) used as base disk\n// after\n//   qemu-img convert -O qcow2 disk.vmdk disk.qcow2   # monolithic conversion\n//   # qemu-img info disk.qcow2 -> no children, single self-contained file","handlingStrategy":"validation","validationCode":"// Before use, confirm the image is single-file:\n// qemu-img info --output=json image.vmdk | jq '.children | length <= 1'\n// For VMDK sources, prefer monolithic export or convert first:\n// qemu-img convert -O qcow2 image.vmdk image.qcow2","typeGuard":"func singleChildMax(info Info) bool {\n\treturn len(info.Children) <= 1\n}","tryCatchPattern":null,"preventionTips":["Convert multi-file formats (split/monolithic VMDK with extents, VDI exports) to single-file qcow2 before use.","Keep source image and any extent files together (or embed them) if conversion is not done immediately.","Add a CI check that runs `qemu-img info` on shipped images and fails if children/backing files are present."],"tags":["qemu","disk-image","vmdk","security","validation"],"backgroundTag":"backing-file-image-rejected","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}