podman: Podman machine won't start due to corrupted config file
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
This problem concerns Podman on Windows. I have seen this problem occur on other occations with other programs on Windows. The content of the original (or changed) config file, every char is replaced with the value ‘\x00’.

Steps to reproduce the issue:
unknown
Describe the results you received:
Due to the corrupted configuration file the podman wsl container won’t start.
Describe the results you expected:
Detect that the config file is corrupted, check for existing wsl containers and ask for permission to recreate the config for the machine. Or maybe create backups of the config file and load the last one.
Additional information you deem important (e.g. issue happens only occasionally):
Output of podman version:

Output of podman info:
Same as above.
Package info (e.g. output of rpm -q podman or apt list podman or brew info podman):
Installer used was podman-4.3.0-setup.exe
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)
No
Additional environment details (AWS, VirtualBox, physical, etc.):
Edition Windows 10 Pro
Version 22H2
Betriebssystembuild 19045.2251
Leistung Windows Feature Experience Pack 120.2212.4180.0
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 4
- Comments: 15 (5 by maintainers)
Look into the folder
%USERPROFILE%\.config\containers\podman\machine\wsl(orC:\Users\<profile>\.config\containers\podman\machine\wsl)´. It should be thepodman-machine-default.jsonfile IIRC. Open it and instead of json there should be a lot of\x00instead. Delete either the podman folder or one up, the container folder. On the terminalwsl --list --allshould show you apodman-machine-defaultExecutewsl --unregister podman-machine-defaultThen try apodman machine initagain. At least that was what i did, if i remember correctly.Full cleanup procedure:
Find the name of the broken file.
Delete the broken json file.
List all WSL instances.
Delete the Podman WSL instance.
Delete the remaining connection configuration.
Now you can initialize a new Podman machine.
I could reproduce the issue on a Windows 10 libvirt instance:
.\.config\containers\podman\machine\wsl\podman-machine-default.jsonfile is empty.@themr0c work is in progress on this on #18011
thanks @gravityFlower ! After above steps can init a new podman machine! But there are additional issues in my case, can’t build connection to the machine when pull image. I deleted the related .ssh file and execute “podman system connection remove *”, all works now~