TL;DR

If you receive error like write unixgram @00017->/run/systemd/journal/socket: sendmsg: no such file or directory. Then, Edit /usr/share/containers/containers.conf with below lines.

log_driver = "k8s-file"

cgroup_manager = "cgroupfs"

event_logger = "file"

Introduction

If you install podman on WSL, than you may receive below or similar error when you try to run podman commands

“write unixgram @00017->/run/systemd/journal/socket: sendmsg: no such file or directory”

It is because Podman’s default configuration is use journald as event_logger.

Methods

Fix this problem is very simple, just config it. But, the problem is Where is the config file? When you googling this then find like below.

  • Use podman with arguments --events-backend=file
  • Edit ~/.config/containers/libpod.conf
  • Edit /etc/containers/libpod.conf
  • Edit ~/.config/containers/containers.conf
  • Edit /etc/containers/containers.conf

But, you can’t find them. Due to build different, or removed legacy.

  • My environment
    • WSL2 with WSLg
    • Official Debian from Microsoft Store (bullseye)
    • Podman (3.0.1)

Edit /usr/share/containers/containers.conf with below two lines.

log_driver = "k8s-file"

event_logger = "file"

journald problem is due to systemd is not supported in WSL. So you also need to config cgroup_manager

cgroup_manager = "cgroupfs"