From fa3bb0c8cda70f0ddeecf2b33b3f109049b1284d Mon Sep 17 00:00:00 2001 From: Niko Lappalainen <16636564+NimatLa@users.noreply.github.com> Date: Sun, 13 Sep 2026 13:06:55 +0000 Subject: [PATCH 1/2] Test for vcpkg install with remote user --- test/vcpkg.io/install_with_remote_user.sh | 9 +++++++++ test/vcpkg.io/scenarios.json | 9 +++++++++ 2 files changed, 18 insertions(+) create mode 100644 test/vcpkg.io/install_with_remote_user.sh create mode 100644 test/vcpkg.io/scenarios.json diff --git a/test/vcpkg.io/install_with_remote_user.sh b/test/vcpkg.io/install_with_remote_user.sh new file mode 100644 index 0000000..bbfc10a --- /dev/null +++ b/test/vcpkg.io/install_with_remote_user.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +source dev-container-features-test-lib + +check "install simple package with remote user" bash -c "vcpkg install vcpkg-cmake" + +reportResults diff --git a/test/vcpkg.io/scenarios.json b/test/vcpkg.io/scenarios.json new file mode 100644 index 0000000..07a12c7 --- /dev/null +++ b/test/vcpkg.io/scenarios.json @@ -0,0 +1,9 @@ +{ + "install_with_remote_user": { + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", + "remoteUser": "vscode", + "features": { + "vcpkg.io": {} + } + } +} \ No newline at end of file From ada2de21bc35a1cdbcda8d3643f74f19b01c9d15 Mon Sep 17 00:00:00 2001 From: Niko Lappalainen <16636564+NimatLa@users.noreply.github.com> Date: Sun, 13 Sep 2026 13:24:03 +0000 Subject: [PATCH 2/2] Give group permissions to VCPKG root Signed-off-by: Niko Lappalainen <16636564+NimatLa@users.noreply.github.com> --- src/vcpkg.io/install.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/vcpkg.io/install.sh b/src/vcpkg.io/install.sh index 8c26f70..e667306 100755 --- a/src/vcpkg.io/install.sh +++ b/src/vcpkg.io/install.sh @@ -32,6 +32,13 @@ install() { git clone https://github.com/microsoft/vcpkg "$vcpkgRoot" "$vcpkgRoot/bootstrap-vcpkg.sh" -disableMetrics ln -s "$vcpkgRoot/vcpkg" /usr/local/bin/vcpkg + + if [ ${_REMOTE_USER} != "root" ]; then + groupadd vcpkg + chown -R root:vcpkg $vcpkgRoot + chmod g+w $vcpkgRoot + usermod -aG vcpkg ${_REMOTE_USER} + fi } echo_banner "devcontainer.community" echo "Installing $name..."