Code360 powered by Coding Ninjas X Code360 powered by Coding Ninjas X
Last Updated: Mar 27, 2024

Windows Server Instance in GCP

Leveraging ChatGPT - GenAI as a Microsoft Data Expert
Prerita Agarwal
Data Specialist @
23 Jul, 2024 @ 01:30 PM


You can build and run virtual machines on Google infrastructure using Compute Engine. Large computing clusters may be launched quickly on Google's infrastructure thanks to Compute Engine's scalability, performance, and value. Windows applications can be run on Compute Engine, which offers numerous advantages to virtual machine instances, including dependable storage options, the quick Google network, and autoscaling.

This blog explains the details of Windows Server Instance in GCP along with the details of creating a Virtual Machine and using Remote Desktop (RDP) in the Windows Server.

Without further ado, let's get started.

Google Cloud Platform image

Starting Your Lab

Follow the following steps to start your lab:

  • Select "Start Lab" from the menu. If you need to pay for the lab, a pop-up appears where you may choose your mode of payment. In the Lab Details panel, which is on the left, are the following:
    • The button to access Google Console
    • Time Remaining
    • The temporary login information required for this lab
  • Open the Google Console. The lab starts spinning up resources before opening a new tab on the Sign in page.
  • In the Sign in dialogue, copy the Username from the Lab Details panel if necessary. Choose Next.
  • From the Lab Details panel, copy the password, and then paste it into the Welcome dialogue. Choose Next.
  • Go through the following pages by clicking:
    • Accept the terms and conditions.
    • Do not include two-factor authentication or recovery.
    • Avoid registering for free trials.

The Cloud Console opens on this tab after a little delay.

Let's look at the details of creating a virtual machine.

Get the tech career you deserve, faster!
Connect with our expert counsellors to understand how to hack your way to success
User rating 4.7/5
1:1 doubt support
95% placement record
Akash Pal
Senior Software Engineer
326% Hike After Job Bootcamp
Himanshu Gusain
Programmer Analyst
32 LPA After Job Bootcamp
After Job

Create a virtual machine instance

  • Click Compute EngineVM instances, followed by Create Instance, in the Cloud Console's Navigation menu.
  • Choose zone us east1-b and region us east1.
  • Select N1 for Series in the Machine Configuration section.
  • Click Change in the Boot disc section to start setting your boot disc.
  • Select Windows Server 2012 R2 Datacenter under Version and Windows Server 2012 R2 under Operating system. Maintain the default values for all other settings.
  • To create the instance, click Create.

Activate Cloud Shell

A virtual machine called Cloud Shell is full of programming tools. It uses the Google Cloud and provides a persistent 5GB home directory. Your Google Cloud resources can be accessed via the command line using Cloud Shell.

  • To activate the cloud shell, click. At the top of the Google Cloud dashboard, click the icon for Activate Cloud Shell.
  • Click Continue.

Provisioning and connecting to the environment take some time.

Let's dive into the details of using Remote Desktop into the Windows Server.

Remote Desktop (RDP) into the Windows Server

Use the command line in your Cloud Shell terminal to run the following command to check if the server instance is prepared for an RDP connection:


gcloud compute instances get-serial-port-output instance-1


If asked, enter n into the box.

When you see the following in the command output, which signifies that the OS components have initialised and the Windows Server is prepared to accept your RDP connection, you should continue with the command (attempt in the next step).

RDP into the Windows Server

Run the following command in a Cloud Shell terminal to configure a password for RDP access. Replace [instance] with the VM instance you just created, and set [username] as admin.


gcloud compute reset-windows-password [instance] --zone us-east1-b --user [username]


Depending on whether you are using Windows or not, there are many RDP connections to your server that you can make:

  • It's probable that the Chromebook or other device you're using at a Google Cloud event already has an RDP program installed. Enter the external IP of your VM by clicking the icon shown below, if it is present, in the lower left corner of the screen.
  • If you aren't using Windows but are using Chrome, you can use the Spark View extension to immediately connect to your server over RDP from the browser. Simply select the Add to Chrome button to launch the app.
  • When the program is running, a window will popup where you can connect using the Windows username admin and password you saw in the command's output.
  • Add the External IP of your VM instance as your domain. To confirm that you want to connect, click Connect.
  • There are various freely accessible RDP Client packages that you can install if you're using a Mac, including CoRD. After installation, use the same method to connect to the Windows server's External IP address. When it connects, a login screen will appear where you can log in using the Windows username admin and password from the command's output (ignore the Domain: field).

You ought to see the Windows desktop once you've logged in!

Copy and paste with the RDP client

It's possible that you'll find yourself copying and pasting commands from the lab handbook once you've safely logged in to your instance.

  • Hold CTRL and V to paste (if you are a Mac user, using CMND-V will not work.)
  • Make sure you have clicked into the Powershell window if you are in one; otherwise, the paste shortcut won't function.
  • Right-click while pasting into the putty.

Frequently Asked Questions

What is an instance in a VM?

A virtual machine (VM) hosted on Google's infrastructure is referred to as an instance. The Google Cloud app, Google Cloud CLI, or Compute Engine API can all be used to create an instance or a collection of managed instances.

What is a cluster?

A group of machines that run containerized apps is known as a Kubernetes cluster. Applications are packaged with their dependencies and some essential services when they are containerized. They are less heavy and more adaptable than virtual machines.

What is the port for RDP?

A Microsoft-exclusive protocol called Remote Desktop Protocol (RDP) facilitates remote connections to other computers, often over TCP port 3389.


In this article, we have extensively discussed the details of Windows Server Instance in GCP along with the details of creating a Virtual Machine and using Remote Desktop (RDP) in the Windows Server.

We hope that this blog has helped you enhance your knowledge regarding Windows Server Instance in GCP, and if you would like to learn more, check out our articles on Google Cloud Certification. You can refer to our guided paths on the Coding Ninjas Studio platform to learn more about DSADBMSCompetitive ProgrammingPythonJavaJavaScript, etc. To practice and improve yourself in the interview, you can also check out Top 100 SQL problemsInterview experienceCoding interview questions, and the Ultimate guide path for interviews. Do upvote our blog to help other ninjas grow. Happy Coding!!

Thank You Image
Topics covered
Starting Your Lab
Create a virtual machine instance
Activate Cloud Shell
Remote Desktop (RDP) into the Windows Server
RDP into the Windows Server
Copy and paste with the RDP client
Frequently Asked Questions
What is an instance in a VM?
What is a cluster?
What is the port for RDP?