There is no standard or easy way to install Podman on your machine. So here is my flavour. I want it straightforward, easy to comprehend, and lighter than alternatives.
Introducing the Vagrant X Podman method, that I've just stolen from this blog post and modified to use Arch Linux instead.
The goal is to install an Arch Linux virtual machine using Vagrant, install podman on it, and then connect to it using podman-remote
from the MacOS host.
note: podman-server is not an actual thing
# Install Vagrant (VM manager)
brew install vagrant
# Create the directory where your Vagrantfile will be stored
mkdir archpod && cd archpod
# Create the Vagrantfile
vagrant init terrywang/archlinux
# launch the machine
vagrant up
First of all, connect to the VM using vagrant ssh
Next, run the following commands:
# Update and install the prerequities
sudo pacman -Syu && sudo pacman -S podman libvarlink
# Allow ssh clients to connect and use podman
systemctl --user enable --now podman.socket
sudo loginctl enable-linger $USER
## important: restart the VM to load the updated kernel modules
shutdown -r now
# you'll need to wait about a minute before reconnecting using `vagrant ssh` again.
In the VM, run:
podman --remote info
- Copy your SSH pubkey in your clipboard
cat ~/.ssh/id_rsa.pub | pbcopy
(MacOS) - Add your pubkey to the VM's authorized_keys.
nano .ssh/authorized_keys
(VM) then add a line and paste your key. Save and exit.
You need to configure the podman-remote you installed earlier to connect to your Vagrant VM. On the MacOS host:
podman system connection add arch --identity ~/.ssh/id_rsa ssh://vagrant@localhost:2222/run/user/998/podman/podman.sock
Note: your user ID might be different. Just use ls /run/user
in the VM to get the correct one.
You can now check if everything is working using podman info
podman run docker.io/library/hello-world