To connect to Windows instances using RDP (Remote Desktop Protocol) in the Google Cloud Platform Console, or through a graphical interface, follow the steps in the tabs below:
Connect using a graphical RDP client
Before you connect, make sure you have created a Windows instance password and have it ready to enter in the following steps:
Console:
To connect using the GCP Console with the Chrome RDP extension, do the following:
install the Chrome RDP for Google Cloud Platform extension.
Go to the VM instances page in GCP Console and find the Windows instance you want to connect to.
Click the RDP button for the instance you want to connect to. The Chrome RDP extension opens.
Enter the domain, your username, and password, then click OK to connect.
If your instance does not have a domain configured, you may leave the Domain field blank.
If prompted, press Continue to accept the certificate.
Remote Desktop:
To connect with Microsoft Windows Remote Desktop, do the following:
Identify the external IP address of your Windows instance from the VM instances page.
Alternatively, find the external IP address by running the
gcloud
instances list
command in thegcloud
command line tool:gcloud compute instances list
Open Microsoft Windows Remote Desktop Connection on your Windows machine.
Note: The executable can be located at %systemroot%/system32/mstsc.exeEnter the external IP address into the Computer field. Click Connect.
Note: If you've configured your instance to use a different port number for RDP, add it after the IP address. For example:1.2.3.4:3389
.Enter your username and password. Then click OK to connect.
f you have difficulties connecting using RDP, see the Troubleshooting RDP page.
Connect to a Windows instance using the command line
This section describes how to connect to your Windows instance using an interactive serial console, or the Windows Special Administrative Console (SAC), which is often used for advanced troubleshooting on Windows instances.
For more on using the interactive serial console, see Interacting with the serial console.
To connect to your Windows instance using an interactive serial console, follow the steps in the tabs below:
Serial Console
To connect to your Windows instance using an interactive serial console through the GCP Console, do the following:
Open the VM instances page in GCP Console and click on the name of your instance. The VM instance details page opens.
Click Edit. Under *Remote access, select Enable connecting to serial ports. This enables the interactive serial console for this instance.
Alternatively, if you want these settings to apply to all instances in your project, set project-wide custom metadata instead.
Caution: The interactive serial console does not support IP-based access restrictions such as IP based allow-lists or block-lists. If you enable the interactive serial console on an instance, anyone from any IP address will be able to connect if they know the SSH key, username, project ID, zone, and instance name.For more on updating instance metadata, see Storing and retrieving instance metadata
Click Save, then return to the top of the page.
Under Remote access, click the dropdown next to Connect to serial console, and select Serial port 2. AWindows Special Administrative Console (SAC) opens.
At the
SAC>
prompt, runcmd
to create a new channel. SAC returns the channel name, such asCmd001
.Run
ch -sn [CHANNEL_NAME]
and press any key to connect to the channel. For example: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> ch -sn cmd0001 Press any key to confirm connection to the channel.
Enter the username, domain, and password of the instance to connect.
Note: If the instance does not have a domain configured, don't input anything at the domain prompt; just press enter to continue.
Gcloud
To connect to your Windows instance using an interactive serial console through the gcloud
command line tool, do the following:
If you haven't done so already, download and install the Google Cloud SDK for your local operating system. See Installing Google Cloud SDK.
Launch Google Cloud SDK.
Run the following command to configure your instance to allow for connecting to serial ports.
gcloud compute instances add-metadata [INSTANCE_NAME] --metadata=serial-port-enable=1
Optional: If you want the settings to apply to all instances in your project, run the following
gcloud
SDK command instead:gcloud compute project-info add-metadata --metadata=serial-port-enable=1
For more on project-wide custom metadata, see Setting project-wide custom metadata
Caution: The interactive serial console does not support IP-based access restrictions such as IP based allow-lists or block-lists. If you enable the interactive serial console on an instance, anyone from any IP address will be able to connect if they know the SSH key, username, project ID, zone, and instance name. Note: You can also configure your instance's metadata by clicking the Edit button for your instance on the VM instance page.For more on updating metadata, see Updating instance metadata
Run the following
gcloud
command to enter an interactive session:gcloud compute connect-to-serial-port [INSTANCE_NAME] --port=2
At the
SAC>
prompt, runcmd
to create a new channel. SAC returns the channel name, such asCmd001
.Run
ch -sn [CHANNEL_NAME]
and press any key to connect to the channel. For example: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> ch -sn cmd0001 Press any key to confirm connection to the channel.
Enter the username, domain, and password of the instance to connect.
Note: If the instance does not have a domain configured, don't input anything at the domain prompt; just press enter to continue.