diff --git a/examples/templates/gcp-linux/main.tf b/examples/templates/gcp-linux/main.tf index a53a29127bf2c..d97bdae3126a5 100644 --- a/examples/templates/gcp-linux/main.tf +++ b/examples/templates/gcp-linux/main.tf @@ -70,5 +70,21 @@ resource "google_compute_instance" "dev" { email = data.google_compute_default_service_account.default.email scopes = ["cloud-platform"] } - metadata_startup_script = coder_agent.dev.init_script + # The startup script runs as root with no $HOME environment set up, which can break workspace applications, so + # instead of directly running the agent init script, setup the home directory, write the init script, and then execute + # it. + metadata_startup_script = < /root/coder_agent.sh +${coder_agent.dev.init_script} +EOCODER +chmod +x /root/coder_agent.sh + +export HOME=/root +/root/coder_agent.sh + +EOMETA } pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy