HackPig520

HackPig520 的博客

我是HackPig520,一个前端工程师,喜欢Web3和Minecraft。
github
gitlab
bilibili
tg_channel
keybase
email
twitter
zhihu
pixiv

No need for a credit card, freeload Google Cloud to create RDP remote desktop!

⏳ You need a US node to continue

Introduction to Cloud Shell#

Cloud Shell is an online development and operations environment that can be accessed from a browser. You can use its online terminal, which is preloaded with utilities such as gcloud command-line tool, kubectl, etc., to manage resources, as well as use the online Cloud Shell Editor to develop, build, debug, and deploy cloud applications. It has the following features:

Full access anytime, anywhere#

Manage Google Cloud resources flexibly using Linux Shell. With Cloud Shell, you can access virtual machine instances through the command line in a terminal window.

Environment that meets developer needs#

Cloud Shell Editor is simplified and provides various language support (such as Go, Java, Node.js, Python, and C#), integrated debugging, source code control, refactoring, and customizable interfaces to improve work efficiency, helping you develop applications directly from the browser. Run applications in Cloud Shell virtual machines or our minikube Kubernetes simulator, preview them directly in the browser, and then submit changes back to your code repository from our Git client.

Latest versions of your favorite tools preinstalled#

Cloud Shell comes with many commonly used command-line tools preinstalled, from bash and sh to emacs and vim, and they are all kept up to date. Management and development tools such as gcloud command-line tool, MySql, Kubernetes, Docker, minikube, and Skaffold are preconfigured and available for use at any time, so you don't have to search for how to install the latest versions and all their dependencies. Just connect to Cloud Shell and start using them!

Cloud Code tools that maximize development efficiency#

Use the various tools provided by Cloud Code extensions to easily develop cloud applications, including developing and deploying Kubernetes and Cloud Run applications, managing clusters, and integrating Google Cloud APIs into your projects, all directly in the Cloud Shell Editor.

Use Cloud Shell directly in the documentation when building new skills#

When building new skills and learning new products, Cloud Shell can be activated and used directly in the documentation, eliminating unnecessary context switching.

5 GB of permanent disk storage space#

Cloud Shell provides 5GB of permanent disk storage space as the $HOME directory on your Cloud Shell instance. All files stored in the home directory, including scripts and user configuration files such as .bashrc and .vimrc, are shared between different sessions.

Product Demo#

Create and deploy a Kubernetes message board application in a cluster running in Cloud Shell

Launch Cloud Shell from Google Cloud Console and check the version of gcloud components

Usage Quotas#

The default weekly quota for Cloud Shell is 50 hours.

View Cloud Shell weekly quota#

If you reach the quota, you will need to wait until the specified date and time to use Cloud Shell again, or consult your Cloud Shell administrator to increase the quota.

Request quota increase#

Requests to increase Cloud Shell quota must be submitted through customer support and cannot be updated using Google Cloud Console. To request a quota increase, please contact Cloud Customer Care (not "Billing").

For more information on the quota increase process, see About Increase Requests.

Idle Cloud Shell#

If you cannot access Cloud Shell within 120 days, your main disk will be deleted. You will receive an email notification before deletion. To prevent your main disk from being deleted, start a session. For sensitive data that requires long-term storage, consider using other solutions on Cloud Storage.

Non-interactive usage#

Cloud Shell can only be used interactively. Non-interactive sessions will automatically end after one hour. The maximum duration of a Cloud Shell session is 12 hours, after which the session will be terminated. You can start a new session immediately afterwards.

Disk storage#

Cloud Shell provides 5 GB of free permanent disk storage space, mounted as the $HOME directory on your virtual machine instance. This storage space is allocated per user and can be used by multiple projects. All files stored in the home directory, including installed software, scripts, and user configuration files such as .bashrc and .vimrc, are shared between different sessions and count towards the 5 GB limit.

Cleaning up disk space#

If you encounter a "no space left on device" error, use the Cloud Shell terminal to remove files from the home directory to free up space. Use the command du -hs $(ls -A) to see the space used by each file in each subdirectory. Consider removing files that are no longer needed or occupy a large amount of storage space.

Note: If you do not access Cloud Shell frequently, the permanent storage space in the $HOME directory may be reclaimed. Before reclamation, you will receive an email notification. Starting a Cloud Shell session will prevent permanent storage space from being reclaimed.

Frequently Asked Questions#

Slow connection#

When connecting to Cloud Shell for the first time, the system needs to create a main disk for you, which can take up to 25 seconds. Subsequent connections to existing virtual machine instances will take about five seconds. However, if you do not use Cloud Shell for a week, the connection performance will be slower because the home directory needs to be restored from the archive.

Cloud Shell also provides ephemeral mode, which provides a Cloud Shell experience without permanent disk storage space. Ephemeral mode provides faster connection performance, but all files created during the session will be lost when the session ends.

Browser support?#

Cloud Shell supports the latest versions of Google Chrome, Mozilla Firefox, Microsoft Edge, Microsoft Internet Explorer 11+, and Apple Safari 8+. However, it does not support Safari's private browsing mode.

Freeloading with Cloud Shell#

  1. Access and log in to Google Cloud.

  2. Select "Activate Cloud Shell" from the top menu, activation does not require a credit card binding.

  3. After successful activation, execute the following code:

help
ls -all
docker run -p 8080:80 dorowu/ubuntu-desktop-lxde-vnc

Wait for about half a minute for the installation to complete. If there is a port conflict, you can modify 8080 to another port.

  1. Click on "Web preview" - "Preview on port 8080".

  2. RDP remote desktop creation successful.

RDP remote desktop is valid for about 30-120 minutes; closing the shell window will disconnect the remote desktop, and you can repeat the docker command to rebuild it.

Alright, that's all for this tutorial~ If I think the Cloud Shell experience is good, I will continue to update it in the future! If you find this article helpful, consider sponsoring, thank you~

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.