lima
lima copied to clipboard
generate qemu vm uuid
Background
Some application may requires the product_uuid from sysfs, OR it will be broken, eg.
- https://github.com/nestybox/sysbox/issues/439
- https://bugs.launchpad.net/ubuntu/+source/qemu-kvm/+bug/959308
The patch will generate a UUID, based of the MD5 sum of the VM name, and append as qemu --uuid parameter.
It should be safe and no impact to others usecase.
Thanks, but please sign the commit for DCO https://github.com/apps/dco
(run git commit -a -s --amend, and make sure that the Signed-off-by: NAME <EMAIL> line with your real name is included in the commit message)
To have a globally unique, but persistent (accross VM restarts) id we include both the machine id and the full path to the VM directory:
https://github.com/lima-vm/lima/blob/3aca16d2a762fdb1ba9f50d6749cb03240d0a963/pkg/limayaml/defaults.go#L44
The instance name alone isn't even locally unique because you can have multiple LIMA_HOME settings on the same machine.
I would suggest to extract the sha function from limayaml.MACAddress into a separate function and also use it as input for the qemu UUID. The uniqueID passed into the function is the instance directory.
@dictcp Hi, are you still working on this PR? I need it too.
@junnplus Feel free to open a new PR to carry this (if you would like to)