Instanz einer virtuellen Linux-Maschine in Compute Engine erstellen

Erfahren Sie, wie Sie mit der Google Cloud Console eine Linux-VM-Instanz in Compute Engine erstellen.


Eine detaillierte Anleitung dazu finden Sie direkt in der Google Cloud Console. Klicken Sie dazu einfach auf Anleitung:

Anleitung


Hinweise

  1. Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
  2. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  3. Make sure that billing is enabled for your Google Cloud project.

  4. Make sure that you have the following role or roles on the project: Compute Instance Admin (v1), Compute Security Admin, OSPolicyAssignment Admin, Service Account User, Service Usage Admin

    Check for the roles

    1. In the Google Cloud console, go to the IAM page.

      Go to IAM
    2. Select the project.
    3. In the Principal column, find all rows that identify you or a group that you're included in. To learn which groups you're included in, contact your administrator.

    4. For all rows that specify or include you, check the Role column to see whether the list of roles includes the required roles.

    Grant the roles

    1. In the Google Cloud console, go to the IAM page.

      Zu IAM
    2. Wählen Sie das Projekt aus.
    3. Klicken Sie auf Zugriff erlauben.
    4. Geben Sie im Feld Neue Hauptkonten Ihre Nutzer-ID ein. Dies ist in der Regel die E-Mail-Adresse eines Google-Kontos.

    5. Wählen Sie in der Liste Rolle auswählen eine Rolle aus.
    6. Wenn Sie weitere Rollen hinzufügen möchten, klicken Sie auf Weitere Rolle hinzufügen und fügen Sie weitere Rollen hinzu.
    7. Klicken Sie auf Speichern.
  5. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  6. Make sure that billing is enabled for your Google Cloud project.

  7. Make sure that you have the following role or roles on the project: Compute Instance Admin (v1), Compute Security Admin, OSPolicyAssignment Admin, Service Account User, Service Usage Admin

    Check for the roles

    1. In the Google Cloud console, go to the IAM page.

      Go to IAM
    2. Select the project.
    3. In the Principal column, find all rows that identify you or a group that you're included in. To learn which groups you're included in, contact your administrator.

    4. For all rows that specify or include you, check the Role column to see whether the list of roles includes the required roles.

    Grant the roles

    1. In the Google Cloud console, go to the IAM page.

      Zu IAM
    2. Wählen Sie das Projekt aus.
    3. Klicken Sie auf Zugriff erlauben.
    4. Geben Sie im Feld Neue Hauptkonten Ihre Nutzer-ID ein. Dies ist in der Regel die E-Mail-Adresse eines Google-Kontos.

    5. Wählen Sie in der Liste Rolle auswählen eine Rolle aus.
    6. Wenn Sie weitere Rollen hinzufügen möchten, klicken Sie auf Weitere Rolle hinzufügen und fügen Sie weitere Rollen hinzu.
    7. Klicken Sie auf Speichern.
  8. Aktivieren Sie die Compute Engine API.

    Compute Engine-API aktivieren

Linux-VM-Instanz erstellen

  1. In the Google Cloud console, go to the Create an instance page.

    Go to Create an instance

  2. In the Boot disk section, click Change to begin configuring your boot disk.
  3. Wählen Sie auf dem Tab Public images aus der Liste Betriebssystem die Option Ubuntu.
  4. Wählen Sie aus der Liste Version die Option Ubuntu 24.04 LTS aus.
  5. Klicken Sie auf Auswählen.
  6. Wählen Sie im Bereich Firewall die Option HTTP-Traffic zulassen aus.
  7. Klicken Sie auf Erstellen, um die VM zu erstellen.

Warten Sie kurz, bis die VM-Instanz gestartet ist. Wenn die VM-Instanz bereit ist, wird sie mit einem grünen Statussymbol auf der Seite VM-Instanzen angezeigt.

Compute Engine gewährt dem Nutzer, der die VM-Instanz erstellt, die Rolle roles/compute.instanceAdmin. Compute Engine fügt diesen Nutzer der Gruppe sudo hinzu.

Verbindung zur VM-Instanz herstellen

Stellen Sie mithilfe der Google Cloud -Console eine Verbindung zu einer VM-Instanz her und führen Sie die folgenden Schritte aus. Sie sind als die Person verbunden, mit der Sie auf die Seite „VM-Instanzen” zugegriffen haben.

  1. In the Google Cloud console, go to the VM instances page.

    Go to VM instances

  2. In the list of virtual machine instances, click SSH in the row of the instance that you want to connect to.

    SSH button next to instance name.

Bereinigen

Mit den folgenden Schritten vermeiden Sie, dass Ihrem Google Cloud -Konto die auf dieser Seite verwendeten Ressourcen in Rechnung gestellt werden:

  1. Rufen Sie in der Google Cloud Console die Seite VM-Instanzen auf:

    Zu "VM-Instanzen"

  2. Wählen Sie die Zeile mit der VM-Instanz aus, die Sie in dieser Anleitung erstellt haben.

  3. Klicken Sie auf Löschen und dann noch einmal auf Löschen, um den Löschvorgang zu bestätigen.

Nächste Schritte