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.8.1 machine init fails with Error: existing machine configuration is corrupt, no image is defined #20921

Closed
odockal opened this issue Dec 6, 2023 · 5 comments · Fixed by #20929
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. machine windows issue/bug on Windows

Comments

@odockal
Copy link

odockal commented Dec 6, 2023

Issue Description

I am using podman 4.8.1 on Windows 10 to initialize a machine with a --user-mode-networking mode enabled.
I got this output:

podman machine init --user-mode-networking
Downloading VM image: fedora-podman-amd64-v38.0.50.tar.xz: done
Extracting compressed file: podman-machine-default_fedora-podman-amd64-v38.0.50.tar: done
Importing operating system into WSL (this may take a few minutes on a new WSL install)...
Import in progress, this may take a few minutes.
The operation completed successfully.

Installing user-mode networking distribution...
Import in progress, this may take a few minutes.
The operation completed successfully.
Configuring system...
Error: existing machine configuration is corrupt, no image is defined

Steps to reproduce the issue

Steps to reproduce the issue

  1. Download and install podman 4.8.1 on Windows 10 using msi installer
  2. podman machine init --user-mode-networking
  3. Assert: Machine is started
    Actual result: Error: existing machine configuration is corrupt, no image is defined

Describe the results you received

podman machine init --user-mode-networking --log-level=DEBUG
time="2023-12-06T13:01:59+01:00" level=info msg="C:\\Program Files\\RedHat\\Podman\\podman.exe filtering at log level debug"
time="2023-12-06T13:01:59+01:00" level=debug msg="Using Podman machine with `wsl` virtualization provider"
Extracting compressed file: podman-machine-default_fedora-podman-amd64-v38.0.50.tar: done
Importing operating system into WSL (this may take a few minutes on a new WSL install)...
time="2023-12-06T13:02:18+01:00" level=debug msg="Running command: wsl [--import podman-machine-default C:\\Users\\Ondrej\\.local\\share\\containers\\podman\\machine\\wsl\\wsldist\\podman-machine-default C:\\Users\\Ondrej\\.local\\share\\containers\\podman\\machine\\wsl\\podman-machine-default_fedora-podman-amd64-v38.0.50.tar --version 2]"
Import in progress, this may take a few minutes.
The operation completed successfully.
time="2023-12-06T13:02:19+01:00" level=debug msg="Running command: wsl [-u root -d podman-machine-default rpm --restore shadow-utils]"
time="2023-12-06T13:02:21+01:00" level=debug msg="Running command: wsl [-u root -d podman-machine-default test -f /usr/local/bin/vm]"
Installing user-mode networking distribution...
time="2023-12-06T13:02:21+01:00" level=debug msg="Running command: wsl [--import podman-net-usermode C:\\Users\\Ondrej\\.local\\share\\containers\\podman\\machine\\wsl\\wsldist\\podman-net-usermode C:\\Users\\Ondrej\\.local\\share\\containers\\podman\\machine\\wsl\\podman-machine-default_fedora-podman-amd64-v38.0.50.tar --version 2]"
Import in progress, this may take a few minutes.
The operation completed successfully.
time="2023-12-06T13:02:23+01:00" level=debug msg="Running command: wsl [-u root -d podman-net-usermode rpm --restore shadow-utils]"
Configuring system...
time="2023-12-06T13:02:24+01:00" level=debug msg="Running command: wsl [-u root -d podman-machine-default sh -c grep -q Port\\ 57872 /etc/ssh/sshd_config || echo Port 57872 >> /etc/ssh/sshd_config]"
time="2023-12-06T13:02:24+01:00" level=debug msg="Running command: wsl [-u root -d podman-machine-default sh]"
time="2023-12-06T13:02:24+01:00" level=debug msg="Running command: wsl [-u root -d podman-machine-default sh -c cat >> /etc/sudoers]"
time="2023-12-06T13:02:24+01:00" level=debug msg="Running command: wsl [-u root -d podman-machine-default sh -c cat > /etc/systemd/system/systemd-sysusers.service.d/override.conf]"
time="2023-12-06T13:02:25+01:00" level=debug msg="Running command: wsl [-u root -d podman-machine-default sh -c cat > /home/user/.config/systemd/user/linger-example.service]"
time="2023-12-06T13:02:25+01:00" level=debug msg="Running command: wsl [-u root -d podman-machine-default sh -c mkdir -p /var/lib/systemd/linger; touch /var/lib/systemd/linger/user]"
time="2023-12-06T13:02:25+01:00" level=debug msg="Running command: wsl [-u root -d podman-machine-default sh]"
time="2023-12-06T13:02:25+01:00" level=debug msg="Running command: wsl [-u root -d podman-machine-default sh -c cat > /etc/containers/containers.conf]"
time="2023-12-06T13:02:25+01:00" level=debug msg="Running command: wsl [-u root -d podman-machine-default sh -c cat > /etc/containers/registries.conf.d/999-podman-machine.conf]"
time="2023-12-06T13:02:26+01:00" level=debug msg="Running command: wsl [-u root -d podman-machine-default sh -c cat > /etc/tmpfiles.d/podman-docker.conf]"
time="2023-12-06T13:02:26+01:00" level=debug msg="Running command: wsl [-u root -d podman-machine-default sh -c echo wsl > /etc/containers/podman-machine]"
time="2023-12-06T13:02:26+01:00" level=debug msg="Running command: wsl [-u root -d podman-machine-default sh -c cat > /etc/systemd/system/podman-mnt-bindings.service]"
time="2023-12-06T13:02:26+01:00" level=debug msg="Running command: wsl [-u root -d podman-machine-default sh -c cat > /home/user/.config/systemd/user/podman-mnt-bindings.service]"
time="2023-12-06T13:02:26+01:00" level=debug msg="Running command: wsl [-u root -d podman-machine-default sh -c cat >> /etc/fstab]"
time="2023-12-06T13:02:27+01:00" level=debug msg="Running command: wsl [-u root -d podman-machine-default sh]"
time="2023-12-06T13:02:27+01:00" level=debug msg="Running command: wsl [-u root -d podman-machine-default sh -c cat > /etc/systemd/system/podman.socket.d/10-group.conf]"
Error: existing machine configuration is corrupt, no image is defined
time="2023-12-06T13:02:27+01:00" level=debug msg="Shutting down engines"

Describe the results you expected

Machine is created.

podman info output

Windows 10, Professional, 22H2 build, x86_64 arch. 

podman info
OS: windows/amd64
provider: wsl
version: 4.8.1

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 socket: failed to connect: dial tcp 127.0.0.1:57929: connectex: No connection could be made because the target machine actively refused it.

Podman in a container

No

Privileged Or Rootless

None

Upstream Latest Release

No

Additional environment details

Virtual Machine Platform feature enabled

Additional information

wsl --list shows that there is a podman-net-usermode WSL distribution avilable.

Standard image initialization (without user-mode-networking) via podman machine init works well.

Workaround

Possible workaround as suggested by @gbraad could be to create a machine first, then enable user mode networking:

podman machine init
podman machine set --user-mode-networking=true
@odockal odockal added the kind/bug Categorizes issue or PR as related to a bug. label Dec 6, 2023
@Luap99
Copy link
Member

Luap99 commented Dec 6, 2023

@n1hility PTAL

@Luap99 Luap99 added machine windows issue/bug on Windows labels Dec 6, 2023
@jeffmaury
Copy link

Seems related to 8e2d5e1

@gbraad

This comment was marked as resolved.

@n1hility
Copy link
Member

n1hility commented Dec 6, 2023

So it turns out this bug affects all past versions with this feature, it's just in 4.8.0 and earlier it would lead to an incomplete install as opposed to an error message.

If you had previously performed a set command to install the feature, that would also mask the error.

@gbraad
Copy link
Member

gbraad commented Dec 8, 2023

@n1hility confirmed that the init, set flow would have been a workaround, and this is why this was not encountered by me as an issue.

Note: We have to be cautious about this in testcases, as init --option and init, set --option can therefore show different behaviour.

@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 Mar 8, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 8, 2024
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. machine windows issue/bug on Windows
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants