Skip to content

vscode extension? #610

Closed
Closed

Description

@yajo

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.

Activity

  1. added
    1. Feature request
    on Oct 30, 2020
  2. lbssousa commented on Oct 30, 2020

    @lbssousa

    Related issue on the other side: microsoft/vscode-remote-release#3345

  3. lbssousa commented on Oct 30, 2020

    @lbssousa

    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.

  4. debarshiray commented on Oct 30, 2020

    @debarshiray
    Member

    There's a PR open here that allows connecting VSCode easily to
    a Toolbox container via Remote-SSH extension.

    Yes, that's #587

  5. debarshiray commented on Oct 30, 2020

    @debarshiray
    Member

    Let's close this issue and follow-up in the other respective issues.

  6. lbssousa commented on Nov 12, 2020

    @lbssousa

    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:

    {
      "remote.containers.copyGitConfig": false,
      "remote.containers.gitCredentialHelperConfigLocation": "none"
    }
  7. lbssousa commented on Nov 16, 2020

    @lbssousa

    @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.

  8. added a commit that references this issue on Mar 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    1. Feature request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions