# Create a Virtual Machine

In 
GCP
Published 2022-12-03

This tutorial explains how we can create a Virtual Machine in GCP (Google Cloud Platform).

A VM is a virtualized instance of a computer that can perform almost all the same functions as a computer, including running applications and operating systems. Virtual machines run on a physical machine and access computing resources from software called a hypervisor.

In order to create a VM in GCP (Google Cloud Platform) from the Google Cloud Console, we need to go to "Compute" -> "Compute Engine" and we will see the following page:

Click on "Create instance" and you will see the following page:

Choose a name for your VM, add some labels if you want, choose the region and a zone for your VM.

Configure your machine.

Enable if you want the "Confidential Computing", Deploy a container image to this VM instance if you want, define the "Boot disk".

Choose Identity and API access.

Add tags and firewall rules to allow specific network traffic from the Internet. Click on "Create" button.

The new VM will be created.

The same thing will be done running the following command in Google Cloud CLI:

gcloud compute instances create instance-1 --project=fluted-layout-376110 --zone=us-west4-b --machine-type=e2-small --network-interface=network-tier=PREMIUM,subnet=default --maintenance-policy=MIGRATE --provisioning-model=STANDARD --service-account=476731510945-compute@developer.gserviceaccount.com --scopes=https://www.googleapis.com/auth/devstorage.read_only,https://www.googleapis.com/auth/logging.write,https://www.googleapis.com/auth/monitoring.write,https://www.googleapis.com/auth/servicecontrol,https://www.googleapis.com/auth/service.management.readonly,https://www.googleapis.com/auth/trace.append --create-disk=auto-delete=yes,boot=yes,device-name=VM-instance1-disk1,image=projects/centos-cloud/global/images/centos-stream-8-v20230203,mode=rw,size=20,type=projects/fluted-layout-376110/zones/us-west4-b/diskTypes/pd-standard --no-shielded-secure-boot --shielded-vtpm --shielded-integrity-monitoring --reservation-affinity=any

Enjoy Google Cloud Virtual Machines.