Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save nikAizuddin/9402d883082d6077dd078bb10eadd5ef to your computer and use it in GitHub Desktop.
Save nikAizuddin/9402d883082d6077dd078bb10eadd5ef to your computer and use it in GitHub Desktop.
Podman Installation on OpenSUSE Tumbleweed WSL2

Podman Installation on OpenSUSE Tumbleweed WSL2

Make sure all packages up-to-date:

sudo zypper dup

Restart OpenSUSE by executing the following command using Powershell:

wsl --shutdown openSUSE-Tumbleweed

Execute the following command to install Podman:

sudo zypper install -y podman crun

Execute podman info to initialize rootless Podman:

podman info

Execute the following command to create /etc/containers/containers.conf based on sample config:

sudo cp -v /usr/share/containers/containers.conf /etc/containers/

In /etc/containers/containers.conf file, change the following values (make sure these lines are not commented): 3) Increase ulimits to 65535 and make memlock unlimited:

[containers]
default_ulimits = [ 
  "nofile=65535:65535",
  "memlock=-1:-1"
]

In the /etc/containers/containers.conf file, make sure we are using crun instead of runc:

[containers]

runtime = "crun"

Since ulimit config above only works for rootful Podman, it will cause a permission error when running on rootless Podman. To prevent this error, create an empty default_ulimits in ~/.config/containers/containers.conf file:

[containers]

default_ulimits = []

Allow IPv4 forwarding and ping in /etc/containers/containers.conf:

[containers]
default_sysctls = [
  "net.ipv4.ping_group_range=0 0",
  "net.ipv4.ip_forward=1"
]

Create /etc/sysctl.d/vm-max_map_count.conf to set vm.max_map_count to 300000:

vm.max_map_count=300000

To apply vm.max_map_count without reboot, execute the following command:

sudo sysctl -w vm.max_map_count=300000

Create /etc/sysctl.d/allow-unprivileged-ports-bind.conf with the following lines to allow non-privileged bind ports lower than 1024:

net.ipv4.ip_unprivileged_port_start=21

To apply net.ipv4.ip_unprivileged_port_start without reboot, execute the following command:

sudo sysctl -w net.ipv4.ip_unprivileged_port_start=21

Test the following command and make sure no errors:

podman run --rm docker.io/alpine echo hello
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment