HackPig520

HackPig520 的博客

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

No need for a credit card, free 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 preloaded utilities (such as gcloud command-line tool, kubectl, etc.) to manage resources in an online terminal, and you can also use the online Cloud Shell Editor to develop, build, debug, and deploy cloud applications. It has the following features:

Full access anytime, anywhere#

Flexibly manage Google Cloud resources 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 your browser. Run applications in Cloud Shell virtual machines or our minikube Kubernetes simulator, preview them directly in your 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 of your 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 version and all its 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, develop and deploy Kubernetes and Cloud Run applications, manage clusters, and integrate 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#

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

Product Demo#

Create and deploy a Kubernetes message board application running in a cluster 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#

Cloud Shell quota increases must be submitted through a customer support request and cannot be updated using the 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 quota increase requests.

Idle Cloud Shell#

If you are unable to access Cloud Shell within 120 days, your home disk will be deleted. You will receive an email notification before the deletion. To prevent your home disk from being deleted, start a session. For sensitive data that needs to be stored long-term, 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 lifespan of a Cloud Shell session is 12 hours, after which the session will be terminated automatically. You can start a new session immediately afterwards.

Disk storage#

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

Cleaning up disk space#

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

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

Frequently Asked Questions#

Slow connection#

When connecting to Cloud Shell for the first time, the system needs to create a home 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 haven't used 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 offers ephemeral mode, which provides a Cloud Shell experience without permanent disk storage. 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, Safari's private browsing mode is not supported.

Getting Started with Cloud Shell for Free#

  1. Access and log in to Google Cloud

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

  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 you are prompted that the port is already in use, you can change 8080 to another port.

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

  2. RDP remote desktop creation successful

The RDP remote desktop is valid for approximately 30-120 minutes; if you close the shell window, the remote desktop will be disconnected, and you can repeat the docker command to rebuild it.

Alright, that's it 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 it? Thank you~

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