Dieser Inhalt ist noch nicht für Mobilgeräte optimiert.
Die Lernumgebung funktioniert am besten, wenn Sie auf einem Computer über einen per E‑Mail gesendeten Link darauf zugreifen.
Overview
In this lab, you will create virtual machines (VMs) and connect to them. You will also create connections between the instances.
Objectives
In this lab, you will learn how to perform the following tasks:
Create a Compute Engine virtual machine using the Google Cloud console.
Create a Compute Engine virtual machine using the gcloud command-line interface.
Connect between the two instances.
Task 1. Sign in to the Google Cloud console
For each lab, you get a new Google Cloud project and set of resources for a fixed time at no cost.
Sign in to Google Skills using an incognito window.
Note the lab's access time (for example, 1:15:00), and make sure you can finish within that time.
There is no pause feature. You can restart if needed, but you have to start at the beginning.
When ready, click Start lab.
Note your lab credentials (Username and Password). You will use them to sign in to the Google Cloud Console.
Click Open Google Console.
Click Use another account and copy/paste credentials for this lab into the prompts.
If you use other credentials, you'll receive errors or incur charges.
Accept the terms and skip the recovery resource page.
Task 2. Create a virtual machine using the Cloud console
In the Navigation menu (), click Compute Engine > VM instances.
Click CREATE INSTANCE.
On the Create an Instance page, for Name, type my-vm-1.
For Region and Zone, select the region and zone assigned by Google Skills.
For Machine type, accept the default.
Click on the OS and storage.
Under Operating system and storage, if the Image shown is not Debian GNU/Linux 12 (bookworm), click Change and select Debian GNU/Linux 12 (bookworm).
Click Networking.
For Firewall, click Allow HTTP traffic.
Leave all other defaults unmodified.
To create and launch the VM, click Create.
Note: The VM can take about two minutes to launch and be fully available for use.
Click Check my progress to verify the objective.
Create a virtual machine using the Cloud console
Task 3. Create a virtual machine using the gcloud command line
In the Cloud console, on the top right toolbar, click the Activate Cloud Shell button ().
Click Continue.
To display a list of all the zones in the region to which Google Skills assigned you, enter this partial command gcloud compute zones list | grep followed by the region that Google Skills or your instructor assigned you to.
Your completed command will look like this:
gcloud compute zones list | grep {{{project_0.default_region|Region 1}}}
Choose a zone from that list other than the zone to which Google Skills assigned you. For example, if Google Skills assigned you to region and zone you might choose zone .
To set your default zone to the one you just chose, enter this partial command gcloud config set compute/zone followed by the zone you chose.
Your completed command will look like this:
gcloud config set compute/zone {{{project_0.default_zone_2|zone 2}}}
To create a VM instance called my-vm-2 in that zone, execute this command:
Note: The VM can take about two minutes to launch and be fully available for use.
To close the Cloud Shell, execute the following command:
exit
Click Check my progress to verify the objective.
Create a virtual machine using the gcloud command line
Task 4. Connect between VM instances
In the Navigation menu, click Compute Engine > VM instances.
You will see the two VM instances you created, each in a different zone.
Notice that the Internal IP addresses of these two instances share the first three bytes in common. They reside on the same subnet in their Google Cloud VPC even though they are in different zones.
To open a command prompt on the my-vm-2 instance, click SSH in its row in the VM instances list.
Use the ping command to confirm that my-vm-2 can reach my-vm-1 over the network:
ping my-vm-1.{{{project_0.default_zone|zone 1}}}
Notice that the output of the ping command reveals that the complete hostname of my-vm-1 is my-vm-1.us-.c.PROJECT_ID.internal, where PROJECT_ID is the name of your Google Cloud Platform project. The Cloud console automatically supplies Domain Name Service (DNS) resolution for the internal IP addresses of VM instances.
Press Ctrl+C to abort the ping command.
Return to the Cloud Console tab.
Click SSH in the my-vm-1 row in the VM instances list.
At the command prompt on my-vm-1, install the Nginx web server:
sudo apt-get install nginx-light -y
Use the nano text editor to add a custom message to the homepage of the web server:
sudo nano /var/www/html/index.nginx-debian.html
Use the arrow keys to move the cursor to the line just below the h1 header. Add text like this, and replace YOUR_NAME with your name:
Hi from YOUR_NAME
Press Ctrl+O and then press Enter to save your edited file, and then press Ctrl+X to exit the nano text editor.
Confirm that the web server is serving your new page. At the command prompt on my-vm-1, execute this command:
curl http://localhost/
The response will be the HTML source of the web server's home page, including your line of custom text.
Return to the command prompt on my-vm-2
To confirm that my-vm-2 can reach the web server on my-vm-1, at the command prompt on my-vm-2, execute this command:
The response will again be the HTML source of the web server's home page, including your line of custom text.
In the Navigation menu, click Compute Engine > VM instances.
Copy the External IP address for my-vm-1 and paste it into the address bar of a new browser tab.
You will see your web server's home page, including your custom text.
Note: If you forgot to click Allow HTTP traffic when you created the my-vm-1 VM instance, your attempt to reach your web server's home page will fail. You can add a firewall rule to allow inbound traffic to your instances, although this topic is out of scope for this course.
Congratulations!
In this lab, you created virtual machine (VM) instances in two different zones and connected to them using ping, ssh, and HTTP.
End your lab
When you have completed your lab, click End Lab. Google Skills removes the resources you’ve used and cleans the account for you.
You will be given an opportunity to rate the lab experience. Select the applicable number of stars, type a comment, and then click Submit.
The number of stars indicates the following:
1 star = Very dissatisfied
2 stars = Dissatisfied
3 stars = Neutral
4 stars = Satisfied
5 stars = Very satisfied
You can close the dialog box if you don't want to provide feedback.
For feedback, suggestions, or corrections, please use the Support tab.
Copyright 2026 Google LLC All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.
Labs erstellen ein Google Cloud-Projekt und Ressourcen für einen bestimmten Zeitraum
Labs haben ein Zeitlimit und keine Pausenfunktion. Wenn Sie das Lab beenden, müssen Sie von vorne beginnen.
Klicken Sie links oben auf dem Bildschirm auf Lab starten, um zu beginnen
Privates Surfen verwenden
Kopieren Sie den bereitgestellten Nutzernamen und das Passwort für das Lab
Klicken Sie im privaten Modus auf Konsole öffnen
In der Konsole anmelden
Melden Sie sich mit Ihren Lab-Anmeldedaten an. Wenn Sie andere Anmeldedaten verwenden, kann dies zu Fehlern führen oder es fallen Kosten an.
Akzeptieren Sie die Nutzungsbedingungen und überspringen Sie die Seite zur Wiederherstellung der Ressourcen
Klicken Sie erst auf Lab beenden, wenn Sie das Lab abgeschlossen haben oder es neu starten möchten. Andernfalls werden Ihre bisherige Arbeit und das Projekt gelöscht.
Diese Inhalte sind derzeit nicht verfügbar
Bei Verfügbarkeit des Labs benachrichtigen wir Sie per E-Mail
Sehr gut!
Bei Verfügbarkeit kontaktieren wir Sie per E-Mail
Es ist immer nur ein Lab möglich
Bestätigen Sie, dass Sie alle vorhandenen Labs beenden und dieses Lab starten möchten
Privates Surfen für das Lab verwenden
Am besten führen Sie dieses Lab in einem Inkognito- oder privaten Browserfenster aus. So vermeiden Sie Konflikte zwischen Ihrem privaten Konto und dem Teilnehmerkonto, die zusätzliche Kosten für Ihr privates Konto verursachen könnten.
In this lab, you will create virtual machines (VMs) and connect to them. You will also create connections between the instances.