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:
Hinweis
- Melden Sie sich in Ihrem Google Cloud -Konto an. Wenn Sie mit Google Cloudnoch nicht vertraut sind, erstellen Sie ein Konto, um die Leistungsfähigkeit unserer Produkte in der Praxis sehen und bewerten zu können. Neukunden erhalten außerdem ein Guthaben von 300 $, um Arbeitslasten auszuführen, zu testen und bereitzustellen.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
-
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
-
In the Google Cloud console, go to the IAM page.
Go to IAM - Select the project.
-
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.
- 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
-
In the Google Cloud console, go to the IAM page.
Go to IAM - Select the project.
- Click Grant access.
-
In the New principals field, enter your user identifier. This is typically the email address for a Google Account.
- Click Select a role, then search for the role.
- To grant additional roles, click Add another role and add each additional role.
- Click Save.
-
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
-
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
-
In the Google Cloud console, go to the IAM page.
Go to IAM - Select the project.
-
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.
- 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
-
In the Google Cloud console, go to the IAM page.
Go to IAM - Select the project.
- Click Grant access.
-
In the New principals field, enter your user identifier. This is typically the email address for a Google Account.
- Click Select a role, then search for the role.
- To grant additional roles, click Add another role and add each additional role.
- Click Save.
-
- Aktivieren Sie die Compute Engine API.
Linux-VM-Instanz erstellen
- Rufen Sie in der Google Cloud Console die Seite Instanz erstellen auf.
- Klicken Sie im Abschnitt Betriebssystem und Speicher auf Ändern, um mit der Konfiguration des Bootlaufwerks zu beginnen.
- Wählen Sie auf dem Tab Öffentliche Images in der Liste Betriebssystem die Option Ubuntu aus.
- Wählen Sie aus der Liste Version die Option Ubuntu 24.04 LTS aus.
- Klicken Sie auf Auswählen.
- Wählen Sie im Bereich Firewall die Option HTTP-Traffic zulassen aus.
- 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.
- Rufen Sie in der Google Cloud Console die Seite VM-Instanzen auf.
-
Klicken Sie in der Liste der VM-Instanzen in der Zeile der Instanz, zu der Sie eine Verbindung herstellen möchten, auf SSH.

Bereinigen
Mit den folgenden Schritten vermeiden Sie, dass Ihrem Google Cloud -Konto die auf dieser Seite verwendeten Ressourcen in Rechnung gestellt werden:
Rufen Sie in der Google Cloud Console die Seite VM-Instanzen auf.
Wählen Sie die Zeile mit der VM-Instanz aus, die Sie in dieser Anleitung erstellt haben.
Klicken Sie auf Löschen und dann noch einmal auf Löschen, um den Löschvorgang zu bestätigen.