{"record":{"id":"f74777476b9b216a","repo":"lima-vm/lima","slug":"failed-to-create-new-virtio-block-device-config-fo","errorCode":null,"errorMessage":"failed to create new virtio block device config for extra disk %#q: %w","messagePattern":"failed to create new virtio block device config for extra disk %#q: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/driver/vz/vm_darwin.go","lineNumber":608,"sourceCode":"\n\t\tlogrus.Infof(\"Mounting disk %#q on %#q\", diskName, disk.MountPoint)\n\t\tif err = disk.LockForInstance(inst.Dir); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to attach disk %#q: %w\", diskName, err)\n\t\t}\n\t\textraDiskPath := filepath.Join(disk.Dir, filenames.DataDisk)\n\t\t// ConvertToRaw is a NOP if no conversion is needed\n\t\tlogrus.Debugf(\"Converting extra disk %#q to a raw disk (if it is not a raw)\", extraDiskPath)\n\n\t\tif err = diskUtil.Convert(ctx, raw.Type, extraDiskPath, extraDiskPath, nil, true); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to convert extra disk %#q to a raw disk: %w\", extraDiskPath, err)\n\t\t}\n\t\textraDiskPathAttachment, err := vz.NewDiskImageStorageDeviceAttachmentWithCacheAndSync(extraDiskPath, false, diskImageCachingMode, vz.DiskImageSynchronizationModeFsync)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to create disk attachment for extra disk %#q: %w\", extraDiskPath, err)\n\t\t}\n\t\textraDisk, err := vz.NewVirtioBlockDeviceConfiguration(extraDiskPathAttachment)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to create new virtio block device config for extra disk %#q: %w\", extraDiskPath, err)\n\t\t}\n\t\tconfigurations = append(configurations, extraDisk)\n\t}\n\n\tif err := validateDiskFormat(ciDataPath); err != nil {\n\t\treturn err\n\t}\n\tciDataAttachment, err := vz.NewDiskImageStorageDeviceAttachment(ciDataPath, true)\n\tif err != nil {\n\t\treturn err\n\t}\n\tciData, err := vz.NewVirtioBlockDeviceConfiguration(ciDataAttachment)\n\tif err != nil {\n\t\treturn err\n\t}\n\tconfigurations = append(configurations, ciData)\n\n\tvmConfig.SetStorageDevicesVirtualMachineConfiguration(configurations)","sourceCodeStart":590,"sourceCodeEnd":626,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/pkg/driver/vz/vm_darwin.go#L590-L626","documentation":"Creating the virtio-block device configuration wrapping the disk attachment via vz.NewVirtioBlockDeviceConfiguration failed; Lima wraps the framework error. This is the last VM-configuration step for the extra disk, so the attachment object was created but the device config could not be built.","triggerScenarios":"vz.NewVirtioBlockDeviceConfiguration(extraDiskPathAttachment) returns an error immediately after a successful attachment creation — essentially only framework-internal failures or invalid attachment state.","commonSituations":"macOS Virtualization framework version quirks; resource/configuration limits in the VM config reached; rare framework bugs on beta macOS versions.","solutions":["Retry after updating macOS and Lima to the latest versions","Reduce the number of attached disks/devices in the VM configuration","Report with the wrapped underlying error if it persists on a supported macOS version"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := startInstance(cfg); err != nil {\n    if strings.Contains(err.Error(), \"virtio block device config\") {\n        // retry once after updating macOS/Lima; report the wrapped cause if persistent\n    }\n}","preventionTips":["Track macOS beta/Virtualization framework regressions before upgrading","Limit the number of attached virtio devices","Capture the full wrapped error chain when filing issues"],"tags":["vz-driver","virtio","virtualization-framework"],"backgroundTag":"virtio-device-config-failed","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}