Skip to content
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

Podman 4.1 machine init fails when run in C:\Windows\System32 #14416

Closed
Stan-RED opened this issue May 30, 2022 · 4 comments · Fixed by #14570
Closed

Podman 4.1 machine init fails when run in C:\Windows\System32 #14416

Stan-RED opened this issue May 30, 2022 · 4 comments · Fixed by #14570
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@Stan-RED
Copy link

/kind bug

Description

Simple setup and machine initialization results in error and some warnings.

Steps to reproduce the issue:

  1. Download podman 4.1.0 MSI for Window.

  2. Execute "podman machine init" in command shell.

Describe the results you received:

Error: could not create ssh keys: exec: "C:\Users\stani\.ssh\wsl.exe": file does not exist

Looks like error is fatal, because none of other podman command are working with message "Cannot connect to Podman...".

Describe the results you expected:

Running podman machine.

Output of podman version:

Cannot connect to Podman. Please verify your connection to the Linux system using `podman system connection list`, or try `podman machine init` and `podman machine start` to manage a new Linux VM
Error: unable to connect to Podman. failed to create sshClient: failed to parse identity "C:\\Users\\stani\\.ssh\\podman-machine-default": open C:\Users\stani\.ssh\podman-machine-default: The system cannot find the file specified.

Output of podman info --debug:

Cannot connect to Podman. Please verify your connection to the Linux system using `podman system connection list`, or try `podman machine init` and `podman machine start` to manage a new Linux VM
Error: unable to connect to Podman. failed to create sshClient: failed to parse identity "C:\\Users\\stani\\.ssh\\podman-machine-default": open C:\Users\stani\.ssh\podman-machine-default: The system cannot find the file specified.

Package info (e.g. output of rpm -q podman or apt list podman):

PS C:\Windows\System32>  Get-CimInstance -ClassName Win32_Product -Filter "name like 'Podman%'"

Name             Caption                   Vendor                    Version                   IdentifyingNumber
----             -------                   ------                    -------                   -----------------
Podman 4.1.0     Podman 4.1.0              Red Hat Inc.              4.1.0                     {F0C12B5B-290B-4C15-A0D…

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/main/troubleshooting.md)

Yes

@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label May 30, 2022
@Luap99 Luap99 added the windows issue/bug on Windows label May 30, 2022
@Luap99
Copy link
Member

Luap99 commented May 30, 2022

@n1hility PTAL

@Clivar
Copy link
Contributor

Clivar commented Jun 10, 2022

This is caused by executing podman machine init in the same folder as wsl.exe (C:/windows/system32).
As a workaround you can navigate to any other folder and try again.

The problem seems to be caused by the Dir function. I provided a fix that omits the use of this function: #14570.

@n1hility
Copy link
Member

good catch @Clivar , I added a comment to the PR.

Clivar added a commit to Clivar/podman that referenced this issue Jun 14, 2022
@n1hility n1hility changed the title Podman 4.1 machine init error in Windows Podman 4.1 machine init fails when run in C:\Windows\System32 Jun 15, 2022
@github-actions github-actions bot removed the windows issue/bug on Windows label Jun 15, 2022
openshift-ci bot added a commit that referenced this issue Jun 16, 2022
Fix: Use absolute path to WSL binary to create ssh keys for `machine init` on Windows (Issue #14416)
n1hility pushed a commit to n1hility/podman that referenced this issue Jul 8, 2022
@gbraad
Copy link
Member

gbraad commented Jul 18, 2022

Confirmed this works now.
Although, it would be best not to run podman machine init from administrator. Will check with Yevhen for the podman desktop side.

@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 20, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
5 participants