lima-vm / lima-vm/lima

limactl depends on qemu or qemu-img, but lima brew package does not depend on qemu

Open
#3,169 7 comments 0 reactions 0 assignees View on GitHub
area/cli area/homebrew component/qemu
Dominant language
Go
Stars
21.9k
Forks
957
Avg merge
2d 6h
Merged PRs (30d)
53

Description

### Description

When installing lima via brew, qemu is not installed.

`limactl start` works with vz and create the root disk without qemu-img, but creating a vm with additional disks will fail when creating the disk:

```
% limactl disk create mydisk --size 10g
INFO[0000] Creating qcow2 disk "mydisk" with size 10GiB
FATA[0000] failed to create qcow2 disk in "/Users/nsoffer/.lima/_disks/mydisk": failed to run [qemu-img create -f qcow2 /Users/nsoffer/.lima/_disks/mydisk/datadisk 10737418240]: "": exec: "qemu-img": executable file not found in $PATH
```

This failure could be avoided if we remove the unneeded dependency on qemu-img (#2853), but we still depend on qemu-img to create qcow2 disks. We also depend on qemu for the limactl snapshot command.

If we have a dependency we should depend on the package we depend on for best user experience.

If we want to introduce a soft dependency, that we can work with or without, we need to change the code so qcow2 format and qemu vmType are available only if qemu-img is available. The online help can recommend installing additional packages.

Possible fixes:
- require qemu in lima brew package
- change the code to make qemu-img optional
- make default disk format "raw"
- support qcow2 disks only if qemu-img is available
- support snapshots for qemu vms only if qemu is installed
- fail validation or warn of vmType: qemu if qemu is not installed

Related issues:
- #3168 (dup of this)
- #2853

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.