This article is a quick guide for adding a Microsoft Windows template to use with your GCP Workspot deployment. It is part of the Getting Started with Workspot article series.
Creating Templates for Use with GCP
If you already have suitable template images in GCP, you can use these.
Otherwise, to create a Workspot template from an existing master image, you first prepare your image in VHD, VHDX, or VMDK format, then upload them to GCP. We suggest selecting a basic image to serve as a foundational template that you can adjust later according to your needs. Follow the procedure in Creating a Windows VHD Image on Hyper-V.
Importing Templates into GCP
You first upload your master image to a GCP Storage Bucket. From there, with the help of Google tools and Workspot Control, you transform it into a Workspot template.
Creating a Storage Bucket
To create a Storage Bucket, go to the menu in GCP, then look for “Cloud Storage > Buckets”:

Create a bucket with a name like “mytemplates.”

Go to the bucket, and then go to the permissions tab.
Add a new permission for all users
Note: This step is based on GCP documentation and is offered as one way to proceed if you are not familiar with GCP templates. If you are familiar with a different workflow, use that.
This step is temporary. It will be reversed after the image has been uploaded and converted to a GCP image.
Assign to New Principals: Grant the required roles to the project’s Compute Engine or Cloud Build service account (for example:
roles/storage.objectViewerandroles/compute.storageAdmin) instead of granting access toallUsers.Assign Roles:
“Cloud Storage > Storage Object Creator”
“Cloud Storage > Storage Object Viewer”

Upload the Image
Upload the VHD, VHDX, or VMDK image from the local machine to the Storage Bucket:
Navigate to Cloud Storage and click on the Bucket.
In the next screen, click on Upload Files. A File Explorer window will appear. Choose the VHD file you want to upload.

The upload process will start, and the status can be monitored in a tiny window on the bottom-right corner of the page

The status will show as complete once the upload is done, and you can find the file uploaded in the bucket.
Click on the File Details to copy the gsutil URI for future use.

Convert the Image to a GCP-supported Image
Once the image has been uploaded, you need to convert the VHD, VHDX, or VMDK into a GCP Image using Cloud Shell. (See also the GCP article Gcloud Compute Images Import.)
For an image without UEFI boot enabled, create a GCP image from the imported VHD file above by running the following command, replacing your details in < > parameters:
gcloud compute images import <Name of the Image> --os=<image os> --source-file="<URI or location of the vhd file gs:uri>" --project "<ProjectID>" --network=<VPC Name> --subnet=<Subnet name>
Example:
gcloud compute images import win11ax --os=windows-11-x64-byol --source-file="gs://templatefolder/win11baseimage.vhd" --project "demo" --network=default --subnet=subnet-daas
For an image with UEFI boot enabled, tag the image with the “UEFI_COMPATIBLE" feature.
gcloud compute images import <Name of the Image> --os=<image os> --source-file="<URI or location of the vhd file gs:uri>" --project "<ProjectID>" --network=<VPC Name> --subnet=<Subnet name> --guest-os-features="UEFI_COMPATIBLE"
Example:
gcloud compute images import win11ax --os=windows-11-x64-byol --source-file="gs://templatefolder/win11image.vhd" --project "demo" --network=default --subnet=subnet-daas --guest-os-features="UEFI_COMPATIBLE"
Please also follow the following document for the steps to create a UEFI/Gen2 disk and image: Creating a Windows VHD Image on Hyper-V.
Run the command in Cloud Shell. When it finishes, you will see the image under “Compute Engine > Images”:

If you set the “allUsers” permissions in a prior step, remove them now, as they are no longer required.
Create a Workspot Template from the Image
The next step is to create a Workspot template from the image we just created, using Control’s “Add Image” and “Build Template” features.
Log in to Workspot Control: https://control.workspot.com
Navigate to “Setup > Cloud > Public Cloud.” Choose the GCP Cloud Configuration you have created.

On the new page, in the Custom Images Section, you will find the button “Add Images”. Click on the button.

A new Window will pop up – “Add Custom Image.” In the Image name field, set the “OS Type” radio buttons according to the OS type (Window desktop OS or Windows server OS). Click the “Save” button. This will add the image under the Custom Image tab.

Now, click on the “Build Template” button. The “Build Template” page will pop up.

Select your primary GCP region and default zone.
Set the OS type as you did with the “Add Custom Image” step.
Choose the correct image in the “Image” pull-down menu.
Provide a name for the template. This is that name that will be used by Control for the template.
Choose the Template VM type by clicking “Select” to reveal the menu of choices.
For deploying machines that are AD joined, check the box “Setup Domain Join” and click on the “Create Template” button.

In the next window, you will be asked to join the domain via the “Domain Join” pop-up. Both the template and any desktops built from it will use these parameters to join the domain. Domain administrator credentials are stored in the VM’s secure wallet. Enter the appropriate domain name, OU string, and the credentials of a domain administrator’s account.

This will now initiate the provisioning of the template machine. When provisioning is complete, its status will change to Draft.
Log in and Configure the Template VM
Sign into the draft-mode template via a Utility Server (jump server) on your GCP network.
From there, connect to the newly provisioned Template machine via Remote Desktop using its private IP. Or you can access the template VM directly through IdP.
Make the necessary configurations, such as installing any specific software, changing settings, and so on.
Verify the Google Guest Environment is Present
If the image was imported without the
--no-guest-environmentflag, the Google Guest Environment should already be installed.To confirm if you have the above:
Connect to the machine using local admin credentials.
Launch PowerShell in Admin mode .
Type the following command:
googet installed

If this succeeds, skip down to Configure the Google Guest Environment.
If you see an error that PowerShell is unable to identify the GooGet command, then probably the guest environment is not installed. In this case, you should first install the Guest Environment, as shown below.

Install the Google Guest Environment
This step is unnecessary if you verified the presence of the environment. Skip to Configure the Google Guest Environment.
Paste the commands below into an elevated PowerShell console:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-WebRequest https://github.com/google/googet/releases/download/v2.13.0/googet.exe -OutFile $env:temp\googet.exe & "$env:temp\googet.exe" -root C:\ProgramData\GooGet -noconfirm install -sources https://packages.cloud.google.com/yuck/repos/google-compute-engine-stable googet
Remove-Item "$env:temp\googet.exe" On installation, GooGet adds content to the system environment, so launch a new admin-level PowerShell console after installation.
Configure the Google Guest Environment
Launch a new admin-level PowerShell console if you just installed GooGet
Add the google-compute-engine-stable repo:
googet addrepo google-compute-engine-stable
Install the core packages google-compute-engine-windows, google-compute-engine-metadata-scripts, google-compute-engine-sysprep, and google-compute-engine-vss:
googet -noconfirm install google-compute-engine-windows google-compute-engine-sysprep google-compute-engine-metadata-scripts google-compute-engine-Powershell google-compute-engine-vss
Install the network drivers for the NIC, the NetKVM drivers, and optionally the GGA display drivers if you enabled “Use Display Adapter” on the VM Edit page on GCloud Console:
googet -noconfirm install google-compute-engine-driver-netkvm google-compute-engine-driver-vioscsi google-compute-engine-driver-pvpanic google-osconfig-agent google-compute-engine-driver-balloon google-compute-engine-driver-gga
Finally, configure GooGet to auto-update:
googet -noconfirm install google-compute-engine-auto-updater
“Googet list” should now have output like:

See also the GCP article: Install the Guest Environment.
Publish the Template
In Control
When the template is ready to be published, change the state of the template on Control to “Published.” This action will shut down the template machine.
In GCP
Add DNS Server IPs to Project Metadata:
Goto > Compute Engine > Settings > Metadata
Add the Key “domain-controller-addresses”, edit the Value, and provide your corporate DNS server IPs separated by a comma (,). These must be reachable from your Workspot GCP subnets.
The IPs will be added as a DNS server on the OS level whenever the Cloud Desktop boots.

After clicking the Save button, the changes should reflect as below:

Related Documents
GCP article: Install the Guest Environment.

