Skip to content
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

Packaging request for vscode-extensions.ms-vscode-remote.remote-containers #182397

Open
GGG-KILLER opened this issue Jul 21, 2022 · 16 comments
Open

Comments

@GGG-KILLER
Copy link
Contributor

Project description
This extension basically allows us to create a dev environment in a container which makes things easier with e.g.: .NET since it now has a workloads component that works outside of the binary installed by dotnetCorePackages.sdk_X_Y as well as tools that are also precompiled binaries downloaded from nuget.

Metadata

@GGG-KILLER
Copy link
Contributor Author

GGG-KILLER commented Jul 21, 2022

For what it's worth, I've tried to use this extension with pkgs.vscode-extensions.extensionsFromVscodeMarketplace but it fails down the line. I'll try to get the exact error to post here.

EDIT:
Seems like the "prebuilt" containers work (at least the C# (.NET) template at least did), but custom ones don't.

Error reproduction steps:

  1. Ctrl + Shift + P
  2. Remote-Containers: Add Development Container Configuration Files
  3. Select Debian
  4. Select bullseye
  5. In additional features, select the following:
  • Dotnet CLI (latest version)
  • Node.js (via nvm) and yarn (lts version)
  1. Select "Reopen in Container" on the dialog that pops up on the bottom left (if you miss it, run the Developer: Reload Window command)

The following error is output:

[2022-07-21T23:02:41.542Z] Error: EACCES: permission denied, open '/tmp/vsch-ggg/container-features/0.242.0-1658444561523/local-cache/devcontainer-features.env'

(full log output, devcontainer.json and Dockerfile in this gist)

@das-g
Copy link
Member

das-g commented Feb 13, 2023

With

{
  # …
  environment.systemPackages = with pkgs; let
    vscodiumExtensions = (with vscode-extensions; [
      # …
    ]) ++ vscode-utils.extensionsFromVscodeMarketplace [
      # …
      {
        publisher = "ms-vscode-remote";
        name = "remote-containers";
        version = "0.269.0";
        sha256 = "sha256-8HY46AKbAU5W01BN4iwCUSFqTXfRbC937Gy0kvPTmn4=";
      }
    ];
    vscodium-with-extensions = pkgs.vscode-with-extensions.override {
      vscode = vscodium;
      vscodeExtensions = vscodiumExtensions;
    };
    vscode-with-extensions = pkgs.vscode-with-extensions.override {
      vscodeExtensions = vscodiumExtensions;
    };
  in [
    # …
    vscodium-with-extensions
    vscode-with-extensions
    # …
  ];
  # …
}

in /etc/nixos/configuration.nix, development containers work for me in VSCode 1.75.0, but not in VSCodium 1.75.0. (The latter might be expected, see microsoft/vscode-remote-release#1925.)

Output of nix-info -m:

  • system: "x86_64-linux"
  • host os: Linux 5.15.91, NixOS, 23.05 (Stoat), 23.05pre451903.5a350a8f31b
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.13.2
  • channels(root): "nixos"
  • channels(das-g): ""
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos

@GGG-KILLER
Copy link
Contributor Author

Yeah, it seems to be working fine now without any modifications.

I'll close this as it can be added with pkgs.vscode-utils.extensionsFromVscodeMarketplace.

@robertodr
Copy link
Contributor

robertodr commented Mar 6, 2023

I'm still getting Unable to write file 'vscode-remote:https://dev-container+2f746d702f626172666f6f/workspaces/barfoo/foo.py' (NoPermissions (FileSystemError): Error: EACCES: permission denied, open '/workspaces/barfoo/foo.py') with VSCode 1.76 (either installed in systemPackages or with home-manager) I've tried both the latest version and 0.269.0 for the extension.

EDIT I've been testing with the default Python 3 dev container.

@das-g
Copy link
Member

das-g commented Mar 6, 2023

Yeah, it seems to be working fine now without any modifications.

I'll close this as it can be added with pkgs.vscode-utils.extensionsFromVscodeMarketplace.

It might be worth to have this extension explicitly in NixPkgs, as it can be difficult for users to figure out,

  • what version of the plugin they need for the VSCode version in NixPkgs
  • what the hash corresponding to that plugin version shall be

Should we thus re-open this issue? Or create a new one?

(Edit: Re-opened inadvertently when posting this comment due to hitting the wrong button. I'll leave it open for now, though.)

@das-g das-g reopened this Mar 6, 2023
@GGG-KILLER
Copy link
Contributor Author

I think re-opening should be enough as it has not been packaged and it seems people are running into issues running it.

@carlthome
Copy link
Contributor

Personally think pretty much all the Remote Development extensions (https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack) are interesting enough to have them in nixpkgs directly. As a nixpkgs user I'd expect most of the "official" VS Code extensions to be included.

@robertodr
Copy link
Contributor

Does anyone have suggestions/workarounds on how to get this extension to work? Using the vscode-fhs package and installing the extension impurely doesn't help...

@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/using-vscode-devcontainers/29179/1

@GGG-KILLER
Copy link
Contributor Author

GGG-KILLER commented Jun 16, 2023

I have it working for me by using this:

        extensionsFromVscodeMarketplace [
          {
            publisher = "ms-vscode-remote";
            name = "remote-containers";
            version = "0.294.0";
            sha256 = "sha256-Lnwan4jT5cQ/0ymd3skxS3cAhXZdwvKDRjzheX1Hqf4=";
          }
        ];

@robertodr
Copy link
Contributor

Thanks @GGG-KILLER, but that still doesn't work for me :( Which version of VSCode are you running?

Unable to write file 'vscode-remote:https://dev-container+7b22686f737450617468223a222f686f6d652f726f626572746f2f576f726b73706163652f726f626572746f64722f7673636f6469756d2d70726f6a656374222c22636f6e66696746696c65223a7b22246d6964223a312c22667350617468223a222f686f6d652f726f626572746f2f576f726b73706163652f726f626572746f64722f7673636f6469756d2d70726f6a6563742f2e646576636f6e7461696e65722f646576636f6e7461696e65722e6a736f6e222c2265787465726e616c223a2266696c653a2f2f2f686f6d652f726f626572746f2f576f726b73706163652f726f626572746f64722f7673636f6469756d2d70726f6a6563742f2e646576636f6e7461696e65722f646576636f6e7461696e65722e6a736f6e222c2270617468223a222f686f6d652f726f626572746f2f576f726b73706163652f726f626572746f64722f7673636f6469756d2d70726f6a6563742f2e646576636f6e7461696e65722f646576636f6e7461696e65722e6a736f6e222c22736368656d65223a2266696c65227d7d/workspaces/vscodium-project/crap.txt' (NoPermissions (FileSystemError): Error: EACCES: permission denied, open '/workspaces/vscodium-project/crap.txt')

@GGG-KILLER
Copy link
Contributor Author

@robertodr I'm using the nixpkgs vscode:
image

@robertodr
Copy link
Contributor

Only difference appears to be in the Linux kernel version 🤔

Version: 1.79.0
Commit: b380da4ef1ee00e224a15c1d4d9793e27c2b6302
Date: 2023-06-07T14:28:44.251Z
Electron: 22.5.5
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Linux x64 6.3.6

@robertodr
Copy link
Contributor

The problem was that my UID (1001) was not being remapped to the UID of the vscode user in the container (1000) I changed my UID and now the extension works 🎉

@kenranunderscore
Copy link
Contributor

kenranunderscore commented Sep 6, 2023

I had/have the same UID remapping problem as well. Do you know of any workaround that doesn't require me to change my UID?

(When trying to debug this, I remember wondering why it didn't remap the UID. The extension code runs into a case where it decides "nothing to do", even though I would think it should actually do something.)

@Clockwork-Muse
Copy link

@kenranunderscore - If you manually install the common-utils extension (and don't use a base image with it built-in), you can manually set the UID of the internal user.

Keep in mind that if you persist the definition to a shared repo that this might cause problems if the other users don't have the same UID and it doesn't automap.

@superherointj superherointj changed the title Packaging request for VSCode Extension: Remote - Containers Packaging request for vscode-extensions.ms-vscode-remote.remote-containers Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants