Closed tmoschou closed 5 months ago
Not fully covered, but partially related to https://github.com/containers/podman/issues/16710
May be it will be possible to design a solution, which fixes both.
A friendly reminder that this issue had no activity for 30 days.
Documented my vision on how this (together with another issue) could be fixed in this comment: https://github.com/containers/podman/issues/16710#issuecomment-1475263567
A friendly reminder that this issue had no activity for 30 days.
I can confirm that this is still an issue with Podman Desktop 1.4.0 (Podman 4.6.2).
The fix for me was to run podman machine rm
first, which will delete the conflicting files:
The following files will be deleted:
~/.ssh/podman-machine-default
~/.ssh/podman-machine-default.pub
~/.config/containers/podman/machine/qemu/podman-machine-default.ign
~/.local/share/containers/podman/machine/qemu/podman-machine-default_fedora-coreos-38.20231002.2.2-qemu.aarch64.qcow2
~/.local/share/containers/podman/machine/qemu/podman.sock
~/.local/share/containers/podman/machine/qemu/podman-machine-default_ovmf_vars.fd
~/.config/containers/podman/machine/qemu/podman-machine-default.json
Then podman machine init
will work and recreate those files.
I did some work on this. I can revisit the topic, when I receive feedback from the Podman development team in https://github.com/containers/podman/pull/18487
I think this was fixed in 5.0 as we no longer use .ssh to write the key there
Issue Description
On MacOS M1, creating a QEMU machine with
podman machine init <name>
will fail if user generated key~/.ssh/<name>
already exists.Although the default name is fairly specific (
podman-machine-default
) and unlikely to clash with other keys, others may not be (E.g.test
).Podman should not be creating keys in
~/.ssh/*
anyway but should be saving them in its config directory~/.config/containers/podman/...
as users should be usingpodman machine ssh <name>
to ssh into the box and not invokingssh
command directly.For comparison, minikube when using the qemu driver, writes SSH keys to
~/.minikube/machines/<name>/id_rsa{,.pub}
. Vagrant also does something similar if I recall.Ideally all per-machine configuration and data (json config, ignition file) should be written to a folder with the name of the machine, i.e.
but I note this is not currently the case (for qemu VMs at least) using a mixture of both prefix naming and directory naming.
Is this a problem if
<name>
isqemu
?Also note that deleting the machine doesn't actually delete the
~/.local/share/containers/podman/machine/<name>
directory.Steps to reproduce the issue
Steps to reproduce the issue
ssh-keygen -N "" -t ed25519 -C 'Manually created' -f ~/.ssh/test
podman machine init test
Describe the results you received
Describe the results you expected
Machine created successfully. And ssh key generation does not pollute
~/.ssh
folderpodman info output