Follow the Google Cloud Linux VM tutorial to first just create a project that will contain your VM. Use the specifications below for the specific VM.
Use these settings:
us-central1 (Iowa)N4A (Google Axion)n4a-standard-4 (4 vCPUs, 16 GB memory)StandardLeave all other settings at their defaults.
If N4A machines are unavailable, try another zone. If no Iowa zones work, use us-west1 (Oregon).
Why N4A? N4A provides four Google Axion Arm cores and enough memory to compile the kernel efficiently.
The VM cannot have an external IP because of the organization policy. It therefore needs Cloud NAT to access Ubuntu repositories and Git.
Go to Network services → Cloud NAT.
Click Get started or Create Cloud NAT gateway.
Configure:
os-vm-natPublicCreate a Cloud Router:
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 and run:
sudo apt update
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.04Ubuntu 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.