-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make the WSL remote extension work in VS Codium #1265
Comments
this works. i also need to make a couple of links but that could be just my config using WSL. replace
|
Just as an update, on step 6, search for "Unauthorized client refused". There should be 2 instances, apply the fix to the second search result. The variable name changes in different versions, apparently (for me it was |
Thank you, great work. I however perceive two flaws with the hack: Also, instead of changing the condition to |
Here's kind of a roll-up of everything above, along with a few extra additions for issues I ran into. Also, addressing mikefarmer01's comment above, we create a symlink for
Java Scriptlet to Download javascript:(function() {const URL_VSIX_PATTERN = 'https://marketplace.visualstudio.com/_apis/public/gallery/publishers/${publisher}/vsextensions/${extension}/${version}/vspackage';let itemName = new URL(window.location.href).searchParams.get('itemName');let[publisher,extension] = itemName.split('.');let version = document.querySelector('#versionHistoryTab tbody tr .version-history-container-column').textContent;let url = URL_VSIX_PATTERN.replace('${publisher}', publisher).replace('${extension}', extension).replace('${version}', version);window.open(url, '_blank');})(); Regarding the issue itself, I feel like it would be trivial to automate these changes and fix the download (assuming it's not something on my end). I'd be happy to submit a PR to this end if someone can direct me to where the logic for creating the |
@mpql This is a license issue. Most Microsoft extensions became closed-source and have a license limiting them to be used only with Microsoft products. If you want, you can use the extension VSIX Manager to automate the install of extensions from different marketplaces. The best would be to have an open-source equivalent of that extension. |
@daiyam The most recent licensing terms in In addition to that, changing targets isn't reverse engineering, as JavaScript isn't compiled in the first place. Either a) Codium is not a Microsoft product, and thus running your own extension isn't either, or b) they both are and it falls under the license's use terms. These are just my personal takes, and I realize y'all are likely CYA. Thanks for the recommendation for VSIX Manager, I hadn't heard of that. That wouldn't do anything to extend licenses, but do you have any marketplace recommendations for working remote extensions?
Agreed. I wish they would, but I'm pretty sure Microsoft is too busy huffing their open core nonsense. They get to steal your data, or they try to stop you from using it with your OS lol. |
Wow this is a hassle - especially as it updates for later version! A script for this would be so great :) |
Ultimate solution to make WSL extension work, no need to modify any vendor filesAdd the following lines to # uncomment the following line to enable debugging
#export VSCODE_WSL_DEBUG_INFO=true
fix_download() {
case "$QUALITY" in
stable)
local repo_name='vscodium'
local app_name='codium';;
insider)
local repo_name='vscodium-insiders'
local app_name='codium-insiders';;
*)
echo "unknown quality: $QUALITY" 1>&2
return 1;;
esac
local ps='/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe'
local cmd="(Get-Command $app_name).Path | Split-Path | Split-Path"
local install_dir=$(wslpath -u "$($ps -nop -c "$cmd | Write-Host -NoNewLine")")
local product_json="$install_dir/resources/app/product.json"
local release=$(jq -r .release "$product_json")
local version=$(jq -r .version "$product_json" | sed "s#\(-$QUALITY\)\?\$#.$release&#")
local arch=$(uname -m)
case $arch in
x86_64)
local platform='x64';;
armv7l | armv8l)
local platform='armhf';;
arm64 | aarch64)
local platform='arm64';;
*)
echo "unknown machine: $arch" 1>&2
return 1;;
esac
local url="https://github.com/VSCodium/$repo_name/releases/download/$version/vscodium-reh-linux-$platform-$version.tar.gz"
export VSCODE_SERVER_TAR=$(curl -fLOJ "$url" --output-dir /tmp -w '/tmp/%{filename_effective}')
export REMOVE_SERVER_TAR_FILE=true
}
[ "$VSCODE_WSL_DEBUG_INFO" = true ] && set -x
if [ ! -d "$HOME/$DATAFOLDER/bin/$COMMIT" ]; then
set -e
fix_download
set +e
fi
unset fix_download
|
Thanks for sharing, @eternalphane! I will try this out on my next |
I used @mpql's solution, and then installed an update to codium, which broke it. Instead of redoing it to make it work again, I used @eternalphane's solution, but then I still had to create a symlink in WSL: |
Thanks for letting us know! Yeah, it breaks on updates. I'll have to switch methods next update. Cheers! 🍻 |
New development: what I describe above still breaks on updates to Codium, but I believe the following will instead break on updates to the WSL remote extension, which I believe are much less frequent. Instead of creating the symlink like I describe above, edit the (Windows) file Edit for posterity: |
@awebeer256 is there a similar script for Mac/Linux? |
@jacksongoode Assuming the WSL extension works on those platforms, the procedure should work just as well. The only complication would be finding the On Linux, I'd recommend looking in:
For Mac, I dunno. You could open up a terminal and search in the same places as in Linux. |
I have been trying to make WSL work with VSCodium but I can't get it to work. I have tried using @eternalphane script and make @awebeer256 change to wslServer.sh but it seems they have removed the SERVER_APPNAME line. WSL extension version: 0.78.7 Any input is appreciated. |
Workaround for folks who don't know about it. It functions similarly to the remote ssh extension by Microsoft. You'll just need to have an ssh server running in WSL either via systemd or manually call |
@SuhasHebbar what is the performance like? Can I just edit files from WSL just fine? How would I setup the ssh connection? |
I just recently nuked my Windows installation and replaced it with archlinux, so I am mostly listing out things from memory. I did not face any issues with performance over regular VSCode since there is no network lag in connecting to WSL. In fact, the experience isn't really different from Microsoft's remote ssh extension for the most part. Setup (The extension README explains things pretty clearly)
open-remote-ssh will download the matching VSCodium remote extension host release from github releases and set it up on the remote host. |
With WSL, every extension I try to install results in: Someone already tackled this problem? Context:
|
I have WSL in Codium running with vscodium-reh-linux. It works without changing any files!
|
|
I just published a new extension for wsl support, I only tested with windows 11 and wsl 2 though, please give it a try https://open-vsx.org/extension/jeanp413/open-remote-wsl |
I just tried your extension and it is the BOMB, thank you so much, keep it up! Works like a charm on my Win11 ARM device. Expect many more downloads |
It is great! Thank you. I would make a note in the README that your WSL instance must have either |
Feel like this could be done with the dev containers extension aswell |
At this point I wonder if it wouldn't be easier to allow overriding the COMMIT ID of codium.. if that is even possible |
Yeah that would be helpful, dev containers does work when you follow this guide btw |
how does dev containers work? |
download the extension, create a new container, in the docker volume it creates follow the steps in here for wsl, replacing the is statement and the commit id. vscodium will need to have the same commit id ad thats checked when downloading new images. On a unrelated note the if statement for "isBuilt" doesnt happen with VSCode Canary so you would only need to replace the commit id. There another way to do it where I used WSL, and had docker run through there and used the WSL extension too. Overall its really buggy still. If theres someway to enable like "development mode" with codium so we can skip that "isBuilt" and also mock the latest commit id from official vscode that would get around this |
I cant install the extension Unable to install extension 'ms-vscode-remote.remote-containers' as it is not compatible with VSCodium '1.85.2'. |
ok I managed to install by changing the vsix file. done. someone should make a clean tutorial. |
Can you list what you changed? I just installed an older version of the Dev Containers extension to get around that issue |
in vsix open package.json and youwll see a version and change it to yours or a lower version. |
Work for me using Remote Explorer in Activity Bar, but, the command codium from wsl not connecting, instead, open mounted wsl folder. |
Heads up - the latest WSL Extension v0.88.4 forbids sideloading altogether. See getcursor/cursor#2027. |
There's a small issue with this script, mainly the command exporting the file path on new cur;l; since the output directory is already This can be fixed like so: - export VSCODE_SERVER_TAR=$(curl -fLOJ "$url" --output-dir /tmp -w '/tmp/%{filename_effective}')
+ export VSCODE_SERVER_TAR=$(curl -fLOJ "$url" --output-dir /tmp -w '%{filename_effective}') |
After a while I managed to make the extension work with these changes:
1.Download the .vsix from https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl and install manually from the extensions section
2.In the file: C:\Users\%USERNAME%\.vscode-oss\extensions\ms-vscode-remote.remote-wsl-0.66.3\scripts\wslDownload.sh replace all "commit:$COMMIT" with "latest"
3.Open the extension And wait the download of the .vscodium-server within WSL user profile
4.In the file C:\Users\%USERNAME%\.vscode-oss\extensions\ms-vscode-remote.remote-wsl-0.66.3\scripts\wslServer.sh replace 'SERVER_APPNAME=$3' with 'SERVER_APPNAME="code-server"'
5.In the file \\wsl$\Ubuntu\%USERNAME%\.vscodium-server\bin\%COMIT_ID%\product.json replace the value of the "commit": with the same value of "commit": found in your %VSCODIUM_INSTALLATION_DIRECTORY%\VSCodium\resources\app\product.json
6.In the file \\wsl$\Ubuntu\%USERNAME%\.vscodium-server\bin\%COMIT_ID%\out\vs\server\node\server.main.js search "if(!ye){if(this._environmentService.isBuilt)return ie("Unauthorized client refused")" and change the first if condition from '!ye' to 'false'
The text was updated successfully, but these errors were encountered: