You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I love toolbox but I don't use it daily because I'd have to type toolbox enter every time.
I develop mainly from vscode and I'd love it if there were a way for it to work always inside the toolbox. Or at least to do it by default. VSCode supports remote development, and one of the specifically supported environments are containers.
Describe the solution you'd like
I'd like it a lot if there was a "Remote - toolbox" extension that, once installed, lets you just choose the toolbox name for your environment (if you want; otherwise just use default one). Then that would make VSCode do all of its stuff inside the toolbox and not outside of it.
Describe alternatives you've considered
Using the above linked containers extension to configure it to develop inside toolbox, but I don't think it's possible. If it were, some docs on how to do that would be just enough.
There's a PR open here that allows connecting VSCode easily to a Toolbox container via Remote-SSH extension. Another possible approach would be to make toolbox able to export a suitable devcontainer.json file for use with Remote-Containers extension.
I was able to attach to my Toolbox container through VSCode's Remote-Containers extension. All I have to do is:
For containers created with Toolbox up to version 0.0.96, run the following command before starting VSCode:
toolbox -c ${TOOLBOX_CONTAINER_NAME} run true
Provide a file $HOME/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/nameConfigs/${TOOLBOX_CONTAINER_NAME}.json (or $HOME/.var/app/com.visualstudio.com/config/Code/User/globalStorage/ms-vscode-remote.remote-containers/nameConfigs/${TOOLBOX_CONTAINER_NAME}.json, if you're using Flatpak'ed VSCode) like this:
{
"remoteUser": "${localEnv:USER}",
"settings": {
"terminal.integrated.shell.linux": "/usr/sbin/capsh",
"terminal.integrated.shellArgs.linux": [
"--caps=",
"--",
"-c",
"exec \"$@\"",
"/bin/sh",
// If using Flatpak'ed VSCode, you may want to set explicit value
// like "/bin/bash" or "/bin/zsh" here.
// Otherwise, you may get /bin/sh as the
// default integrated terminal shell.
"${localEnv:SHELL}",
"-l"
]
},
"remoteEnv": {
"COLORTERM": "${localEnv:COLORTERM}",
"DBUS_SESSION_BUS_ADDRESS": "${localEnv:DBUS_SESSION_BUS_ADDRESS}",
"DESKTOP_SESSION": "${localEnv:DESKTOP_SESSION}",
"DISPLAY": "${localEnv:DISPLAY}",
"LANG": "${localEnv:LANG}",
"SHELL": "${localEnv:SHELL}",
"SSH_AUTH_SOCK": "${localEnv:SSH_AUTH_SOCK}",
"TERM": "${localEnv:TERM}",
"VTE_VERSION": "${localEnv:VTE_VERSION}",
"XDG_CURRENT_DESKTOP": "${localEnv:XDG_CURRENT_DESKTOP}",
"XDG_DATA_DIRS": "${localEnv:XDG_DATA_DIRS}",
"XDG_MENU_PREFIX": "${localEnv:XDG_MENU_PREFIX}",
"XDG_RUNTIME_DIR": "${localEnv:XDG_RUNTIME_DIR}",
"XDG_SESSION_DESKTOP": "${localEnv:XDG_SESSION_DESKTOP}",
"XDG_SESSION_TYPE": "${localEnv:XDG_SESSION_TYPE}"
}
}
Give write permission to container's /root folder for my user, since current Remote-Containers will try to install .vscode-server folder there.
[EXTRA]: If you're using Flatpak'ed VSCode, you may need this to make it able to attach to your Toolbox container via host system's podman binary.
[UPDATE 2020-11-16] In order to avoid breaking your host system's ~/.gitconfig settings, add the following settings to file /root/.vscode-server/data/Machine/settings.json within your container:
Reacted by Jay W, Hofer-Julian, Ondřej Míchal, Josu, Jeffrey Serio, MAHDTech, Naufan R. Faikar, Richard Février, Ítalo de Moraes Garcia, LM. Garret and 2 more
@debarshiray from my regular tests here, the settings above are enough to allow me to work comfortably within a Toolbox container via VSCode's Remote-Containers extension. You may consider adding a feature to toolbox binary that automates these settings.
Reacted by Hofer-Julian, Jorge Martínez López, Jay W, Richie McG, Ondřej Míchal, Jeffrey Serio, Anthony Rabbito and Christoph Roeper
Activity
lbssousa commentedon Oct 30, 2020
Related issue on the other side: microsoft/vscode-remote-release#3345
lbssousa commentedon Oct 30, 2020
There's a PR open here that allows connecting VSCode easily to a Toolbox container via Remote-SSH extension. Another possible approach would be to make toolbox able to export a suitable devcontainer.json file for use with Remote-Containers extension.
debarshiray commentedon Oct 30, 2020
Yes, that's #587
debarshiray commentedon Oct 30, 2020
Let's close this issue and follow-up in the other respective issues.
lbssousa commentedon Nov 12, 2020
I was able to attach to my Toolbox container through VSCode's Remote-Containers extension. All I have to do is:
$HOME/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/nameConfigs/${TOOLBOX_CONTAINER_NAME}.json(or$HOME/.var/app/com.visualstudio.com/config/Code/User/globalStorage/ms-vscode-remote.remote-containers/nameConfigs/${TOOLBOX_CONTAINER_NAME}.json, if you're using Flatpak'ed VSCode) like this:Give write permission to container's
/rootfolder for my user, since current Remote-Containers will try to install.vscode-serverfolder there.[EXTRA]: If you're using Flatpak'ed VSCode, you may need this to make it able to attach to your Toolbox container via host system's
podmanbinary.[UPDATE 2020-11-16] In order to avoid breaking your host system's
~/.gitconfigsettings, add the following settings to file/root/.vscode-server/data/Machine/settings.jsonwithin your container:{ "remote.containers.copyGitConfig": false, "remote.containers.gitCredentialHelperConfigLocation": "none" }lbssousa commentedon Nov 16, 2020
@debarshiray from my regular tests here, the settings above are enough to allow me to work comfortably within a Toolbox container via VSCode's Remote-Containers extension. You may consider adding a feature to
toolboxbinary that automates these settings.Use support for flatpak vs-code