How to offline install vscode-server for windows remote target - visual-studio-code

I've been able to follow similar answers for offline installing vscode-server on remote linux targets but I cannot find out how to do this for windows. On the official page for vscode-remote-ssh https://code.visualstudio.com/docs/remote/ssh, it shows that the system requirements for the remote supports Windows 10 / Server 2016/2019 (1803+) using the official OpenSSH Server. So I know it's possible I just can't seem to find the download link that vscode-remote-dev uses to download the windows version of vscode server.
The download link for linux follows this format https://update.code.visualstudio.com/commit:${commit_id}/server-linux-x64/stable would there be a specific endpoint for server-windows? I've tried a bunch of different combinations but I could not get anything.
I'm also making the assumption that there is a different download link but it seems a very unlikely case that linux and windows share the same link.
Any help would be appreciated. I've enjoyed using this for remote dev on linux and now I've got an opportunity to use it on windows.

Instead of using server-linux-x64, server-win32-x64 should be used and it will download the correct windows version of the vscode-server.
I did find this in the comments of this question. Using "Remote SSH" in VSCode on a target machine that only allows inbound SSH connections.

Related

Visual Studio Code remote access to a WSL2:ubuntu on my desktop from my macbook

've looked around and can't seem to find the answer to this - probably because the feature is pretty new.
I tried the remote WSL:ubuntu connection on my windows desktop machine to connect to my WSL2 Ubuntu running on the same machine. This is pretty much perfect as it allows access to my Nvidia GPU under linux
Is there anyway I can do the same trick from my macbook? I can connect to the windows side of the desktop using the new remote tunnel feature but I'm drawing a blank on how to do for the WSL buried in that machine. It looks like it's just using the same remote connection feature so I'm thinking it should be possible but WSL2 network is not exposed the same way you can with a VM or other machine.
The desktop has way more everything than my macbook including a nvidia GPU I want to use for some machine learning.
I can do it from the desktop itself - but it's nice to be able to use that machine from my macbook at certain times of day.
I have recently started using VSCode so I'm on the learning curve with it - it may well be that it's not possible using the new remote tunnels - or requires some messing with adding a new hyper-v bridged adapter to the WSL installation. I'm hoping against hope there's an easy solve that I've somehow missed.
I tried setting up the remote tunnel as per https://code.visualstudio.com/blogs/2022/12/07/remote-even-better but it seems to setup a server to access windows not the WSL2 service.
Thanks for any help!
I had a similar problem and found this github issue. While the developers are looking into including this feature, you currently will need to install the VSCode CLI directly in WSL. You can find the downloads here
Notes
I would recommend the x64 CLI download in the Linux section. It will download a tar.gz file which will have a file named code in it when extracted.
The tunnel will launch from wherever you place that code file, so I put mine in the ~/ (home) directory.
You can then open a tunnel using the command ./code tunnel from that location. You can replace the . with the path to the code file to open the tunnel while in a different directory, i.e. ~/code.
You can still launch a tunnel from Windows with code tunnel. (note that this command does not have ./)

VS Code remote server extension shows "attempting to reconnect"

I use Visual Studio Code and RemoteSSH extension to connect to a remote server located across the ocean via the corporate VPN, The connection gets established when I connect via my mobile hotspot, but it keeps showing "Attempting to reconnect" asking for password repeatedly when I use my broadband.
I have compared the internet speed of both the service providers and below are the results.
1)Airtel hotspot(remote ssh works)
2)Hathway broadband(remote ssh does'nt work)
From the above images it is evident that my broadband speed(upload and download) is much better than my internet hotspot speed, In spite of this I am unable to use remote ssh to code using my broadband network, Is there something that needs to be tweaked, or are the internet speed tests in a way inaccurate?
I had similar experience and there are many threads on the subject, none of which resolved it for me.
I am working on a Windows laptop and connecting to remote Centos linux.
I also connect to company network via their VPN.
I resolved it in the following manner, maybe not all steps are required, but this is what I did -but firstly, I setup ssh keys so as not to have to keep using a password, well worth the effort.
Updated the fileWatcher in code to ignore .git folder and venv folder, this improves performance
Updated WSL to WSL2
Install a linux shell on Windows - I was already using an Ubuntu one, installed prior to vscode, but hints online suggested installing it after vscode, so I installed the Kali shell.
Installed openssh-server (to get ssh-keygen) on kali
Launched code from the kali shell, let it do its setup
Even though all extensions were installed on both machine, vscode didn't recognize that and I had to use the option in the extension section to "install exentsions on remote server"
After that, every thing was fine.
Hope that helps anyone else searching this problem.
In Airtel hotspot, your public IP address remains the same.
In case of Hathway broadband, public IP changes very frequently. So, if your VPN is redirecting you over IP, there may be possibility of delay because of authentication verification.

Developing Flutter with VSCode and WSL2

Since I mostly develop Web, using nginx, PHP and MySQL, I have ported my WebDev-environment entirely to WSL2.
Since performance is very important, all my web-related projects reside on the WSL2-vhdx file /home/user/Projects/Web. In WSL2 I've installed all my necessary tools for a nice and neat Linux-like experience, Docker, GIT, etc.. This combined with VSCode remote integration works very well.
Now, I'm digging into building Flutter-Apps, and my Flutter-environment is installed on the Windows side. My Flutter-related projects reside on D:\Projects\Flutter which is a partition, and NOT USED in WSL2 in any way. Building Flutter-apps with flutter-windows-sdk and VSCode works neatly.
But, the problem is: Now I've my project files scattered all across my computer. Web-stuff in a WSL2-vhdx-file and Flutter-stuff on the D-partition.
Is there a way to build flutter-apps with Flutter, while having the project-files stored on a WSL2-vhdx-file, in combination with VSCode-remote and an Android-emulator?
I tried creating a test Flutter-project on the \\wsl$ network mount, which didn't work.
Moving my web-related project files to the D:\ partition of Windows is no option, since the I/O mounts in WSL2 are extremely slow.
I got it working, reliably with adb connect 192.168.xxx
For anyone interested, see my full blog post here: https://dnmc.in/2021/01/25/setting-up-flutter-natively-with-wsl2-vs-code-hot-reload/
Is there a way to build flutter-apps with Flutter, while having the project-files stored on a WSL2-vhdx-file, in combination with VSCode-remote and an Android-emulator?
I'm assuming (based on the mention of VS Code Remoting) that you want to run the extension in WSL. I haven't tried that specifically, but I have run Flutter inside WSL and also connected a VS Code Remoting session to an Android emulator in the cloud, so I would expect this to work.
You'll need to make sure you set up the Flutter SDK inside WSL (so you can run flutter commands inside WSL - it should be the Linux version of the Flutter SDK and not the Windows one if you're using the zip).
To have your emulator show up in flutter devices from inside WSL, you will likely need to run adb tcpip 5555 from the Windows side (this means you need an Android SDK in Windows) - this will tell your phone to listen on TCP port 5555. Then you'll need to run adb connect [phone ip]:5555 from inside WSL (this means you'll need an Android SDK in Linux). If all goes well, the phone should then show up in adb devices and also be picked up by the device selector in VS Code.
I tried creating a test Flutter-project on the \wsl$ network mount, which didn't work.
It's not clear what went wrong here, though my first guess would be that maybe the UNC path isn't supported - if you map a drive letter to it does it make a difference?
While this isn't an officially supported setup, feel free to raise issues in the Dart-Code repository on GitHub with any issues you have. It's not a priority, but I would like for VS Code Remoting (including WSL and Docker) to generally work for Dart and Flutter dev.
Anytime you're crossing/sharing the file-system boundary from windows to wsl you're paying a massive cost in speed/time.
With the setup you've described I'd consider trying to self-host the browser based VSCode.dev inside wsl - checkout details instructions here: https://medium.com/geekculture/3-steps-to-code-from-anywhere-45401247f479
Personally I've settled on running VSCode and docker inside a Linux VM on Windows, and have a 96% time saving in things like running up a server and watching code for changes making this setup my preferred way now.
The standardisation of devcontainer.json and being able to use github codespaces if you're away from your normal dev machine make this whole setup a pleasure to use.
see https://stackoverflow.com/a/72787362/183005 for detailed timing comparison and setup details

What is the best way to setup lamp in wsl, and where should i put codes that easy for atom to edit

I am a developer that used windows 10 and all my tools are installed in windows 10 such as atom, laragon, gitbash.
here's the scenario,
since I am using laragon as a server on windows 10, I put all my codes in c:/laragon/www. so that when i visit my website at localhost, codes found in www is located and serve to localhost.
now i try wsl on windows, when i installed lamp, my code should reside in /var/www/. the problem with this i can't use atom which is installed in windows to edit code found in /var/www.
my question is, since i been looking for good article at google that best discuss to setup php development using wsl.
What is the best way to setup lamp in wsl, and where should i put codes that easy for atom to edit.
sorry if i don't know this, because i really don't know, and i been looking for this for almost a month now.
I would highly advise against doing this.
Use WSL to mount C:\laragon\www and edit the files within the windows filesystem using atom but even then, it may be best to just completely use the windows environment.
Microsoft have issued warnings that you can edit windows files from inside WSL, but should not under any circumstances edit WSL/files within the ubuntu underlying filesystem from windows [1].
Speaking from experience on trying to set up web services, be it a MERN stack, meteor or a LAMP stack on WSL, I have also had a lot of issues with permissions on starting database services.
1 : https://blogs.msdn.microsoft.com/commandline/2016/11/17/do-not-change-linux-files-using-windows-apps-and-tools/
Steps to hosting LAMP in WSL with the files to be served in windows to be edited by windows tools;
Mount a windows directory (If you haven't already)
Update your Apache / LAMP stack configs to point at the mounted directory;
See this article for some good info. https://www.digitalocean.com/community/tutorials/how-to-move-an-apache-web-root-to-a-new-location-on-ubuntu-16-04
Restart Apache and if needed, other LAMP related services. (The above article covers this as the last step anyway)

How is Github Enterprise hosted?

How exactly does github enterprise (or similar services) allow you to install it and host on your own servers without being open source?
I'm not very familiar with GitHub Enterprise, but it appears it's just a OVF package (commonly used format for packaging an entire virtual machine) that you just import and go.. a full stack including the OS and all. It's not something you just install alongside other things like WordPress (or at least it doesn't appear to be.)
As someone mentioned, it's an Open Virtualisation Format image which you can run in VMWare, VirtualBox or IBM Power. You can read more in the GitHub Enterprise FAQ.
The Virtual Image runs a Linux OS and the GitHub software. Most of the work has been done for you, it's pretty much plug and pay (licence for 40 users runs at $10k/year last time I checked).
GHE is available as appliance and you can import the downloaded ova file to vmware and can configure it from the GUI after installation