Skip to content

Latest commit

 

History

History
32 lines (28 loc) · 659 Bytes

Creating a Virtual Machine.md

File metadata and controls

32 lines (28 loc) · 659 Bytes

Creating a Virtual Machine

Run in cloudshell

export ZONE=
gcloud compute instances create gcelab \
--zone=$ZONE \
--machine-type=e2-medium \
--image-project=debian-cloud \
--image-family=debian-11 \
--tags=http-server
gcloud compute firewall-rules create allow-http \
--action=ALLOW \
--direction=INGRESS \
--rules=tcp:80 \
--source-ranges=0.0.0.0/0 \
--target-tags=http-server
gcloud compute instances create gcelab2 --machine-type e2-medium --zone=$ZONE
gcloud compute ssh gcelab --zone=$ZONE

When asked press y , ENTER > ENTER > ENTER

sudo apt-get update
sudo apt-get install -y nginx
ps auwx | grep nginx
exit