When you start Cloud Shell, it provisions a g1-small Google Compute Engine virtual machine running a Debian-based Linux operating system. Cloud Shell instances are provisioned on a per-user, per-session basis. The instance persists while your Cloud Shell session is active; after an hour of inactivity, your session terminates and its VM, discarded. For more on usage quotas, refer to the limitations guide.
With the default Cloud Shell experience, you are allocated with an ephemeral, pre-configured VM and the environment you work with is a Docker container running on that VM. You can also choose to use a custom environment to save your configurations, in which case, your environment will be your very own custom Docker image.
Persistent disk storage
Cloud Shell provisions 5 GB of free
persistent disk storage mounted as
$HOME directory on the virtual machine instance. This storage is on
a per-user basis and is available across projects. Unlike the instance itself,
this storage does not time out on inactivity. All files you store in your
home directory, including installed software, scripts and user configuration
.vimrc, persist between sessions. Your
directory is private to you and cannot be accessed by other users.
Pre-configured environment variables
When Cloud Shell is started, the active project in Console is propagated to
gcloud configuration inside Cloud Shell for immediate use.
GOOGLE_CLOUD_PROJECT, the environmental variable used by
Application Default Credentials library support to define project ID, is also
set to point to the active project in Console.
Cloud Shell is globally distributed across multiple Google Cloud Platform regions. When you first connect to Cloud Shell, you'll automatically be assigned the closest available geographical region. You cannot pick your own region but in the event that Cloud Shell doesn't pick the closest region, it'll migrate to a closer region by session end.
To view your current region, run the following command from a Cloud Shell session:
The Cloud Shell container image is updated weekly to ensure prepackaged tools are kept up to date. This means Cloud Shell always comes with the latest versions of Cloud SDK, Docker, and all its other utilities.
When you set up a Cloud Shell session, you get a regular Unix user account with a username based on your email address. With this access, you have full root privileges on your allocated VM and can even run sudo commands, if you need to.
The Cloud Shell virtual machine instance has the following pre-installed tools:
|Linux shell interpreters||
|Linux utilities||Standard Debian system utilities|
|Google SDKs and tools||
Google App Engine SDK
Google Cloud SDK including the
|Build and package tools||
|Source control tools||
You can install additional software packages on the virtual machine instance
but the installation will not persist after the instance terminates unless you
install the software in your
$HOME directory or create a
The Cloud Shell virtual machine instance provides pre-installed language support for the following:
|Java||JRE/JDK 1.8 and 1.11|
|.NET Core||SDKs 2.0.0 and 2.1.502
Core runtimes 2.0.0 and 2.1.6
The default version of the Java environment is 1.8. To change the current Cloud Shell session to use version 1.11 of the JRE and JDK, enter the following at the Cloud Shell command prompt:
sudo update-java-alternatives -s java-1.11.0-openjdk-amd64 && export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
To change back to 1.8.0:
sudo update-java-alternatives -s java-1.8.0-openjdk-amd64 && export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre
You can ignore any error messages about not being able to change the
versions of some binaries. The version change will persist until the
Cloud Shell virtual machine instance is terminated. If you want to
permanently switch to Java 1.11, add the first command above to your
Boost mode temporarily increases the power of your Cloud Shell VM - from the default g1-small machine type offering to a n1-standard-1 VM instance. This is handy if you'd like to continue working on Cloud Shell and need more CPU or memory resources for a relatively short period of time.
To activate boost mode, find the 'Enable Boost Mode' option under the 'More' menu (the three dotted icon on the top right of Cloud Shell). Once activated, all sessions will be boosted for the next 24 hours. Enabling Boost mode restarts your Cloud Shell and will immediately terminate your session. A new VM will then be provisioned for you which can take a couple of minutes. The data in your home directory will persist, but all running processes will be lost.
Boost mode is subject to regular usage limits. Currently, this feature is experimental and additional limits may be implemented in the future.
Cloud Shell will immediately close after connection if there is a problem in
.tmux.conf files. To
resolve this, open Cloud Shell in safe mode by appending
cloudshellsafemode=true to the URL. This will restart your Cloud
Shell and log you in as root, allowing you to fix any issues in the files.
If you'd prefer to permanently delete all files in your home directory and restore your Cloud Shell home directory to a clean state, you can completely reset your Cloud Shell VM.