energy-quants / bootstrap

A repo containing scripts for bootstrapping a development environment
MIT License
0 stars 1 forks source link

Configure `podman` #7

Open dhirschfeld opened 2 years ago

dhirschfeld commented 2 years ago

Required for podman:

sudo apt install uidmap

xref: https://github.com/conda-forge/podman-feedstock/issues/11

dhirschfeld commented 2 years ago

Configure podman

sudo mkdir /opt/mambaforge/envs/base/etc/cni  
chown -R $(id -u):$(id -g) /opt/mambaforge/envs/base/etc/cni/

[!Warning] Not relevant anymore.

dhirschfeld commented 2 years ago
mount --make-rshared / 

xref: https://github.com/conda-forge/podman-feedstock/issues/25

Use wsl.exe "trick" to run this at the start. (Should use boot settings on Win11)

$ cat /etc/profile.d/02-shared-root.sh
wsl.exe -u root -e mount --make-rshared /

Avoids below error:

WARN[0000] "/" is not a shared mount, this could cause issues or missing mounts with rootless containers 
dhirschfeld commented 2 years ago

/tmp is a directory on WSL and without the systemd config the podman temp files don't get cleaned up resulting in unknown FS magic errors.

Ensure /tmp is cleaned up by mounting a tmpfs in /etc/fstab:

$ cat /etc/fstab
LABEL=cloudimg-rootfs   /        ext4   discard,errors=remount-ro         0 1
tmpfs                   /tmp     tmpfs  rw,nosuid,nodev,noatime,mode=1777 0 0

xref: https://github.com/containers/podman/issues/12236

dhirschfeld commented 2 years ago

Potentially need:

# https://github.com/containers/podman/issues/2788#issuecomment-479923274
sudo chmod 4755 /usr/bin/newgidmap
sudo chmod 4755 /usr/bin/newuidmap

[!Warning] Not relevant anymore.

dhirschfeld commented 2 months ago

Needs cgroupv2 enabled in .wslconfig:

❯ cat C:\Users\sysop\.wslconfig
[wsl2]
kernelCommandLine = cgroup_no_v1=all
dhirschfeld commented 2 months ago

Missing pasta binary:

Error: could not find pasta, the network namespace can't be configured: exec: "pasta": executable file not found in $PATH

https://github.com/containers/podman.io/issues/285

sudo apt install passt