1. Get Started#
When you complete this milestone you will have created your first Google Compute Engine virtual machine (VM) and connected to it from using only your browser. You will have a running Linux server and a working remote shell session.
Prerequisites#
Before starting, make sure you:
Follow the instructions in Canvas to redeem your Google Cloud credit
Have a non-Cabrillo Google account that can access Google Cloud
Lab: Create and Connect to a VM#
1. Open Google Cloud Console and Cloud Shell#
Select your course project from the project picker near the top of the page
Click the Activate Cloud Shell icon (
>_) in the top-rightWait for the Cloud Shell terminal to finish loading
2. Create a GCP Project#
If it’s your first time logging in to GCP a project is usually, but not always, created for you. All GCP resources have to belong to a project. This keeps resources organized. Projects have:
A non-unique name that you use to identify it.
A globally unique ID
A globally unique number
Create a project called cis-91. Notice that the project ID gets randomized,
for example cis-91-2381231. There can be only one cis-91 project ID on
Earth and I have it already!
Select your new project using the dropdown.
3. Create a VM in Compute Engine#
Follow the process shown in class. Use the following settings:
Name:
cis91-vm(any name will do)Region/Zone: choose a nearby zone (for example,
us-west1-a)Machine type:
e2-microBoot disk: Debian or Ubuntu LTS
Firewall: check Allow HTTP traffic (optional but useful later)
3. Connect from the Browser using SSH#
You can connect either from the VM list or from Cloud Shell commands. Both options are described below.
Option A: Connect from the VM instances page#
In the VM instances table, find
cis91-vmClick SSH in that row
A browser-based terminal opens and logs you into the VM
Option B: Connect from Cloud Shell command line#
Run this command in Cloud Shell (replace zone if needed):
$ gcloud compute ssh cis-91-vm --zone us-west1-a
On first connect, type y if prompted to continue.
4. Verify You Are Logged Into the VM#
Run these commands inside the VM shell:
$ whoami
$ hostname
$ uname -a
$ cat /etc/os-release
You should see:
Your Linux username
The VM hostname (
cis91-vmor similar)Kernel and OS information
5. Take a Screenshot#
Take a screenshot of a window where you are logged in to the VM with some of the commands from the last step showing. This confirms you can create files on your VM.
6. Exit the VM and Return to Cloud Shell#
$ exit
After exit, your prompt should return to Cloud Shell or the SSH window will
close.
Troubleshooting#
If SSH does not connect:
Confirm the VM status is Running
Confirm you selected the correct project
Confirm the zone in your command matches the VM zone
Retry from VM instances > SSH to isolate command issues
Wait 1-2 minutes after VM creation and try again
Clean Up (Required)#
To avoid ongoing charges, stop or delete your VM when finished.
Stop the VM#
Go to Compute Engine > VM instances
Select
cis91-vmClick Stop
Delete the VM#
Select
cis91-vmClick Delete
Confirm deletion
Project Documentation#
In Canvas discussion post:
Introduce yourself
Say what you would like to learn about the cloud
Post the screenshot from this milestone