How to run a Visual Studio Code in Google Cloud Shell?
How to run a Visual Studio Code in Google Cloud Shell?
Posted in by Tudipat 08:04Comments Off on How to run a Visual Studio Code in Google Cloud Shell?
How to run a Visual Studio Code in Google Cloud Shell?
Tudip
22 April 2020
Overview:
Google Cloud Shell is an interactive shell environment for Google Cloud Platform that makes it easy for learning and experimenting with GCP and managing projects and resources from the web browser.
For accessing the Google Cloud Shell we should have familiarity with basic Linux commands and editors.
Imagine running a visual studio code with the help of Google Cloud Shell.
Open cloud Shell. As for opening the cloud shell editor, you will need a codebase. Else for faster execution of commands, you can also use the boost mode in the cloud shell.Here the most important thing which we need to make clear is our current working directory. Where we are running our script. The most preferable suggestion is to choose the home directory
Now execute the code given below in the cloud shell editor to install the code server.
export VERSION=`curl –s https://api.github.com/repos/cdr/code-server/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")'
wget https://github.com/cdr/code-server/releases/download/$VERSION/code-server$VERSION-linux-x64.tar.gz
tar -xvzf code-server$VERSION-linux-x64.tar.gz
cd code-server$VERSION-linux-x64
Once we complete the code in the cloud editor we can now clone and extract the content by using the code given below. ./visual_studio_code.sh
Use the ls command to check if our code is extracted in the right directory
After the successful execution of the code, we can use the following . /code-server –no-auth –port 8080 command to start the server.
After completion of this command please check that if we have received the output Connected to the shared process.
Go to the web preview option and choose the port. We can select the port which has mentioned in this command ./code-server –no-auth –port 8080
After selecting the web preview option it will redirect to the tab. Where you can see your visual Data Studio.
It’s easily accessible as we have started this in the cloud shell and also in the home directory. It’s very easy to use Visual Studio via browser as google gives the 5 GB free persistent disk space which can be easily usable and also free.
Sometimes there can be a case that after being successfully connected to the shared process we may not get the visual studio page in that case. We can edit the web link bt removing authuser=0 from the link
All content provided on this blog is for informational purposes only. Tudip Technologies provides no endorsement and makes no representations as to accuracy, reliability, completeness, suitability or validity of any information or content on, distributed through or linked, downloaded or accessed from this site. Tudip Technologies will not be liable for any errors, omissions, or delays in this information or any losses, injuries, or damages arising from its display or use of the information on this site. All information is provided on an as-is basis without any obligation to make improvements or to correct errors or omissions. This site may contain links to other websites. Tudip Technologies makes no guarantees or promises regarding these websites and does not necessarily endorse or approve of their content. You may not modify any part of the blog. The inclusion of any part of this blog in another work, whether in printed or electronic or other form, or inclusion of any part of the blog in another website by linking, framing or otherwise without the express permission of Tudip Technologies is prohibited. This site may not be used for any illegal or illicit purpose and Tudip Technologies reserves the right, at its sole discretion and without notice of any kind, to remove anything posted to this site. By using this site, you hereby acknowledge that any reliance upon any materials shall be at your sole risk.