In the Google Cloud Console, select an existing Google Cloud project or create a new one. If you create a new project, follow the prompts to finish setting it up.
Verify that billing is enabled for your Google Cloud project.
Check your roles on the project:
If you are the project Owner, you already have the necessary permissions and do not need any additional roles assigned.
Otherwise, make sure that you have the following roles:
In the Google Cloud Console, go to Compute Engine → VM instances, then click Create VM.
IMPORTANT: Unless specified below, leave all settings at their defaults.
Now we will configure the VM’s machine, OS, and storage.
In the left navigation menu, select Machine configuration and configure:
us-central1 (Iowa)N4A (Google Axion)n4a-standard-4 (4 vCPUs, 16 GB memory)StandardWhy N4A-standard-4? N4A-standard-4 provides four Google Axion Arm cores and enough memory to compile the kernel efficiently.
In the left navigation menu, select OS and storage. Under Operating system and storage, click Change and configure the boot disk:
Click Select to save the boot disk configuration.
At the bottom of the page, click Create.
Wait a couple of minutes for the VM to be created, then check Notifications in the upper-right corner of the Google Cloud Console.
If there is an error indicating that N4A machines are unavailable in the selected zone, edit the VM configuration and try another zone in us-central1. If no Iowa zones have N4A capacity available, change the region to us-west1 (Oregon) and try a zone there.
The VM cannot have an external IP because of the organization policy. It therefore needs Cloud NAT to access Ubuntu repositories and Git.
In the Google Cloud Console, use the search bar at the top of the page to search for Network services and open it. In the left navigation menu, click Cloud NAT.
Click Get started or Create Cloud NAT gateway.
Configure:
os-vm-natPublicus-west1-c, select us-west1.Create a Cloud Router in the same region as the VM:
os-vm-routerUnder Cloud NAT mapping, configure:
VM instances, GKE nodes, ServerlessIPv4CustomPrimary IP rangesConfigure:
AutomaticStandardLeave all other settings at their defaults and click Create.
Wait one to three minutes for the configuration to take effect.
Why Cloud NAT? It provides outbound internet access for package and source-code downloads without exposing the VM directly to inbound internet traffic. Do not enable Allow HTTP traffic or Allow HTTPS traffic.
sudo on Ubuntu 26.04In the Google Cloud Console, click Compute Engine in the left navigation menu. In the menu that opens, click VM instances.
Find your VM and click SSH to open a terminal connected to it.
All commands below should be run inside this VM.
Ubuntu 26.04 uses the Rust-based sudo-rs by default. It may fail to recognize the sudo permissions generated by GCP OS Login.
Switch to the traditional sudo implementation:
/usr/bin/sudo.ws update-alternatives --set sudo /usr/bin/sudo.ws
Verify it:
sudo whoami
The result should be:
root
Why is this necessary? The account can have valid GCP administrative permissions while
sudo-rsstill rejects commands withI'm afraid I can't do that. The traditionalsudo.wscorrectly reads GCP’s generated sudo configuration.
Continue running the following commands inside the VM.
The image ships without a compiler or make. Install the basics you need for the homework assignments:
sudo apt update && sudo apt install -y build-essential git
If apt update hangs or cannot connect, your Cloud NAT is likely misconfigured: check that its region matches your VM’s region (§2), or wait a few minutes if you just created it.
Each assignment lists any additional packages it needs.