> For the complete documentation index, see [llms.txt](https://repo.4pfsec.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://repo.4pfsec.com/google-cloud-computing/cloud-computing-fundamentals/creating-a-virtual-machine.md).

# Creating a Virtual Machine

## Overview

Compute Engine lets you create virtual machines that run different operating systems, including multiple flavors of Linux (Debian, Ubuntu, Suse, Red Hat, CoreOS) and Windows Server, on Google infrastructure. You can run thousands of virtual CPUs on a system that is designed to be fast and to offer strong consistency of performance.

In this hands-on lab, you'll create virtual machine instances of various machine types using the Google Cloud Console and the `gcloud` command line. You'll also learn how to connect an NGINX web server to your virtual machine.

## Create new Instance via Cloud Console

Head over to the VM Instances page as shown below.

![](/files/h1E3siZf8HWwGHLvSZuH)

Create a VM Instance with the specs below.

![](/files/vv4DnVbq5eq97FWvxV6u)

![](/files/ptQ0CwN83Yiz9DRey2hL)

![](/files/ZVb5mlNhbpsYhKjXQScG)

Once the VM spawns, it will look like the following. Hit the SSH button to continue configuring it if needed.

![](/files/iMCr2r4bsVBKu4zohyef)

## Installing NGINX web server

This is pretty straight forward

```
sudo su -
apt-get update
apt-get install nginx -y
```

Confirm that its successfully installed, up and running.

```
ps auwx | grep nginx
```

![](/files/IGdR9AbZQZN2xXzYpgdj)

We are able to see that root is running the NGINX service. We can also confirm this by heading over to the VMs public IP via a web browser as shown below.

![](/files/y7VI1VsljDqN61Z85HAB)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://repo.4pfsec.com/google-cloud-computing/cloud-computing-fundamentals/creating-a-virtual-machine.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
