Skip to content

Sanity Check VS Code Servers

Christof Marti edited this page Feb 2, 2023 · 25 revisions

Linux Platforms

Note: You can run this test from either Linux or Windows.

Pre-requisites

Steps

  1. Install VS Code at the exact version (commit) that needs sanity checking.
  2. Install the Remote-Containers extension.
  3. Run the following commands. They register the QEMU hardware emulator and start 5 kinds of containers:
docker run --privileged --rm tonistiigi/binfmt --install all

docker run -d amd64/ubuntu sleep inf
docker run -d arm64v8/ubuntu sleep inf
docker run -d arm32v7/ubuntu /bin/sh -c 'apt update && apt install -y libatomic1 && sleep inf'
docker run -d amd64/alpine sleep inf
docker run -d arm64v8/alpine sleep inf
  1. Check that you can connect to each of the containers from the Remote Explorer.
    • Check which platform you are on by running uname -m from the integrated terminal. (Expect: x86_64, armv7l and aarch64)
    • Alpine Linux runs on x86_64 and aarch64, check cat /etc/os-release shows Alpine as the distro.
  2. Use the Remote Explorer to remove the containers. (Note that the current window's container cannot be removed, use a new window instead.)

Windows

Use the Remote-SSH extension to connect from any client platform to a Windows remote. You can connect to localhost on your own Windows machine, a parallels VM, or another machine. You'll need to set up and start OpenSSH services, such as the OpenSSH SSH Server service and the OpenSSH Authentication Agent service.

Note: if you are an AAD user on your Windows machine, you may have to apply this workaround.

Here is an example localhost config that can be added to your SSH config file:

Host localhost
    HostName localhost
    User <username>@microsoft.com

Where <username> can be found by running whoami /user on cmd.exe. When connecting, the password is the same as the user password (which might be the Active Directory password, but definitely not the login pin).

Set the undocumented setting "remote.SSH.force32bitWindows": true to force a 32-bit VS Code server to be installed on a 64-bit Windows host.

macOS

Use the Remote-SSH extension to connect from any client platform to a macOS remote (connecting to localhost is ok). To start the SSH server, you just have to enable Remote Login as described here.