diff --git a/.evergreen.yml b/.evergreen.yml
index 1f4ef74f16..44db146d61 100644
--- a/.evergreen.yml
+++ b/.evergreen.yml
@@ -3597,9 +3597,13 @@ functions:
           set -e
           {
           source .evergreen/setup-env.sh
-          (cd scripts/docker && docker build -t ubuntu22.04-xvfb -f ubuntu22.04-xvfb.Dockerfile .)
+          (cd scripts/docker && docker build -t ubuntu24.04-xvfb -f ubuntu24.04-xvfb.Dockerfile .)
+          apt list --installed
+          sudo apt-get update
+          sudo apt-get install -y curl=7.68.0-1ubuntu2.22 libcurl4=7.68.0-1ubuntu2.22 libcurl4-openssl-dev=7.68.0-1ubuntu2.22
+
           docker run \
-            --rm -v $PWD:/tmp/build ubuntu22.04-xvfb \
+            --rm -v $PWD:/tmp/build ubuntu24.04-xvfb \
             -c 'cd /tmp/build && ./testing/test-vscode.sh'
           }
   test_connectivity:
diff --git a/.evergreen/evergreen.yml.in b/.evergreen/evergreen.yml.in
index 30ca79aa1c..5f2b1013f3 100644
--- a/.evergreen/evergreen.yml.in
+++ b/.evergreen/evergreen.yml.in
@@ -306,9 +306,9 @@ functions:
           set -e
           {
           source .evergreen/setup-env.sh
-          (cd scripts/docker && docker build -t ubuntu22.04-xvfb -f ubuntu22.04-xvfb.Dockerfile .)
+          (cd scripts/docker && docker build -t ubuntu24.04-xvfb -f ubuntu24.04-xvfb.Dockerfile .)
           docker run \
-            --rm -v $PWD:/tmp/build ubuntu22.04-xvfb \
+            --rm -v $PWD:/tmp/build ubuntu24.04-xvfb \
             -c 'cd /tmp/build && ./testing/test-vscode.sh'
           }
   test_connectivity:
diff --git a/scripts/docker/ubuntu22.04-xvfb.Dockerfile b/scripts/docker/ubuntu24.04-xvfb.Dockerfile
similarity index 84%
rename from scripts/docker/ubuntu22.04-xvfb.Dockerfile
rename to scripts/docker/ubuntu24.04-xvfb.Dockerfile
index ce599c03d9..10808d68f1 100644
--- a/scripts/docker/ubuntu22.04-xvfb.Dockerfile
+++ b/scripts/docker/ubuntu24.04-xvfb.Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:22.04
+FROM ubuntu:24.04
 
 ENV DEBIAN_FRONTEND=noninteractive
 RUN apt-get update
@@ -11,6 +11,6 @@ RUN echo "deb-src https://deb.nodesource.com/node_20.x jammy main" | tee -a /etc
 
 # Install Node.js and vscode dependencies
 RUN apt-get update
-RUN apt-get -y -qq install nodejs libnss3 gnupg libxkbfile1 libsecret-1-0 libsecret-1-dev libgtk-3-0 libxss1 libgbm1 libasound2 xvfb build-essential pkg-config
+RUN apt-get -y -qq install nodejs libnss3 gnupg libxkbfile1 libsecret-1-0 libsecret-1-dev libgtk-3-0t64 libxss1 libgbm1 libasound2t64 xvfb build-essential pkg-config
 
 ENTRYPOINT [ "bash" ]
diff --git a/testing/reproduce.sh b/testing/reproduce.sh
new file mode 100644
index 0000000000..7819e175cb
--- /dev/null
+++ b/testing/reproduce.sh
@@ -0,0 +1,6 @@
+# This file is not meant to be included, just a script to reproduce the issue like in evergreen.
+
+(cd scripts/docker && docker build -t ubuntu24.04-xvfb -f ubuntu24.04-xvfb.Dockerfile .)
+docker run \
+    --rm -v $PWD:/tmp/build ubuntu24.04-xvfb \
+    -c 'cd /tmp/build && ./testing/test-vscode.sh'
diff --git a/testing/test-vscode.sh b/testing/test-vscode.sh
index 9635ef75ef..d8e1e21c63 100755
--- a/testing/test-vscode.sh
+++ b/testing/test-vscode.sh
@@ -1,6 +1,7 @@
 #!/bin/sh
 set -x
 set -e
+
 # just to make sure: we are in the mongosh root dir
 test -x packages && grep -q '"name": "mongosh"' package.json
 npm -v
@@ -10,9 +11,11 @@ test_root_dir=/tmp/mongosh-vscode-test
 export SEGMENT_KEY=GtEn04CBjn39g6A0BxldDf81YGFONOz7 # fresh from /dev/urandom
 rm -rf "$test_root_dir" && mkdir -p "$test_root_dir"
 cd "$test_root_dir"
-git clone --depth=10 https://github.com/mongodb-js/vscode.git
+git clone --depth=10 https://github.com/mongodb-js/vscode.git --branch gagik/vscode-debug
 cd vscode
-npm install --force
+
+npm ci --omit=optional
+
 rm -rf node_modules/@mongosh node_modules/mongodb
 (cd node_modules && ln -s "$mongosh_root_dir/packages" @mongosh && ln -s "$mongosh_root_dir/node_modules/mongodb" mongodb)
 # This test can require a lot of memory so we bump the maximum size.