Anleitung und Anforderungen für Lab-Einrichtung
Schützen Sie Ihr Konto und Ihren Fortschritt. Verwenden Sie immer den privaten Modus und Lab-Anmeldedaten, um dieses Lab auszuführen.

Google Cloud Fundamentals: Getting Started with Compute Engine

Lab 25 Minuten universal_currency_alt 5 Guthabenpunkte show_chart Einsteiger
info Dieses Lab kann KI-Tools enthalten, die den Lernprozess unterstützen.
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.

  1. Sign in to Google Skills using an incognito window.

  2. 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.

  3. When ready, click Start lab.

  4. Note your lab credentials (Username and Password). You will use them to sign in to the Google Cloud Console.

  5. Click Open Google Console.

  6. 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.

  7. Accept the terms and skip the recovery resource page.

Task 2. Create a virtual machine using the Cloud console

  1. In the Navigation menu (Navigation menu), click Compute Engine > VM instances.
  2. Click CREATE INSTANCE.
  3. On the Create an Instance page, for Name, type my-vm-1.
  4. For Region and Zone, select the region and zone assigned by Google Skills.
  5. For Machine type, accept the default.
  6. Click on the OS and storage.
  7. 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).
  8. Click Networking.
  9. For Firewall, click Allow HTTP traffic.
  10. Leave all other defaults unmodified.
  11. 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

  1. In the Cloud console, on the top right toolbar, click the Activate Cloud Shell button (Cloud Shell icon).

  2. Click Continue.

  3. 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}}}
  4. 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 .

  5. 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}}}
  6. To create a VM instance called my-vm-2 in that zone, execute this command:

    gcloud compute instances create "my-vm-2" \ --machine-type "e2-medium" \ --image-project "debian-cloud" \ --image-family "debian-12" \ --subnet "default"
Note: The VM can take about two minutes to launch and be fully available for use.
  1. 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

  1. 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.

  2. To open a command prompt on the my-vm-2 instance, click SSH in its row in the VM instances list.

  3. 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.

  4. Press Ctrl+C to abort the ping command.

  5. Return to the Cloud Console tab.

  6. Click SSH in the my-vm-1 row in the VM instances list.

  7. At the command prompt on my-vm-1, install the Nginx web server:

    sudo apt-get install nginx-light -y
  8. 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
  9. 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
  10. Press Ctrl+O and then press Enter to save your edited file, and then press Ctrl+X to exit the nano text editor.

  11. 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.

  12. Return to the command prompt on my-vm-2

  13. 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:

    curl http://my-vm-1.{{{project_0.default_zone|zone 1}}}/

    The response will again be the HTML source of the web server's home page, including your line of custom text.

  14. In the Navigation menu, click Compute Engine > VM instances.

  15. 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.

Vorbereitung

  1. Labs erstellen ein Google Cloud-Projekt und Ressourcen für einen bestimmten Zeitraum
  2. Labs haben ein Zeitlimit und keine Pausenfunktion. Wenn Sie das Lab beenden, müssen Sie von vorne beginnen.
  3. Klicken Sie links oben auf dem Bildschirm auf Lab starten, um zu beginnen

Privates Surfen verwenden

  1. Kopieren Sie den bereitgestellten Nutzernamen und das Passwort für das Lab
  2. Klicken Sie im privaten Modus auf Konsole öffnen

In der Konsole anmelden

  1. Melden Sie sich mit Ihren Lab-Anmeldedaten an. Wenn Sie andere Anmeldedaten verwenden, kann dies zu Fehlern führen oder es fallen Kosten an.
  2. Akzeptieren Sie die Nutzungsbedingungen und überspringen Sie die Seite zur Wiederherstellung der Ressourcen
  3. 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.