Using toolboxes on Clear Linux (aka more apps!)

I’ve been using Fedora Silverblue and it kind of forces you into a more container-focused lifestyle. So I was wondering if I could apply those concepts to Clear Linux. If you’re not familiar with the concept, the root filesystem is mostly immutable, and you instead install apps via flatpaks and containers.

Fedora uses Toolbx and Podman to do this. Toolbx isn’t in CL and though I was able to install podman it came unconfigured and getting that to work was beyond my skill level. Ends up Luca Di Maio took some of these concepts and made Distrobox, which has the added bonus of supporting Docker and doesn’t need special images: GitHub - 89luca89/distrobox: Use any linux distribution inside your terminal.

Also it installs into your home directory so it made it easy to prototype this, less than 10m to set up! I installed Docker and followed these instructions so that I can just use it without root: Docker as root?

And voila, I can now quickly install just about any Linux distro’s userspace on my CL system, with the convenience of having it transparently mount my home directory. This means I can now install and use just about any application on my CL system:

And all the GUI apps work too:

Now, installing Kate in both containers brought in the deps into those containers, so realistically you’re better off install Kate from flatpak, however, there’s been lots of requests on this forum for people who need a piece of software that is unavailable on CL or flathub. Well here you go, you can install it in your ubuntu distrobox, then do distrobox-export --app kate and get your shortcut on your CL desktop and be good to go.

There are no VMs here, it’s fast, and it enables you to effectively use the existing thousands of apps from whatever distro you want while keeping the nice things you like about CL on your host. I was unfortunately not able to get a clearlinux container running in this manner, but I’m reasonably certain it’s a configuration issue and not a fundamental one.

Anyway, between toolbox/distrobox, and podman/docker it’s kind of confusing, however I thought it’d be something interesting for the Clear Linux devs to consider; it dramatically increases the amount of software I can use and the disposability of the containers means I can keep my host nice and clean!

11 Likes

That looks very interesting, will definitely try this out!

Good to see you back here, it has been a while… :wink:

5 Likes

@castrojo thanks for the shoot out :smiley:

I was unfortunately not able to get a clearlinux container running in this manner, but I’m reasonably certain it’s a configuration issue and not a fundamental one.

There is an issue open on this one: [Suggestion] Clear Linux guest support · Issue #105 · 89luca89/distrobox · GitHub

Seems to be an incompatibility between how docker and podman handles the use of users inside the container and distributions that do not use /etc/passwd, as Clear’s docker image uses /usr/share/defaults/etc/passwd it’s kind of a moot point either podman and docker account for this or we need to create a custom image (even just symlinking it should suffice)

5 Likes

@castrojo
The clearlinux’s docker image maintainer just merged a patch I’ve sent to fix the issue with rootless containers :smile:

So now the issue [Suggestion] Clear Linux guest support · Issue #105 · 89luca89/distrobox · GitHub on github is unblocked and I can work on adding support on distrobox-init for clearlinux :tada:

7 Likes

Hi guys, as a little update
As of 18/01/2022 the Clear Linux image has been updated witht the fix for rootless podman :tada:
So support for Clear Linux guests has been merged and will be part of the next Distrobox release :+1:

9 Likes

This is awesome! Thanks Luca!

1 Like

@castrojo starting 35760, podman should have all the right things to allow you to run unprivileged containers in the system. The only bit missing is the creation of /etc/subuid and /etc/subgid. We figured this can be on piece that the user can create based on their preference. Not sure if you are still interested in testing it out with podman.

2 Likes

One hurdle for Clear Linux as desktop is language input other than English as Japanese or Chinese. And this solution inspired me that it could bring this capability without build.

Installing Distrobox with Ubuntu container, and apt install input method as Mozc. Then, Clear Linux indirectly supports Japanese input as attached.

I really appreciate for this thread.

I will reconfirm its installation process on clean VM of Clear Linux and share it later.

Thank you.