在 Compute Engine 中建立 Linux VM 執行個體
瞭解如何透過 Google Cloud 控制台,在 Compute Engine 中建立 Linux 虛擬機器 (VM) 執行個體。
如要直接在 Google Cloud 控制台中按照逐步指南操作,請按一下「Guide me」(逐步引導):
事前準備
- 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.
-
Make sure that billing is enabled for your Google Cloud project.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Make sure that billing is enabled for your Google Cloud project.
- 啟用 Compute Engine API。
建立 Linux VM 執行個體
- 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.
- On the Public images tab, choose Ubuntu from the Operating system list.
- Choose Ubuntu 24.04 LTS from the Version list.
- Click Select.
- In the Firewall section, select Allow HTTP traffic.
- To create the VM, click Create.
啟動 VM 執行個體需要一些時間。當 VM 執行個體準備就緒時,就會列在「VM 執行個體」頁面中,並顯示綠色的狀態圖示。
Compute Engine 會將 roles/compute.instanceAdmin
角色授予建立 VM 執行個體的使用者。Compute Engine 也會將該使用者加入 sudo
群組。
連線至 VM 執行個體
請使用 Google Cloud 控制台完成下列步驟,連線至 VM 執行個體。您以用來存取 VM 執行個體頁面的使用者身分連線至 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.
清除所用資源
如要避免系統向您的 Google Cloud 帳戶收取您在本頁所用資源的費用,請按照下列步驟操作。
前往 Google Cloud 控制台的「VM instances」(VM 執行個體) 頁面。
選取您在本教學課程中建立的 VM 執行個體所在的資料列。
依序按一下
「刪除」和「刪除」,確認刪除。
後續步驟
- 參閱教學課程內容,瞭解如何在新的執行個體上設定基本網路伺服器。
- 逐步完成 Google Cloud 控制台中的入門教學課程。
- 瞭解如何使用 gcloud CLI 指令列工具和 API 建立及管理虛擬機器執行個體。
- 進一步瞭解適用於 Compute Engine 的 Linux 映像檔。
- 瞭解如何將檔案轉移至執行個體。