mirror of
https://github.com/VSCodium/vscodium.git
synced 2026-04-09 20:50:20 -05:00
Make the WSL remote extension work in VS Codium #729
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @wolfygit on GitHub.
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'
@0reo commented on GitHub:
this works. i also need to make a couple of links but that could be just my config using WSL. replace
COMMIT_HASHwith whatever you have locally after step 3@daiyam commented on GitHub:
@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.
@unedited-despair commented on GitHub:
Thank you, great work.
I however perceive two flaws with the hack:
Firstly, step 6 basically allows unauthorized clients to connect.
Secondly, as soon as you launch Codium in a WSL folder, a folder ~/.vscode-server gets created&populated in the WSL.
Also, instead of changing the condition to
falsein step 6, you can just remove the exclamation mark.@mpql commented on GitHub:
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
.vscode-server. If I'm reading it right, I don't think the authorization is an issue, because there are other instances to check for auth mismatch and protocol, whereas the one we're changing just seems like it's designed to break things like Codium..vsix, in this casems-vscode-remote.remote-wsl-0.72.0.vsixfrom VS Marketplace using the below javascriptlet..vsix; dragging it into the extensions pane worked for me.%USERPROFILE%\.vscode-oss\extensions\ms-vscode-remote.remote-wsl-0.72.0\scripts\wslDownload.sh(changing as necessary for your installed version), replace all instances ofcommit:$COMMITwithlatest.1.74.2, get the commit hash for the release of VSCode1.74.2from VSCode's repo. For me, this looked like:Save these commit hashes for later, as you'll need them.
%USERPROFILE%\.vscode-oss\extensions\ms-vscode-remote.remote-wsl-0.72.0\scripts\wslServer.sh, replaceSERVER_APPNAME=$3withSERVER_APPNAME="code-server".${HOME}/.vscodium-server/bin/d2c422ca15f1fbc976eed3e02e3392bbb39c5824/product.json, replace thecommitvalue with the VS Codium commit hash from earlier, in this case:d2c422ca15f1fbc976eed3e02e3392bbb39c5824. You can also get this from the value ofcommitinVSCodium\resources\app\product.json, from Codium's install directory, which is what clued me in to my having a partial upgrade earlier, as myversionvalue was outdated.${HOME}/.vscodium-server/bin/d2c422ca15f1fbc976eed3e02e3392bbb39c5824/out/vs/server/node/server.main.js, whered2c422ca15f1fbc976eed3e02e3392bbb39c5824is the latest Codium releases's commit hash, replacereturn fe("Unauthorized client refused);withconsole.warn("Ignoring: Unauthorized client refused");, wherefemight be a different obfuscation.-sif you don't):-frshere to force link creation if you've already made links earlier and want to replace them.Java Scriptlet to Download
.vsixfrom VS MarketplaceRegarding 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
vscodium.now.shdownloads is.@dbarrerap commented on GitHub:
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
ve).@mpql commented on GitHub:
Thanks for sharing, @eternalphane! I will try this out on my next
WindowsCodium install and report back. 😄@awebeer256 commented on GitHub:
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:
code-server -> codium-serverin~/.vscodium-server/bin/<hash>/bin, before it would work.@eternalphane commented on GitHub:
Ultimate solution to make WSL extension work, no need to modify any vendor files
Add the following lines to
~/.vscodium-server(-insiders)/server-env-setup:@mpql commented on GitHub:
@daiyam The most recent licensing terms in
Microsoft/vscode-remote-releasemention in the commit that they are trying to "clarify" that the license is only for the repo, but a) if you compile something from that code you can then use it however you like under that repo's terms (their compilation is, of course, the more restrictive terms), and b) as I understand it, even as the author, they cannot re-license it under more restrictive terms, they'd need to start a new repo and new codebase.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.
@jacksongoode commented on GitHub:
Wow this is a hassle - especially as it updates for later version! A script for this would be so great :)
@FMGordillo commented on GitHub:
Just doing the first two comments was running smooth for me!
I'm assuming that we will miss out extension updates for this, right?
Another question, how was your experience working with Extensions?

@awebeer256 commented on GitHub:
@jacksongoode Assuming the WSL extension works on those platforms, the procedure should work just as well. The only complication would be finding the
.vscode-ossfolder.On Linux, I'd recommend looking in:
~/.config$XDG_CONFIG_HOME(if it exists and is different than~/.config)~/.config/VSCodium(recursive)~/.var/app/com.vscodium.codium(recursive) (Flatpak only)For Mac, I dunno. You could open up a terminal and search in the same places as in Linux.
@jacksongoode commented on GitHub:
@awebeer256 is there a similar script for Mac/Linux?
@awebeer256 commented on GitHub:
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
%userprofile%\.vscode-oss\extensions\ms-vscode-remote.remote-wsl-0.72.0\scripts\wslServer.sh. On line 6, we haveSERVER_APPNAME="code-server". Changecode-servertocodium-server.Edit for posterity:
0.72.0is the extension's version number, so the exact path will change in the future to reflect that.@mpql commented on GitHub:
Thanks for letting us know! Yeah, it breaks on updates. I'll have to switch methods next update. Cheers! 🍻
@timzuiddam commented on GitHub:
With WSL, every extension I try to install results in:
[error] CorruptZip: end of central directory record signature not foundSomeone already tackled this problem?
Context:
@SuhasHebbar commented on GitHub:
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)
sudo /path/to/sshd -D.-Druns sshd in the foreground, but you can skip it if you want I guess. In case you face issues there are plenty of online resources on how to run an ssh server.Host my_wsl
Hostname 127.0.0.1
User
Port 22 # Or something else if you modified the default sshd config.
open-remote-ssh will download the matching VSCodium remote extension host release from github releases and set it up on the remote host.
@TiLopes commented on GitHub:
@SuhasHebbar what is the performance like? Can I just edit files from WSL just fine? How would I setup the ssh connection?
@TiLopes commented on GitHub:
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.
@SuhasHebbar commented on GitHub:
Workaround for folks who don't know about it.
If you don't want to break Microsoft's T&C on their proprietary extensions, you can use https://github.com/jeanp413/open-remote-ssh.
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
sudo /path/to/sshd -D@Stivux commented on GitHub:
I have WSL in Codium running with vscodium-reh-linux. It works without changing any files!
I also wrote this script to install/update vscodium-server (wget must be installed in your WSL-distro)
Save it as a .cmd file and run it from cmd
@celikj commented on GitHub:
@jeanp413 commented on GitHub:
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
@jake-is-ESD-protected commented on GitHub:
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
@kevinfiol commented on GitHub:
It is great! Thank you. I would make a note in the README that your WSL instance must have either
curlorwgetinstalled (fresh Debian WSL installs do not).@celikj commented on GitHub:
how does dev containers work?
@benzo-diazepine commented on GitHub:
At this point I wonder if it wouldn't be easier to allow overriding the COMMIT ID of codium.. if that is even possible
@tadghh commented on GitHub:
Yeah that would be helpful, dev containers does work when you follow this guide btw
@tadghh commented on GitHub:
Feel like this could be done with the dev containers extension aswell
@tadghh commented on GitHub:
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
@celikj commented on GitHub:
I cant install the extension Unable to install extension 'ms-vscode-remote.remote-containers' as it is not compatible with VSCodium '1.85.2'.
@celikj commented on GitHub:
ok I managed to install by changing the vsix file. done. someone should make a clean tutorial.
@tadghh commented on GitHub:
Can you list what you changed? I just installed an older version of the Dev Containers extension to get around that issue
@julihermes commented on GitHub:
Work for me using Remote Explorer in Activity Bar, but, the command codium from wsl not connecting, instead, open mounted wsl folder.
Is there any additional step to do?
@celikj commented on GitHub:
in vsix open package.json and youwll see a version and change it to yours or a lower version.
@CompeyDev commented on GitHub:
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
/tmpit gets prepended to the path again leading to a path like/tmp/tmp/${filename}.This can be fixed like so:
@agreedSkiing commented on GitHub:
Contributing to this issue also with my workaround based on @Stivux code but done from the wsl installation.
Windows: Install either open-remote-wsl or vsix-manager to install the offical ms-vscode-remote.remote-wsl (requires the config below and that VSIX Manager: Install externsion command has been executed from VSCodium in windows)
vsix-manager-config
WSL terminal: Install VSCodium in you wsl with the bash script below which is converted from @Stivux script
Depending on what extension you installed in step 1 do either a or b below.
a. open-remote-wsl: Use the remote explorer in your vscodium to connect to the wsl distrobution
b. vsix-manager + ms-vscode-remote.remote-wsl: Either use the remote explorer in your vscodium to connect to the wsl distrobution or use the a terminal that i connected to the wsl distrobution and write
P.S. I have only tested my code on Win 10 with a system install of VSCodium (1.89.1.24130) with Ubuntu-22.04 and the wsl version below
@agreedSkiing commented on GitHub:
@tadghh wish that worked for me with open-remote-wsl but for some reason the download fails :/ https://github.com/jeanp413/open-remote-wsl/issues/9
@CompeyDev commented on GitHub:
Heads up - the latest WSL Extension v0.88.4 forbids sideloading altogether. See https://github.com/getcursor/cursor/issues/2027.
@tadghh commented on GitHub:
You can also change the WSL download template from within VSCodium

@vvirtues commented on GitHub:
Sorry for commenting on an old and relevant issue, but is there a full solution to this? I see a couple answers and not sure which one to follow