Skip to content

Instantly share code, notes, and snippets.

@dahlia
Last active October 23, 2022 09:44
Show Gist options
  • Save dahlia/f7804869ae8bfe40f040c7824d1816cf to your computer and use it in GitHub Desktop.
Save dahlia/f7804869ae8bfe40f040c7824d1816cf to your computer and use it in GitHub Desktop.
Dirty workaround to let VS Code Live Share run on Apple silicon Macs without Rosetta 2

As of June 2022, VS Code's Live Share still does not work well on Apple silicon Macs (M1/M2 series) without Rosetta 2. Although this bug is tracked in the official issue tracker on GitHub, unfortuneately, Live Share extension is not open source, so no outsiders can send any patch to address this bug to the upstream. Instead, I'd like to share a workaround I found:1

  1. Install .NET SDK 6 (arm64) or higher. It's also available on Homebrew Cask: brew install --cask dotnet-sdk.

  2. Replace vsls-agent (no postfix) in ~/.vscode/extensions/ms-vsliveshare.vsliveshare-*/dotnet_modules/ directory (use your version instead of *) with vsls-agent included in this Gist.

  3. Make it executable: chmod +x ~/.vscode/extensions/ms-vsliveshare.vsliveshare-*/dotnet_modules/vsls-agent.

  4. Reload VS Code.

That's all. Of course, this dirty fix will be overwritten when the Live Share extension is upgraded.

Footnotes

  1. If you are interested in the details, please see my previous comments too: A & B.

#!/bin/bash
set -eou pipefail
if ! command -v dotnet > /dev/null || [[ "$(dotnet --version)" != 6.* ]]; then
echo Install .NET SDK 6 or higher first. >&2
exit 1
fi
runtime_version="$( \
dotnet --list-runtimes \
| grep '^Microsoft.NETCore.App\b' \
| awk '{ print $2 }'
)"
dotnet --fx-version "$runtime_version" \
"$(dirname "$0")/vsls-agent.dll" \
"$@" || exit $?
@elroychua
Copy link

Thanks for this! Was wondering if you had a solution for Live Share audio? Seems to still have issues on Monterrey.

@dahlia
Copy link
Author

dahlia commented Oct 23, 2022

@elroychua Unfortunately, no. I've never tried to use Live Share Audio, so haven't needed a workaround for it for myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment