-
-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connect vscode to distroboxes via podman? #883
Comments
Posting an updated version of the wrapper (will update the docs one day :P) #!/bin/bash
set -x
# This little workaround is used to ensure
# we use our $USER inside the containers, without
# resorting to creating devcontainer.json or similar stuff
arr=("$@")
id="$( echo "$@" | rev | cut -d' ' -f2 | rev)"
# if exec && distrobox -> use distrobox-enter --
if [ "$(flatpak-spawn --host podman inspect --type container --format '{{.Config.Labels.manager}}' "${id}")" == "distrobox" ]; then
for i in "${!arr[@]}"; do
if [[ ${arr[$i]} == *"root:root"* ]]; then
arr[$i]="$(echo "${arr[$i]}" | sed "s|root:root|$USER:$USER|g")"
fi
done
fi
flatpak-spawn --host podman "${arr[@]}" It checks for labels in order to do the user-swap only on distroboxes |
Ok this is on the host now via another PR. I think we need to add the remote vscode extension to the profile (I can work on this), anything else? |
Yes needs the remote extension, and a setting to use this instead of docker Which I wouldn't do by default I guess |
I added the extension: https://github.com/ublue-os/bluefin/pull/888/files I'll post on the forum and get feedback before we close this. |
Can confirm that this works with distrobox. Toolbox did not work with a standard toolbox but worked with a quadlet based one (sorta still connected as root) Oddities I noticed, since I had setup dotfiles with the dev-containers extension, it pulled in my dotfiles deploy script unexpectedly. Additionally, it does not fully set-up everything for distrobox and toolbox. You will need to manually setup some environment variables to get distrobox-host-exec to work. This worked best with distroboxes with their own $HOME. I like that this is on disk. I'm unsure I would have this be the default experience. It should be easy to use jq to add the necessary keys to the config.json to automate enabling and disabling this using a just command. |
Yes because it does not actually do a Maybe needs more work/testing |
The gift that keeps on giving! Luca thinks we can use this:
https://github.com/89luca89/distrobox/blob/main/docs/posts/integrate_vscode_distrobox.md#third-step-podman-wrapper
to connect podman to distroboxes, that way people can have their cake and eat it too if they just have to have their distroboxes connected to vscode. We could toss this wrapper on the image somewhere and then have people opt-in or
ujust
switch to this perhaps as an option?Leaving this open for discussion and if someone wants to pick it up.
The text was updated successfully, but these errors were encountered: