Podman 初始化 (init) 在 Windows 10 上不起作用

use*_*238 7 podman

更新:我设法通过使用此命令启用 wsl2 来解决此问题

wsl --设置默认版本 2

运行 podman-v4.1.0.msi 并在 power shell 中运行 podman machine init 命令后,我得到以下信息:

Copr repo for podman4 owned by rhcontainerbot                                            12 kB/s | 1.0 kB     00:00
Importing GPG key 0x2F6C3CBA:
 Userid     : "rhcontainerbot_podman4 (None) <rhcontainerbot#podman4@copr.fedorahosted.org>"
 Fingerprint: 79B5 022D 580F B1D6 B527 CB83 3BB2 485A 2F6C 3CBA
 From       : https://download.copr.fedorainfracloud.org/results/rhcontainerbot/podman4/pubkey.gpg
Key imported successfully
error: sqlite failure: CREATE TABLE IF NOT EXISTS 'Packages' (hnum INTEGER PRIMARY KEY AUTOINCREMENT,blob BLOB NOT NULL): locking protocol
error: cannot open Packages index using sqlite - No such file or directory (2)
error: cannot open Packages database in /var/lib/rpm
Import of key(s) didn't help, wrong key(s)?
error: sqlite failure: CREATE TABLE IF NOT EXISTS 'Packages' (hnum INTEGER PRIMARY KEY AUTOINCREMENT,blob BLOB NOT NULL): locking protocol
Run Code Online (Sandbox Code Playgroud)

经过一段时间的运行,我终于明白了:

 GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-35-x86_64
Public key for systemd-pam-249.12-3.fc35.x86_64.rpm is not installed. Failing package is: systemd-pam-249.12-3.fc35.x86_64
 GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-35-x86_64
Public key for systemd-resolved-249.12-3.fc35.x86_64.rpm is not installed. Failing package is: systemd-resolved-249.12-3.fc35.x86_64
 GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-35-x86_64
Public key for util-linux-2.37.4-1.fc35.x86_64.rpm is not installed. Failing package is: util-linux-2.37.4-1.fc35.x86_64
 GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-35-x86_64
Public key for util-linux-core-2.37.4-1.fc35.x86_64.rpm is not installed. Failing package is: util-linux-core-2.37.4-1.fc35.x86_64
 GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-35-x86_64
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing 'dnf clean packages'.
Error: GPG check FAILED
Error: package installation on guest OS failed: exit status 1
Run Code Online (Sandbox Code Playgroud)

尝试启动 podman 我得到这个:

bin/bash: line 1: /root/bootstrap: No such file or directory
Error: WSL bootstrap script failed: exit status 127
Run Code Online (Sandbox Code Playgroud)

它在此之前安装了其他东西,但似乎最后遇到了麻烦。

podman machine list 给出以下输出:

NAME                     VM TYPE     CREATED         LAST UP         CPUS        MEMORY      DISK SIZE
podman-machine-default*  wsl         38 minutes ago  38 minutes ago  12          17.13GB     0B
Run Code Online (Sandbox Code Playgroud)

Podman 版本 4.1.0

Windows 内部版本 21H2 19044.1706

小智 5

将 WSL2 设置为默认值后,它开始工作。

wsl --set-default-version 2
Run Code Online (Sandbox Code Playgroud)