Below you will find pages that utilize the taxonomy term “Cloud Shell”
Posts
curl command may lack
read more
Visual Studio Code plus Google Cloud Shell
Update: 2020-09-24
Three updates since I wrote the post:
gcloud alpha cloud-shell get-mount-command ${DIR}
It’s possible to use sshfs
to mount the Cloud Shell home directory locally:
DIR=/path/to/dir
gcloud alpha cloud-shell get-mount-command ${DIR}
Which generates something of the form:
sshfs [[USERNAME]]@[[HOST]]: ${DIR} \
-p [[PORT]] \
-oIdentityFile=~/.ssh/google_compute_engine \
-oStrictHostKeyChecking=no
You may then code --new-window ${DIR}
curl command may lack .sshHost
curl’ing the cloudshell.googleapis.com
endpoint will result in a null value for .sshHost
if the Cloud Shell VM must be recreated. The gcloud
command avoids this by using an operation to poll the endpoint until the VM exists. The hacky alternative is to run gcloud alpha cloud-shell ssh
to force the VM to be created before running the curl command.