Integrate Visual Studio Code into Google Cloud - visual-studio-code

How can I interact with the code on my Google App Engine instance from Visual Studio Code?

You can now run Visual Studio Code from the Google Cloud Shell using
https://github.com/cdr/code-server/
It comes down to downloading code-server, starting it and using the Web Preview functionality of Google Cloud Shell to use it.
See also:
https://medium.com/#chees/how-to-run-visual-studio-code-in-google-cloud-shell-354d125d5748

You can use SSHFS to mount a remote directory on a Google Cloud Virtual Machine (VM). It is very easy to setup and use compared to VNC or FTP:
First you have to access the VM via ssh. This is actually very easy and you don't need to generate any keys yourself. Just go to the console then: Compute Engine > VM Instances, then locate your instance and click on the SSH button at the far right. Tutorial and more info here.
Install SSHFS on your machine. If you have a mac, you can use brew cask install osxfuse and then brew install sshfs.
You are ready. Just type sshfs [you_user_name]#[external_ip_of_vm]:[directory_on_vm_to_mount_to] [local_mount_point], eg. sshfs john#35.222.222.1:/home/john ~/john-vm.
If you decided to setup VNC, here is a link to a very good tutorial on how to set it up on GC. And here is another link on how to setup SFTP.

You can check VSCode remote as well. It was recently developed and is already in quite stable stage. Probably Remote SSH will help you the most in your case.

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 ./)

How to offline install vscode-server for windows remote target

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.

Remote Kubernetes development in Spyder (Python) with Okteto

For Visual Studio Code (VSC) it is possible to install the Remote-Kubernetes extension which allows you to work directly with remote development environments, spinning them up, configuring them etc. More info here.
Is something similar possible for Spyder?
I am aware that a connection to a remote kernel can be made but this seems to require for the remote environment to already be running. Am looking for same functionality as the okteto up command in VSC.

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

Yahoo hadoop tutorial

I am trying to follow the Yahoo hadoop tutorial:
http://developer.yahoo.com/hadoop/tutorial/module3.html#vm
Everything is fine until I try to connect my Eclipse IDE to the hadoop server process according to the "Getting Started With Eclipse" section. The short story is that my "map reduce location", my DFS Location keeps coming back with "Error:null". My VM is running and I can ping it from my PC. Hadoop server is running as I have run the Pi example.
My PC runs WindowsXP and there is no "hadoop.job.ugi" in the Advanced list for the hadoop location....What does "/hadoop/mapred/system" refer too. There is no such directory in the hadoop installation that you install from the tutorial. It seems like a pretty important directory from the name of the field. I have gone into the advanced settings and switched any reference to my WinXP login (Ben) over to "hadoop-user". It is easy to find in the VM the folder locations that it is looking for like "/tmp/hadoop-hadoop-user/mapred/temp".
Am I right in thinking I can run eclipse on the WinXP environment and connect to the VMWare process via its IP address? Isn't that the point of the article? It does not work.
You read it right. The eclipse plugin for hadoop has lot of caveats and there are couple of things that are not well documented. See the second answer by Icn over Installing Hadoop's Eclipse Plugin. Hopefully that would solve the problem.
"/hadoop/mapred/system" refers to the directories inside HDFS, so you don't see it from terminal using ls
I did see the "hadoop.job.ugi" in Advanced list, and succeed to connected to the VM following the instructions there.
are you using the recommended version of eclipse (3.3.1) ?