Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Windows
Dokumen ini menjelaskan cara terhubung ke
Windows Special Administrative Console (SAC).
SAC menggunakan koneksi port serial ke instance virtual machine (VM) Windows dan tidak bergantung pada konektivitas jaringan, yang dapat membantu memecahkan masalah atau memulihkan instance VM Windows. Dengan terhubung ke konsol serial VM dan menggunakan SAC, Anda dapat menghentikan proses booting VM atau mendapatkan akses ke terminal CMD atau PowerShell untuk melakukan pemecahan masalah. Untuk pengalaman desktop jarak jauh serbaguna selain pemecahan masalah, hubungkan ke VM Windows menggunakan RDP.
Sebelum memulai
Sebelum dapat terhubung ke SAC VM menggunakan konsol serial interaktif, aktifkan akses interaktif untuk VM Anda. Untuk mengetahui informasi selengkapnya, lihat Mengaktifkan akses interaktif di konsol serial.
Jika Anda belum melakukannya, siapkan autentikasi.
Autentikasi adalah
proses yang digunakan untuk memverifikasi identitas Anda untuk mengakses Google Cloud layanan dan API.
Untuk menjalankan kode atau sampel dari lingkungan pengembangan lokal, Anda dapat melakukan autentikasi ke
Compute Engine dengan memilih salah satu opsi berikut:
Select the tab for how you plan to use the samples on this page:
Console
When you use the Google Cloud console to access Google Cloud services and
APIs, you don't need to set up authentication.
gcloud
Menginstal Google Cloud CLI.
Setelah penginstalan,
lakukan inisialisasi Google Cloud CLI dengan menjalankan perintah berikut:
Klik Hubungkan ke konsol serial untuk membuka konsol interaktif.
Konsol serial interaktif akan terbuka. Konsol ini siap digunakan jika Anda melihat
output berikut:
Computer is booting, SAC started and initialized.
Use the "ch -?" command for information about using channels.
Use the "?" command for general help.
SAC>
Konsol serial interaktif akan terbuka. Konsol ini siap digunakan jika Anda melihat
output berikut:
Computer is booting, SAC started and initialized.
Use the "ch -?" command for information about using channels.
Use the "?" command for general help.
SAC>
Untuk mengetahui informasi tentang cara menggunakan konsol serial interaktif, lihat
dokumentasi Perintah SAC Microsoft.
Membuka Command Prompt di Windows SAC
Untuk membuka Command Prompt di SAC, lakukan hal berikut:
Ketik cmd, lalu tekan Enter. Anda akan melihat output berikut:
SAC>cmd
The Command Prompt session was successfully launched.
SAC>
EVENT: A new channel has been created. Use "ch -?" for channel help.
Channel: Cmd0001
SAC>
Gunakan perintah ch -sn CHANNEL_NAME, lalu tekan
Enter.
ch -sn CHANNEL_NAME
Ganti CHANNEL_NAME dengan nama
channel yang Anda buat di langkah sebelumnya.
Outputnya mirip dengan hal berikut ini:
Name: Cmd0001
Description: Command
Type: VT-UTF8
Channel GUID: 28de7392-5413-11ea-bb03-c9656a2ed613
Application Type GUID: 63d02271-8aa4-11d5-bccf-00b0d014a2d0
Press <esc><tab> for next channel.
Press <esc><tab>0 to return to the SAC channel.
Use any other key to view this channel.
Tekan Spasi, lalu login dengan kredensial lokal yang terdaftar di sistem.
Please enter login credentials.
Username: USERNAME
Domain: DOMAIN (leave blank if no domain)
Password: PASSWORD
Setelah terhubung, Anda memiliki akses ke shell Command Prompt.
Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.
C:\Windows\system32>
Opsional: Untuk memasukkan perintah Powershell, ketik powershell.exe, lalu tekan
Enter.
[[["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-18 UTC."],[[["\u003cp\u003eThis document details how to connect to the Windows Special Administrative Console (SAC) via a serial port, enabling troubleshooting and recovery of Windows virtual machine (VM) instances without network reliance.\u003c/p\u003e\n"],["\u003cp\u003eBefore connecting, ensure you enable interactive access for your VM and set up authentication as required for access to Google Cloud services and APIs.\u003c/p\u003e\n"],["\u003cp\u003eYou can connect to the serial console through the Google Cloud console or using the \u003ccode\u003egcloud\u003c/code\u003e command-line tool, both of which will display a prompt if successfully connected.\u003c/p\u003e\n"],["\u003cp\u003eWithin the SAC, you can access a Command Prompt by typing \u003ccode\u003ecmd\u003c/code\u003e and then use channel commands to interact, or optionally access a PowerShell prompt by typing \u003ccode\u003epowershell.exe\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe SAC is a valuable tool for accessing a CMD or PowerShell terminal for troubleshooting, or interrupting a VM's boot process, but it does not support IP based access restrictions.\u003c/p\u003e\n"]]],[],null,["# Connect to a Windows VM's SAC\n\nWindows\n\n*** ** * ** ***\n\nThis document describes how to connect to the\n[Windows Special Administrative Console](https://technet.microsoft.com/en-us/library/cc787940) (SAC).\nThe SAC uses a serial port connection to a Windows virtual machine (VM) instance\nand doesn't rely on network connectivity, which can help troubleshoot or recover\na Windows VM instance. By connecting to the VM's serial console and using the SAC,\nyou can interrupt the VM's boot process or gain access to a CMD or PowerShell\nterminal to perform troubleshooting. For a general purpose remote desktop\nexperience other than troubleshooting,\n[connect to Windows VMs using RDP](/compute/docs/instances/connecting-to-windows).\n\nBefore you begin\n----------------\n\n- Before you can connect to your VM's SAC by using the interactive serial console, enable interactive access for your VM. For more information, see [Enabling interactive access on the serial console](/compute/docs/troubleshooting/troubleshooting-using-serial-console#enabling_interactive_access_on_the_serial_console).\n- If you haven't already, set up [authentication](/compute/docs/authentication). Authentication verifies your identity for access to Google Cloud services and APIs. To run code or samples from a local development environment, you can authenticate to Compute Engine by selecting one of the following options:\n\n Select the tab for how you plan to use the samples on this page: \n\n ### Console\n\n\n When you use the Google Cloud console to access Google Cloud services and\n APIs, you don't need to set up authentication.\n\n ### gcloud\n\n 1.\n [Install](/sdk/docs/install) the Google Cloud CLI.\n\n After installation,\n [initialize](/sdk/docs/initializing) the Google Cloud CLI by running the following command:\n\n ```bash\n gcloud init\n ```\n\n\n If you're using an external identity provider (IdP), you must first\n [sign in to the gcloud CLI with your federated identity](/iam/docs/workforce-log-in-gcloud).\n | **Note:** If you installed the gcloud CLI previously, make sure you have the latest version by running `gcloud components update`.\n 2. [Set a default region and zone](/compute/docs/gcloud-compute#set_default_zone_and_region_in_your_local_client).\n\n| **Caution:** The interactive serial console does not support IP-based access restrictions such as IP-based include lists or exclude lists. If you enable the interactive serial console on an instance, anyone from any IP address is able to connect if they know a local username, project ID, zone, and instance name.\n\nConnect to the Serial Console\n-----------------------------\n\nTo connect to your Windows instance using an interactive serial console,\ncomplete the steps in one of the following tabs.\n\n#### Permissions required for this task\n\nTo perform this task, you must have the following\n[permissions](/iam/docs/overview#permissions):\n\n\n- `compute.instances.setMetadata` on the VM if enabling interactive access on a specific VM\n- `compute.projects.setCommonInstanceMetadata` on the project, if enabling interactive access for all VMs in the project\n- `iam.serviceAccountUser` role on the instance's service account \n\n### Console\n\n1. In the Google Cloud console, go to the **VM instances** page.\n\n [Go to VM instances](https://console.cloud.google.com/compute/instances)\n2. Click the name of the VM you want to connect to.\n\n3. Click **Connect to serial console** to open the interactive\n console.\n\nThe interactive serial console opens. It's ready to use when you see the\nfollowing output: \n\n```\nComputer is booting, SAC started and initialized.\n\nUse the \"ch -?\" command for information about using channels.\nUse the \"?\" command for general help.\n\nSAC\u003e\n```\n\nIf the interactive serial console is a blank screen with a blinking cursor,\nit is likely because the [Emergency Management Services](https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/boot-parameters-to-enable-ems-redirection)\nare off.\nSee [troubleshooting interactive serial console](/compute/docs/troubleshooting/troubleshooting-windows#troubleshooting-interactive-serial-console)\nto learn how to resolve this issue.\n\n### gcloud\n\nUse the [`gcloud compute connect-to-serial-port`\ncommand](/sdk/gcloud/reference/compute/connect-to-serial-port) to connect to\nVM instances that have serial port access enabled: \n\n```\ngcloud compute connect-to-serial-port VM_NAME \\\n --port=2 \\\n --zone=ZONE \\\n --project=PROJECT_ID\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the ID of the project that contains the VM\n- \u003cvar translate=\"no\"\u003eZONE\u003c/var\u003e: the name of the zone in which the VM is located\n- \u003cvar translate=\"no\"\u003eVM_NAME\u003c/var\u003e: the name of the VM\n\nThe interactive serial console opens. It is ready to use when you see the\nfollowing output: \n\n```\nComputer is booting, SAC started and initialized.\n\nUse the \"ch -?\" command for information about using channels.\nUse the \"?\" command for general help.\n\nSAC\u003e\n```\n\nIf the interactive serial console is a blank screen with a blinking cursor,\nit is likely because the [Emergency Management Services](https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/boot-parameters-to-enable-ems-redirection)\nare off.\nSee [troubleshooting interactive serial console](/compute/docs/troubleshooting/troubleshooting-windows#troubleshooting-interactive-serial-console)\nto learn how to resolve this issue.\n\nFor information about using the interactive serial console, see the Microsoft\n[SAC Commands documentation](https://technet.microsoft.com/en-us/library/cc787940#sac-commands).\n\nOpen Command Prompt in Windows SAC\n----------------------------------\n\nTo open Command Prompt in the SAC, do the following:\n\n1. Type `cmd`, then press **Enter**. You see the following output:\n\n ```\n SAC\u003ecmd\n The Command Prompt session was successfully launched.\n SAC\u003e\n EVENT: A new channel has been created. Use \"ch -?\" for channel help.\n Channel: Cmd0001\n SAC\u003e\n ```\n2. Use the `ch -sn `\u003cvar translate=\"no\"\u003eCHANNEL_NAME\u003c/var\u003e command, then press\n **Enter**.\n\n ```\n ch -sn CHANNEL_NAME\n ```\n\n Replace \u003cvar translate=\"no\"\u003eCHANNEL_NAME\u003c/var\u003e with the name of the\n channel you created in the previous step.\n\n The output is similar to the following: \n\n ```\n Name: Cmd0001\n Description: Command\n Type: VT-UTF8\n Channel GUID: 28de7392-5413-11ea-bb03-c9656a2ed613\n Application Type GUID: 63d02271-8aa4-11d5-bccf-00b0d014a2d0\n\n Press \u003cesc\u003e\u003ctab\u003e for next channel.\n Press \u003cesc\u003e\u003ctab\u003e0 to return to the SAC channel.\n Use any other key to view this channel.\n ```\n3. Press **Space**, then login with the local credentials registered on the\n system.\n\n ```\n Please enter login credentials.\n Username: USERNAME\n Domain: DOMAIN (leave blank if no domain)\n Password: PASSWORD\n ```\n | **Note:** If you are unsure of the credentials, you might be able to [create or\n | reset the password](/compute/docs/instances/windows/creating-passwords-for-windows-instances).\n\n Once connected, you have access to a Command Prompt shell. \n\n ```\n Microsoft Windows [Version 10.0.14393]\n (c) 2016 Microsoft Corporation. All rights reserved.\n\n C:\\Windows\\system32\u003e\n ```\n4. Optional: To enter a Powershell prompt, type `powershell.exe`, then press\n **Enter**.\n\n | **Note:** Pasting into the SAC Powershell terminal might result in repeated characters in the pasted text. You can prevent this on a per-session basis by issuing the `Remove-Module PSReadLine` command in your terminal.\n\nWhat's next\n-----------\n\n- Learn how to [connect to Windows VMs using RDP](/compute/docs/instances/connecting-to-windows)\n- Learn how to [troubleshoot Interactive Serial Console](/compute/docs/troubleshooting/troubleshooting-windows#troubleshooting-interactive-serial-console)."]]