Podman on Chromebook Crostini

For the last several months I have been using a Chromebook as my primary personal machine - for gaming, development and other general computing tasks (maybe I’ll write up a review soon..) As a part of this, I’m heavily leveraging the Linux development environment that is available.

This development environment is a LXD container that runs debian (currently bullseye) with limited permissions to limit the security impact. This container works awesome for running linux apps, which for me means awesome Visual Studio Code support. One of the limitations of this container though, is that Docker does not work in the reduced permission environment, so I needed to set-up Podman (which I prefer anyway.)

Here is the process I used to get Podman up and running, allowing me to run containers that have tools for development (my test target was the PBnJ open source project.)

# Fire up your crosh shell (not linux) by hitting ctrl+alt+t and enter:

vmc start termina

# Enable security nesting with:

lxc config set penguin security.nesting=true

# Restart the lxc container:

lxc restart penguin

# Setup the gids:

lxc exec penguin -- /bin/sh -c "printf '%s\n' '1000:100000:65536' | tee /etc/subuid /etc/subgid"

# Close out with:

exit  
vmc stop termina

# Now let’s install podman with:

sudo apt get install podman

# Finally, before starting up we need to add the following config files:

/etc/containers/storage.conf
    [storage]
    driver = "btrfs"

/etc/containers/containers.conf 
    [containers] 
    keyring=false

# Update /etc/containers/registries.conf to include the following:

unqualified-search-registries = ["docker.io"]

Install Erlang and Elixir on Debian

I’ve started learning Elixir and wanted to share the steps for reinstalling it in Debian (well, crostini on my chromeos installation but it should be the same for regular Debian too.)

Now these steps are pretty much verbatim if you follow the official Elixir, asdf and asdf-{erlang,elixir} documentation but I want to make sure I have this saved for myself in the future and anyone else who stumbles upon this.

# First start with getting asdf installed

asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git

# Add asdf to your .bashrc and restart your terminal

. "$HOME/.asdf/asdf.sh"
. "$HOME/.asdf/completions/asdf.bash"

# Next install the Erlang plugin pre-reqs

apt-get -y install build-essential autoconf m4 libncurses5-dev libwxgtk3.0-gtk3-dev libwxgtk-webview3.0-gtk3-dev libgl1-mesa-dev libglu1-mesa-dev libpng-dev libssh-dev unixodbc-dev xsltproc fop libxml2-utils libncurses-dev openjdk-11-jdk

# Install the Erlang asdf plugin and Erlang

asdf plugin add erlang https://github.com/asdf-vm/asdf-erlang.git
asdf install erlang 25.2.2 # The latest version as of this article

# Install Elixir asdf plugin and Elixir

asdf plugin-add elixir https://github.com/asdf-vm/asdf-elixir.git
asdf install elixir 1.14.3-otp-25 # The latest as of this article