the script podman-host is aimed at working with flatpak-vscode, not layered-vscode. It might work the first time, and then alters the DevContainers own workflow of folder, files creation and symlinking. The script needs revision and being rewritten for Silverblue and its derivatives. I have tested it for Silverblue-40 and Bluefin-DX-39. podman-host will also conflict when the user wants to create a new DevContainer.
The repeatable and reproducible way of integrating Distroboxes with vscode is by declaring the distrobox of choice in its own .json configuration file. See summary at the bottom.
The Silverblue community needs to work on a unified script that makes a seamless integration with layered-vscode. That script should allow the user to interact with Docker, Podman, Toolbox, Distrobox, and DevContainers from vscode.
The integration problem of vscode with containers is not restricted to Universal Blue but to all Silverblue and its derivatives. I have found the same issues in a fresh Silverblue-40 installation as well as in a fresh Bluefin-DX-39. Work of the past two weeks.
The DevContainer developers have not had in mind atomic Linux distributions such as Silverblue. A case in point: Vscode integrates without much trouble to Distrobox and DevContainers in Ubuntu 22.04. But this operating system is not atomic and follows conventional rules.
I will try to make a procedure available for manual integration of a fresh layered-vscode installation with Distrobox containers. I understand that Distroboxes aim is at being pet containers but as such will need to run sometimes code or scripts that need to be modified and tested under the container conditions. That’s when the vscode integration comes in handy.
Summary of Distrobox integration to vscode
-
Take note of the name of the distrobox. You will need it to create its .json configuration file. For the sake of the example, let’s say the distrobox name is
conky-nvidia
. -
Create the folder
nameConfigs
with
mkdir ${HOME}/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/nameConfigs
- Create a .json file with the same name as your distrobox. Example:
conky-nvidia.json
touch ${HOME}/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/nameConfigs/conky-nvidia.json
- Edit the created file and add this snippet:
{
"remoteUser": "${localEnv:USER}",
"settings": {
"dev.containers.copyGitConfig": false,
"dev.containers.gitCredentialHelperConfigLocation": "none"
}
}