Crie uma instância de VM Linux no Compute Engine
Saiba como criar uma instância de máquina virtual (VM) Linux no Compute Engine através da Google Cloud consola.
Para seguir orientações passo a passo para esta tarefa diretamente na Google Cloud consola, clique em Orientar-me:
Antes de começar
- 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.
-
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
(
roles/resourcemanager.projectCreator
), which contains theresourcemanager.projects.create
permission. 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.
Aceder ao IAM - Selecione o projeto.
- Clique em Conceder acesso.
-
No campo Novos responsáveis, introduza o identificador do utilizador. Normalmente, este é o endereço de email de uma Conta Google.
- Na lista Selecionar uma função, selecione uma função.
- Para conceder funções adicionais, clique em Adicionar outra função e adicione cada função adicional.
- Clique em Guardar.
-
-
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
(
roles/resourcemanager.projectCreator
), which contains theresourcemanager.projects.create
permission. 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.
Aceder ao IAM - Selecione o projeto.
- Clique em Conceder acesso.
-
No campo Novos responsáveis, introduza o identificador do utilizador. Normalmente, este é o endereço de email de uma Conta Google.
- Na lista Selecionar uma função, selecione uma função.
- Para conceder funções adicionais, clique em Adicionar outra função e adicione cada função adicional.
- Clique em Guardar.
-
- Ative a API Compute Engine.
Crie uma instância de VM Linux
- In the Google Cloud console, go to the Create an instance page.
- In the Boot disk section, click Change to begin configuring your boot disk.
- No separador Public images, escolha Ubuntu na lista Sistema operativo.
- Escolha Ubuntu 24.04 LTS na lista Versão.
- Clique em Selecionar.
- Na secção Firewall, selecione Permitir tráfego HTTP.
- Para criar a VM, clique em Criar.
Aguarde um curto período para que a instância de VM seja iniciada. Quando a instância de VM estiver pronta, é apresentada na página Instâncias de VM com um ícone de estado verde.
O Compute Engine concede a função roles/compute.instanceAdmin
ao utilizador que cria a instância de VM. O Compute Engine também adiciona esse utilizador ao grupo sudo
.
Estabeleça ligação à instância de VM
Estabeleça ligação a uma instância de VM através da Google Cloud consola e conclua os passos seguintes. Tem ligação à instância de VM como o utilizador que usou para aceder à página de instâncias de VM.
- In the Google Cloud console, go to the VM instances page.
-
In the list of virtual machine instances, click SSH in the row of
the instance that you want to connect to.
Limpar
Para evitar incorrer em cobranças na sua Google Cloud conta pelos recursos usados nesta página, siga estes passos.
Na Google Cloud consola, aceda à página Instâncias de VM.
Selecione a linha que contém a instância de VM que criou neste tutorial.
Clique em
Eliminar e, de seguida, clique em Eliminar para confirmar.
O que se segue?
- Siga um tutorial para configurar um servidor Web básico na nova instância.
- Siga um tutorial de introdução na Google Cloud consola.
- Saiba como criar e gerir instâncias de máquinas virtuais através da ferramenta de linha de comandos e da API gcloud CLI.
- Saiba mais sobre as imagens Linux disponíveis no Compute Engine.
- Saiba como transferir os seus ficheiros para a instância.