Okay, here is the gcloud command to create a Windows instance with your specifications.
Important Note: As of late 2023 / early 2024, Windows Server 2025 is not yet available as a standard image family on Google Cloud Platform.
The command below uses the Windows Server 2022 Datacenter image family as the latest available alternative that supports nested virtualization on N1 machine types.
gcloud compute instances create YOUR_INSTANCE_NAME: The base command to create a new VM instance. Replace YOUR_INSTANCE_NAME with a unique name for your instance (e.g., win-nested-vm).
--machine-type=n1-standard-8: Specifies the desired machine type with 8 vCPUs and 30 GB RAM.
--enable-nested-virtualization: This crucial flag enables nested virtualization on the instance.
--image-project=windows-cloud: Specifies the project where the official Windows images are hosted.
--image-family=windows-2022-dc: Specifies the image family to use. This will select the latest available image from the Windows Server 2022 Datacenter family. Remember, this is the 2022 version, as 2025 is not yet listed.
--boot-disk-size=50GB: Sets the size of the boot persistent disk to 50 GB.
--boot-disk-type=pd-standard: Specifies the disk type as Standard Persistent Disk. This is the default, but explicitly stating it is good practice.
--zone=YOUR_ZONE: Replace YOUR_ZONE with the Compute Engine zone where you want to create the instance (e.g., us-central1-a, europe-west2-b). You can list available zones using gcloud compute zones list.
Before running:
Make sure you have the gcloud tool installed and authenticated.
Replace YOUR_INSTANCE_NAME with your desired name.
Replace YOUR_ZONE with the appropriate zone.
Be aware of the costs associated with the n1-standard-8 machine type and persistent disk storage.
Once the instance is created, you will need to set a Windows password and connect via RDP.