Skip to content

Instantly share code, notes, and snippets.

@inscapist
Last active April 29, 2021 02:45
Show Gist options
  • Select an option

  • Save inscapist/94d170ef5d7861c66b04026ca4079d0b to your computer and use it in GitHub Desktop.

Select an option

Save inscapist/94d170ef5d7861c66b04026ca4079d0b to your computer and use it in GitHub Desktop.
Podman Machine + Virtualbox + Mac OSX

Install virtualbox

brew cask install virtualbox

Install podman machine

curl -L https://github.com/boot2podman/machine/releases/download/v0.17/podman-machine.darwin-amd64 --output /usr/local/bin/podman-machine
sudo chmod +x /usr/local/bin/podman-machine

Create a podman VM

podman-machine create --virtualbox-boot2podman-url \
  https://github.com/snowjet/boot2podman-fedora-iso/releases/download/d1bb19f/boot2podman-fedora.iso \
  --virtualbox-memory="4096" \
  --virtualbox-share-folder ~/Code:code \
  box

# now test
podman-machine ssh box -- sudo podman version

Install Podman client

The defacto Mac client from brew cask install podman didn't work for me. I use podman-remote-darwin from this fork

curl -L https://github.com/boot2podman/libpod/releases/download/v1.6.5/podman-remote-darwin --output /usr/local/bin/podman-remote-darwin
sudo chmod +x /usr/local/bin/podman-remote-darwin

Add init script

Add this to .zshrc / .bash_profile / config.fish

eval $(podman-machine env --varlink)
alias podman="podman-remote-darwin"
# alias docker="podman-remote-darwin"

Bind ip address to /etc/hosts

Get the ip address from podman-machine ip box

192.168.99.101 podman-box

From here on out, curl podman-box

@inscapist
Copy link
Author

inscapist commented Jun 28, 2020

Everything works except podman/docker cp.

Progress is tracked here:
containers/podman#4207

As a middleground, use podman-machine scp [from] [target] and then do podman cp inside VM

podman-machine scp -r source.txt root@box:/home/tc/target.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment