Skip to content

Instantly share code, notes, and snippets.

@hydrz
Last active August 17, 2021 15:08
Show Gist options
  • Save hydrz/18948cdc31bbd476bf4caf24ab672dbc to your computer and use it in GitHub Desktop.
Save hydrz/18948cdc31bbd476bf4caf24ab672dbc to your computer and use it in GitHub Desktop.
vscode for multipass or ssh-remote and the command line
#! /usr/bin/env sh
# requirements
# psexec https://docs.microsoft.com/en-us/sysinternals/downloads/pstools
# openssh server https://github.com/PowerShell/Win32-OpenSSH
INSTANCE=primary
WINDOWS_USERNAME=administrator
WINDOWS_IP=$(route -n | grep "eth0" | grep 'UG[ \t]' | awk '{print $2}')
if [ "$@" ]; then
WORK=$(realpath $@)
fi
ssh "$WINDOWS_USERNAME@$WINDOWS_IP" "psexec \\\\127.0.0.1 -i -d \"C:\\Users\\nan\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe\" --remote=ssh-remote+$INSTANCE $WORK"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment