Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Windows
In diesem Dokument wird beschrieben, wie Sie eine Verbindung zur Windows Special Administrative Console (SAC) herstellen.
Die SAC verwendet eine serielle Portverbindung zu einer Windows-VM-Instanz und stützt sich nicht auf die Netzwerkverbindung. Das kann bei der Fehlerbehebung oder Wiederherstellung einer Windows-VM-Instanz hilfreich sein. Durch das Herstellen einer Verbindung zur seriellen Konsole der VM und Verwenden der SAC können Sie den Bootvorgang der VM unterbrechen oder Zugriff auf ein CMD- oder PowerShell-Terminal für die Fehlerbehebung erhalten. Wenn Sie eine allgemeine Remote-Desktop-Verbindung für andere Zwecke als die Fehlerbehebung benötigen, stellen Sie über RDP eine Verbindung zu Windows-VMs her.
Hinweise
Bevor Sie mithilfe der interaktiven seriellen Konsole eine Verbindung zum SAC Ihrer VM herstellen können, aktivieren Sie den interaktiven Zugriff für Ihre VM. Weitere Informationen finden Sie unter: Interaktiven Zugriff auf die serielle Konsole aktivieren.
Richten Sie die Authentifizierung ein, falls Sie dies noch nicht getan haben.
Bei der Authentifizierung wird Ihre Identität für den Zugriff auf Google Cloud -Dienste und APIs überprüft.
Zum Ausführen von Code oder Beispielen aus einer lokalen Entwicklungsumgebung können Sie sich so bei der Compute Engine authentifizieren:
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
Installieren Sie die Google Cloud CLI.
Initialisieren Sie die Google Cloud CLI nach der Installation mit dem folgenden Befehl:
Klicken Sie auf den Namen der VM, zu der Sie eine Verbindung herstellen möchten.
Klicken Sie auf Mit serieller Konsole verbinden, um die interaktive Konsole zu öffnen.
Die interaktive serielle Konsole wird geöffnet. Sie können sie verwenden, wenn Sie die folgende Ausgabe sehen:
Computer is booting, SAC started and initialized.
Use the "ch -?" command for information about using channels.
Use the "?" command for general help.
SAC>
PROJECT_ID: Die ID des Projekts, das die VM enthält
ZONE: Der Name der Zone, in der sich die VM befindet
VM_NAME: der Name der VM
Die interaktive serielle Konsole wird geöffnet. Sie können sie verwenden, wenn Sie die folgende Ausgabe sehen:
Computer is booting, SAC started and initialized.
Use the "ch -?" command for information about using channels.
Use the "?" command for general help.
SAC>
Informationen zur Verwendung der interaktiven seriellen Konsole finden Sie in der Microsoft SAC-Dokumentation.
Eingabeaufforderung in Windows SAC öffnen
So öffnen Sie die Eingabeaufforderung in der SAC:
Geben Sie cmd ein und drücken Sie die Eingabetaste. Die folgende Ausgabe wird angezeigt:
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>
Verwenden Sie den Befehl ch -sn CHANNEL_NAME und drücken Sie die Eingabetaste.
ch -sn CHANNEL_NAME
Ersetzen Sie CHANNEL_NAME durch den Namen des Kanals, den Sie im vorherigen Schritt erstellt haben.
Die Ausgabe sieht in etwa so aus:
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.
Drücken Sie die Leertaste und melden Sie sich dann mit den lokalen Anmeldedaten an, die im System registriert sind.
Please enter login credentials.
Username: USERNAME
Domain: DOMAIN (leave blank if no domain)
Password: PASSWORD
Sobald eine Verbindung besteht, können Sie auf eine Shell für die Eingabeaufforderungs zugreifen.
Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.
C:\Windows\system32>
Optional: Wenn Sie eine Eingabeaufforderung für PowerShell eingeben möchten, geben Sie powershell.exe ein, dann drücken Sie
Eingabetaste.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 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)."]]