GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Documentation
  • Get Started with Google Cloud
  • Product List
  • Cloud Customer Care
  • Agent Platform
  • Apigee API Management
  • BigQuery
  • Compute Engine
  • Cloud CDN
  • Cloud Run
  • Cloud Storage
  • Cloud SQL
  • Gemini Enterprise
  • Google Kubernetes Engine

This view

  • Original page
  • New address

GeezerVison is showing docs.cloud.google.com — About startup scripts | Compute Engine | Google Cloud Documentation

About startup scripts Stay organized with collections Save and categorize content based on your preferences.

Linux Windows

A startup script is a file that contains commands that run when a virtual machine (VM) instance boots. Compute Engine provides support for running startup scripts on Linux VMs and Windows VMs.

Prerequisites

To run scripts stored in metadata on a VM instance, the guest environment must be installed and running.

  • The guest environment includes the guest agent (for example, google-guest-agent on Linux) that reads the script content or URL from the instance's metadata and initiates execution.
  • All public Compute Engine images come with the guest environment preinstalled.
  • If you create a custom image, you must manually install the Google Guest Environment to ensure scripts from metadata and other Google Cloud features function properly.

The following table contains links to documentation that describes how to use startup scripts.

Startup script task Best used for Link to procedure
Pass a startup script directly Scripts up to 256 KB
Linux VMs Windows VMs
Pass a startup script from a local file Scripts up to 256 KB
Linux VMs Windows VMs
Pass a startup script from Cloud Storage Scripts greater than 256 KB
Linux VMs Windows VMs
Access metadata from a startup script Passing different values to each VM that uses the same script
Linux VMs Windows VMs
Rerun a startup script Running a script without restarting the VM
Linux VMs Windows VMs
View the output from a startup script Monitoring the progress of a script
Linux VMs Windows VMs

What's next

  • Learn how to add a shutdown script.
  • Learn how to use startup scripts on Linux VMs.
  • Learn how to use startup scripts on Windows VMs.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-11-10 UTC.

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.