How to Run Incompatible Software on Zorin via Distrobox

Intro to Distrobox and why you might want to use it

Lets say you want to try out some software thats still in alpha but you need a newer glibc in order to run it. Unfortunately glibc is a critical library and you can't simply just update to a later version without potentially damaging other parts of your system.

Distrobox lets us keep using our stable distro while still being able to access software even on complete different distros like Fedora but with system integration.

So lets start with what made me find out about distrobox in the first place. ShadPS4 is a PS4 emulator thats currently in alpha and sadly the app image requires a higher glibc version than Zorin OS 17.2 has. You can check your glibc version using ldd --version. It should be 2.35 if you're on the same OS version as me but we require 2.38 for ShadPS4.

CAUTION: Distrobox is not focused on trying to provide some form of sandboxing so only install things you trust to be safe as it could affect your host system. You can read more about here at this link.
https://distrobox.it/#security-implications

Part 1: Setting Up Docker

Distrobox depends on a container manager so we need either Docker, lilipod, or podman for it to work. I'm just going show how to use Docker so I'd advise you to follow along. First we need to add the apt repository as shown in the docs.
https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository

# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

# Add the repository to Apt sources:
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
  $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update

Next lets install these docker packages.

sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Now let verify docker is working correctly by running this.

sudo docker run hello-world

Now we'll want to be able to run distrobox without sudo so we'll have to do some permission changes so docker can run without sudo so here's the command we will run to accomplish that. The docker group should already exist but if it doesn't run this.

sudo groupadd docker

Now to add our current user run this.

sudo usermod -aG docker $USER

Restart your system for the changes to take effect. I've personally experienced that logging out and back in doesn't seem to apply to changes and newgrp docker only works for the terminal instance you applied it on. You'll know it's working correctly if this command works like it did when we ran it with sudo.

docker run hello-world
Part 2: Setting Up Distrobox

Finally we will install Distrobox using this.

curl -s https://raw.githubusercontent.com/89luca89/distrobox/main/install | sudo sh

Next lets create an image in distrobox.

distrobox create --name ubuntu-appimage --image ubuntu:latest

Now lets enter it using this command.

distrobox enter ubuntu-appimage

It will take a bit of time to setup when you first enter it.

Part 3: Running ShadPS4 in Distrobox

Now we're inside the distrobox we created but you'll need some packages to run appimages as distroboxes generally are very barebones. So let's install them
using these commands.

sudo apt install fuse libfuse2

Now if you want to run ShadPS4 you'll also need this package.

sudo apt install libopengl0

ShadPS4 should run now.

2 Likes