Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Dengan integrasi Compute Engine Cloud Code, Anda dapat melihat VM Compute Engine yang menjalankan aplikasi, membuat koneksi ke VM menggunakan SSH, melihat log aplikasi, dan mengupload file ke VM.
Dokumen ini menunjukkan cara mengakses Compute Engine dengan Cloud Code di IDE dan mengelola instance VM Anda.
Melihat VM
Untuk melihat VM di project Google Cloud dan detail instance VM di
konsol Google Cloud , ikuti langkah-langkah berikut:
Di IDE, login ke Cloud Code jika Anda belum melakukannya, lalu pilih project Google Cloud Anda.
Untuk melihat instance VM dalam project Google Cloud , di panel aktivitas IDE, klik Cloud Code, lalu luaskan eksplorasi Compute Engine.
Untuk melihat detail instance VM di konsol Google Cloud , klik kanan instance VM, lalu pilih Open in Cloud Console.
Menghubungkan ke VM
Untuk terhubung ke instance VM di IDE dengan Cloud Code menggunakan terminal IDE bawaan dan SSH, ikuti langkah-langkah berikut:
Untuk terhubung ke instance VM, di penjelajah Compute Engine, arahkan kursor ke instance VM, lalu klik terminalOpen SSH atau klik kanan instance VM, lalu pilih Open SSH.
Terminal akan muncul, menampilkan informasi tentang instance jarak jauh.
Jika koneksi ke instance VM gagal:
Untuk pengguna Windows dan Linux, lihat Memecahkan masalah error SSH untuk mengetahui error umum yang mungkin Anda alami saat terhubung ke VM menggunakan SSH, cara mengatasi error, dan metode untuk mendiagnosis koneksi SSH yang gagal.
Untuk pengguna macOS, setelah menekan tombol apa pun untuk menghapus pesan error di
terminal, dialog pesan error akan muncul. Untuk melihat
informasi di terminal tentang masalah dan potensi resolusinya,
klik Pecahkan masalah. Atau, untuk melihat dokumentasi Memecahkan masalah error SSH, klik Pelajari lebih lanjut.
Melihat log aplikasi di VM
Untuk melihat log aplikasi instance VM, ikuti langkah-langkah berikut:
Untuk melihat log aplikasi instance VM di Cloud Code,
klik kanan instance VM, lalu pilih Lihat Log.
Jendela Logs Viewer akan muncul di IDE, yang memungkinkan Anda memfilter menurut jenis log, waktu, tingkat keparahan, dan instance.
Untuk melihat log secara real time, aktifkan tombol Streaming.
Untuk melihat halaman logging untuk instance VM tertentu di Google Cloud konsol,
klik open_in_newBuka di browser.
Mengupload file ke VM
Untuk menyalin file aplikasi dari IDE lokal ke instance VM jarak jauh, ikuti
langkah-langkah berikut:
Untuk mengupload file ke VM, di penjelajah Compute Engine Cloud Code, arahkan kursor ke instance VM, lalu klik cloud_uploadUpload File via SCP, atau klik kanan instance VM, lalu pilih Upload File via SCP.
Buka file yang ingin Anda upload, lalu klik Upload.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-08-11 UTC."],[[["\u003cp\u003eCloud Code enables you to view, manage, and connect to Compute Engine VMs directly within your IDE.\u003c/p\u003e\n"],["\u003cp\u003eYou can establish SSH connections to your VMs using Cloud Code's built-in terminal, with troubleshooting resources available for connection issues.\u003c/p\u003e\n"],["\u003cp\u003eCloud Code allows you to view application logs from your VM instances within the IDE's Logs Viewer, including real-time streaming and filtering options.\u003c/p\u003e\n"],["\u003cp\u003eWith Cloud Code, you can upload files from your local machine to Linux VMs via SCP, facilitating application deployment and file transfer.\u003c/p\u003e\n"]]],[],null,["# Manage VMs in Cloud Code for VS Code\n\nWith Cloud Code's Compute Engine integration, you can view the Compute Engine VMs running your applications, establish connections to your VMs using SSH, view application logs, and upload files to a VM.\n\n\u003cbr /\u003e\n\nThis document shows you how to access Compute Engine with\nCloud Code in your IDE and manage your VM instances.\n\nView VMs\n--------\n\nTo view VMs in your Google Cloud project and the VM instance details in\nthe Google Cloud console, follow these steps:\n\n1. In your IDE, sign into Cloud Code if you haven't already, and\n select your Google Cloud project.\n\n2. To view VM instances in your Google Cloud project, in the activity bar\n of your IDE, click **Cloud Code** and then expand the\n **Compute Engine** explorer.\n\n3. To view the VM instance details in the Google Cloud console, right-click the\n VM instance and select **Open in Cloud Console**.\n\nConnect to a VM\n---------------\n\nTo connect to the VM instance in your IDE with Cloud Code using the\nbuilt-in IDE terminal and SSH, follow these steps:\n\n1. To connect to a VM instance, in the **Compute Engine** explorer, hold the\n pointer over the VM instance and click\n terminal **Open SSH** or right-click\n the VM instance and select **Open SSH**.\n\n A terminal appears, displaying information about the remote instance.\n2. If the connection to the VM instance fails:\n\n - For Windows and Linux users, see\n [Troubleshooting SSH errors](/compute/docs/troubleshooting/troubleshooting-ssh-errors)\n for common errors that you might run into when connecting to a VM using SSH,\n ways to resolve errors, and methods for diagnosing failed SSH connections.\n\n - For macOS users, after pressing any key to clear the error message in the\n terminal, an error message dialog appears. To view\n information in the terminal about the issue and potential resolutions,\n click **Troubleshoot** . Or, to view the\n [Troubleshooting SSH errors](/compute/docs/troubleshooting/troubleshooting-ssh-errors)\n documentation, click **Learn more**.\n\nView application logs on a VM\n-----------------------------\n\nTo view the application logs of a VM instance, follow these steps:\n\n1. To view the application logs of a VM instance in Cloud Code,\n right-click the VM instance and select **View Logs**.\n\n The Logs Viewer window appears in your IDE, allowing you to filter by log\n type, time, severity, and instance.\n2. To view logs in real time, turn on the **Streaming** toggle.\n\n3. To view the logging page for a particular VM instance in the Google Cloud console,\n click open_in_new\n **Open in browser**.\n\nUpload a file to a VM\n---------------------\n\nTo copy application files from your local IDE to your remote VM instance, follow\nthese steps:\n| **Note:** Cloud Code only supports [transferring files to Linux\n| VMs](/compute/docs/instances/transfer-files). For additional options for Windows machines, see [Transfer files to Windows VMs](/compute/docs/instances/transfer-files-windows).\n\n1. To upload a file to a VM, in the Cloud Code **Compute Engine**\n explorer, hold the pointer over the VM instance and click\n cloud_upload\n **Upload File via SCP** , or right-click the VM instance and select **Upload\n File via SCP**.\n\n2. Navigate to the file that you want to upload and click **Upload**."]]