Prerequisites§
To start, you must have an immutable linux desktop distribution such as openSUSE Aeon. In this short post, I will explain how to set up VSCodium Flatpak in an immutable linux desktop. Some of the steps can be imitated to other immutable distros such as Fedora Silverblue and VanillaOS.
Reason§
There are ongoing issues and questions amongst Linux users and skepticisms regarding the usability of immutable desktops and the push for an all flatpak (or snap, if you prefer that,) immutable desktop distribution.
This post, however, only debunks misinformation of how to use VSCodium Flatpak (or even VSCode Flatpak) properly in this kind of system.
The Guide§
Setting up Flatpak§
openSUSE Aeon already has flatpak set up out of the box but it's system-wide
. If you prefer user-wide installations, you can do:
Installing VSCodium Flatpak§
Assuming you use openSUSE Aeon, you can install VSCodium Flatpak through GNOME Software. If you love to use the CLI, you can do the following:
User-wide install§
System-wide install§
Then install Open-Remote-SSH Plugin for VSCodium - https://github.com/jeanp413/open-remote-ssh.
Setting up distrobox§
openSUSE Aeon comes with distrobox out of the box 😜
Distrobox is a podman frontend much like toolbx. I prefer distrobox because it's way more flexible in my experience.
To create my own container, I run the following command
This will create a podman container named as "tumbleweed". I advise you to set a custom HOME
directory though. You can do that by using the command
For more information, check out the documentation at https://distrobox.privatedns.org/usage.
Setting up SSH and SSHD in your container§
After entering your container (here we use "tumbleweed"), do
# assuming you have vim installed in the podman container
# I use vim here
Then add the following to your /etc/ssh/sshd_config
in that container
Port 10000
ListenAddress localhost
PermitEmptyPasswords yes
PermitUserEnvironment yes
X11Forwarding yes
Next, run the sshd
command like so
Make sure the container is running during all of your sessions. Distrobox does it by default.
Then in your host system, edit ~/.ssh/config
with the following content
Host tumbleweed
HostName localhost
Port 10000
Finally, use your Open-Remote-SSH plugin in VSCodium to connect to that container and set up your development environment!
Conclusion§
Setting up VSCodium flatpak is complicated but not that hard as long as you are familiar with how containers work and how to choose the right plugins. I believe that a development environment that is mostly SSH-ing to containers bring benefits that outweighs its disadvantages:
- clean base system; install dev dependencies in the container
- throw the container away to start fresh if desired
- allows developers to install only the necessary stuff on their base system
- encourages the use of flatpaks, a universal distribution/packaging format
- explores possibilities of making immutable desktops as a viable development environment