-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: podman.exe machine init fails on Windows Server 2022 w/ UPD #17209
Comments
This is interesting topic. Especially because May be there is a valid reason to use ssh-keygen only inside VM. |
Hi,
|
And if the SSH client feature of Windows is not used, then there is an option to install "Beta" (don't know why they call it this way) https://github.com/PowerShell/Win32-OpenSSH/releases/tag/v9.1.0.0p1-Beta OpenSSH client into Program files folder. This could be just listed as prerequisite to have on of these options installed on your host. |
Probably we still have to wait for the opinions of the team representative what was the reason to choose inside VM app to generate keys. |
Additional notes, if this change is accepted, then we can share key generation part between WSL and QEMU backends. |
The reason ssh-keygen.exe was not used is just that not all variants and versions of Windows had it available and working. We can workaround the issue by generating locally and copying it or piping it out of WSL. @userid0x0 Thanks for sharing. Your workaround makes sense. I updated the title since this issue should only affect systems with RDS setup and they have enabled UPD. |
Does this mean that Thinking now what would be the best way to handle potentially missing ssh-keygen for QEMU machine on Windows, but this is for the later time. |
@n1hility Thanks for taking care. I had to look up what RDS and UPD means - I am not the administrator of the machine nor I am an expert of Windows Server. If you want me to test something, let me know. |
A friendly reminder that this issue had no activity for 30 days. |
@n1hility This is in your hands now, as far as I can tell. |
A friendly reminder that this issue had no activity for 30 days. |
Issue Description
Hi,
I tried to use podman for Windows 4.3.1 on Windows Server 2022. Unfortunately the
podman.exe machine init
fails with an error messageI managed to isolate the rootcause for the problem already. The
machine init
fails when creating and storing the SSH private+public keypodman/pkg/machine/wsl/machine.go
Line 392 in ce504bb
podman/pkg/machine/wsl/machine.go
Line 524 in ce504bb
podman/pkg/machine/wsl/machine.go
Line 916 in ce504bb
podman/pkg/machine/keys.go
Line 36 in ce504bb
podman/pkg/machine/keys.go
Line 77 in ce504bb
As far as I can say the implementation expects that if the command
wsl
is invoked on Windows side the Linux shell is in the same working directory (e.g./mnt/c/Users/???/.ssh
) as Windows. This fails for Windows Server 2022 as the User folders are directory junctions (kind of bind mounted.vhdx
volumes) and are inaccessible from WSL side.With other words the SSH keys don't get placed in
C:\Users\???\.ssh
whilepodman machine init
as the working directoryC:\Users\???\.ssh
is not accessible from WSL side.WORKAROUND
I checked the implementation and noticed that the SSH keys don't get generated IF they already exist. Thus I did
ssh-keygen -N -t ed25519 -f podman-machine-default
on a separate Linux machinepodman-machine-default
private keypodman-machine-default.pub
public key toC:\Users\???\.ssh
on Windows Server 2022podman.exe machine init
- this time it succeedsMay be you can do the private/public key exchange from WSL -> Windows not using the working directory approach but using an PIPE as you do with all the other files
podman machine init
creates within the WSL.Steps to reproduce the issue
Steps to reproduce the issue
cmd
viewpodman.exe machine init
Describe the results you received
Describe the results you expected
I expect
podman machine init
to succeed.podman info output
Podman in a container
No
Privileged Or Rootless
None
Upstream Latest Release
Yes
Additional environment details
Additional environment details
Additional information
This ticket belongs to the discussion I recently started #17194 .
The text was updated successfully, but these errors were encountered: