Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

@sagittaros
Copy link
Author

sagittaros commented Jun 28, 2020

Hello world

$ podman run hello-world
Trying to pull docker.io/library/hello-world...
Getting image source signatures
Copying blob sha256:0e03bdcc26d7a9a57ef3b6f1bf1a210cff6239bff7c8cac72435984032851689
Copying config sha256:bf756fb1ae65adf866bd8c456593cd24beb6a0a061dedf42b26a993176745f6b
Writing manifest to image destination
Storing signatures

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/

Test drive with SQLserver with volume.

At this time, I have adjusted VM's ram allocation to 4GB

podman run \
  -e 'ACCEPT_EULA=Y' \
  -e 'MSSQL_SA_PASSWORD=Hi123World' \
   --name 'sql1' -p 1433:1433 \
   -v sql1data:/var/opt/mssql \
   mcr.microsoft.com/mssql/server:2019-GA-ubuntu-16.04

It works!

@sagittaros
Copy link
Author

sagittaros 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