Crea un'istanza VM Linux in Compute Engine

Scopri come creare un'istanza di macchina virtuale (VM) Linux in Compute Engine utilizzando la Google Cloud console.


Per seguire le indicazioni dettagliate per questa attività direttamente nella Google Cloud console, fai clic su Procedura guidata:

Procedura guidata


Prima di iniziare

  1. Accedi al tuo Google Cloud account. Se non conosci Google Cloud, crea un account per valutare le prestazioni dei nostri prodotti in scenari reali. I nuovi clienti ricevono anche 300 $di crediti senza costi per l'esecuzione, il test e il deployment dei workload.
  2. 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 the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

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

      Go to IAM
    2. Select the project.
    3. Click Grant access.
    4. In the New principals field, enter your user identifier. This is typically the email address for a Google Account.

    5. Click Select a role, then search for the role.
    6. To grant additional roles, click Add another role and add each additional role.
    7. Click Save.
  5. 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 the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

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

      Go to IAM
    2. Select the project.
    3. Click Grant access.
    4. In the New principals field, enter your user identifier. This is typically the email address for a Google Account.

    5. Click Select a role, then search for the role.
    6. To grant additional roles, click Add another role and add each additional role.
    7. Click Save.
  8. Abilita l'API Compute Engine

    Abilita l'API Compute Engine

Crea un'istanza VM Linux

  1. Nella Google Cloud console, vai alla pagina Crea un'istanza.

    Vai a Crea un'istanza

  2. Nella sezione Sistema operativo e spazio di archiviazione, fai clic su Cambia per iniziare a configurare il disco di avvio.
  3. Nella scheda Immagini pubbliche, scegli Ubuntu dall'elenco Sistema operativo.
  4. Scegli Ubuntu 24.04 LTS dall'elenco Versione.
  5. Fai clic su Seleziona.
  6. Nella sezione Firewall, seleziona Consenti traffico HTTP.
  7. Per creare la VM, fai clic su Crea.

Attendi qualche istante per consentire l'avvio dell'istanza VM. Quando l'istanza VM è pronta, viene elencata nella pagina Istanze VM con un'icona di stato verde.

Compute Engine assegna il ruolo roles/compute.instanceAdmin all'utente che crea l'istanza VM. Compute Engine aggiunge anche l'utente al gruppo sudo.

Connettiti all'istanza VM

Connettiti a un'istanza VM utilizzando la Google Cloud console e completando i seguenti passaggi. Sei connesso all'istanza VM come utente che hai utilizzato per accedere alla pagina Istanze VM.

  1. Nella Google Cloud console, vai alla pagina Istanze VM.

    Vai a Istanze VM

  2. Nell'elenco delle istanze della macchina virtuale, fai clic su SSH nella riga di l'istanza a cui vuoi connetterti.

    Pulsante SSH accanto al nome dell'istanza.

Libera spazio

Per evitare che al tuo Google Cloud account vengano addebitati costi relativi alle risorse utilizzate in questa pagina, segui questi passaggi.

  1. Nella console Google Cloud , vai alla pagina Istanze VM.

    Vai a Istanze VM

  2. Seleziona la riga contenente l'istanza VM che hai creato in questo tutorial.

  3. Fai clic su Elimina, quindi fai clic su Elimina per confermare.

Passaggi successivi