{"record":{"id":"2e52baada9991dee","repo":"lima-vm/lima","slug":"unsupported-image-type-for-s-q-s-does-not-nat","errorCode":null,"errorMessage":"unsupported image type for %s: %q. %s does not natively support importing SquashFS images; please convert the image to a tar archive before importing","messagePattern":"unsupported image type for (.+?): %q\\. (.+?) does not natively support importing SquashFS images; please convert the image to a tar archive before importing","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/driver/wsl2/wsl_driver_windows.go","lineNumber":140,"sourceCode":"\n\tif cfg.VMType != nil {\n\t\tif cfg.Images != nil && cfg.Arch != nil {\n\t\t\t// TODO: real filetype checks\n\t\t\ttarFileRegex := regexp.MustCompile(`\\.(tar|tgz|txz|tbz2|tzst|tar\\.(gz|xz|bz2|zstd|zst))$`)\n\t\t\tunsupportedVMImgRegex := regexp.MustCompile(`\\.(qcow2|raw|img|iso|ipsw)(\\.(gz|xz|bz2|zstd|zst))?$`)\n\t\t\tsquashfsRegex := regexp.MustCompile(`\\.squashfs(\\.(gz|xz|bz2|zstd|zst))?$`)\n\t\t\tfor i, image := range cfg.Images {\n\t\t\t\tif unknown := reflectutil.UnknownNonEmptyFields(image, \"File\", \"Variant\", \"ArchVariant\"); len(unknown) > 0 {\n\t\t\t\t\tlogrus.Warnf(\"Ignoring: vmType %s: images[%d]: %+v\", *cfg.VMType, i, unknown)\n\t\t\t\t}\n\t\t\t\tif image.Arch == *cfg.Arch {\n\t\t\t\t\tlocation := image.Location\n\t\t\t\t\tif !tarFileRegex.MatchString(location) {\n\t\t\t\t\t\tif unsupportedVMImgRegex.MatchString(location) {\n\t\t\t\t\t\t\treturn fmt.Errorf(\"unsupported image type for %s: %q. %s only supports importing tar archive root filesystems, not standard VM disk images\", *cfg.VMType, location, *cfg.VMType)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif squashfsRegex.MatchString(location) {\n\t\t\t\t\t\t\treturn fmt.Errorf(\"unsupported image type for %s: %q. %s does not natively support importing SquashFS images; please convert the image to a tar archive before importing\", *cfg.VMType, location, *cfg.VMType)\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn fmt.Errorf(\"unsupported image type for %s: %q. A tar archive root filesystem (.tar, .tar.gz, .tar.xz, etc.) is required\", *cfg.VMType, location)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif cfg.Mounts != nil {\n\t\t\tfor i, mount := range cfg.Mounts {\n\t\t\t\tif unknown := reflectutil.UnknownNonEmptyFields(mount); len(unknown) > 0 {\n\t\t\t\t\tlogrus.Warnf(\"Ignoring: vmType %s: mounts[%d]: %+v\", *cfg.VMType, i, unknown)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif cfg.Networks != nil {\n\t\t\tfor i, network := range cfg.Networks {\n\t\t\t\tif unknown := reflectutil.UnknownNonEmptyFields(network); len(unknown) > 0 {","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/pkg/driver/wsl2/wsl_driver_windows.go#L122-L158","documentation":"WSL2 cannot import SquashFS images directly; the rootfs must be provided as a tar archive. When the image location matches the squashfsRegex but not the tar regex, validateConfig returns this error advising conversion to tar.","triggerScenarios":"An images[] entry for the matching arch with a .squashfs (or similar) location while vmType is wsl2; hit during Configure/Validate.","commonSituations":"Using images designed for live-ISO/immutable distros (Fedora/Centrum-style squashfs root images), or pointing at a distro's squashfs artifact from a mirror.","solutions":["Convert the SquashFS image to a tar archive (unsquashfs then tar the extracted rootfs)","Download a tar-format rootfs for the distro instead","Switch vmType to a driver that accepts SquashFS images"],"exampleFix":"# before\nimages:\n  - location: https://example.org/distro/rootfs.squashfs\n# after\n# convert: unsquashfs rootfs.squashfs && tar -C squashfs-root -czf rootfs.tar.gz .\nimages:\n  - location: ./rootfs.tar.gz","handlingStrategy":"validation","validationCode":"var sqfsRe = regexp.MustCompile(`\\.squashfs$`)\nfunc hasSquashfsImage(cfg *limatype.LimaYAML) bool {\n\tif cfg.Images == nil { return false }\n\tfor _, img := range cfg.Images {\n\t\tif sqfsRe.MatchString(img.Location) { return true }\n\t}\n\treturn false\n}\n// convert to tar before Configure","typeGuard":"func isSquashfs(location string) bool {\n\treturn strings.HasSuffix(location, \".squashfs\")\n}","tryCatchPattern":"if err := driver.Configure(ctx, cfg); err != nil {\n\tif strings.Contains(err.Error(), \"SquashFS\") {\n\t\t// convert: unsquashfs + tar, update location, retry\n\t}\n\treturn err\n}","preventionTips":["Prefer tar rootfs artifacts when building distro images","Add a template check rejecting .squashfs locations for wsl2","Document conversion steps (unsquashfs + tar) for users"],"tags":["wsl2","squashfs","image-format"],"backgroundTag":"unsupported-image-format","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}