In this article, I will tell you the steps to install Windows 10 on a Google Cloud VPS. You need to prepare:
- Google cloud account has added credit card (Note: if you use free trial $300, you won’t be able to add GPU)
- ISO of Windows 10 installation disc (recommended to use Pro version or like me LTSC Entreprise)
- VirtualBox (to create disk image before uploading to google cloud)
- VirtIO driver: download here
- Fiber network (will need to upload disk image weighing about 10GB, also need low ping if you want to play games)
Table of contents:
Part 1: Prepare hard disk file (vdi)
Create a VM on VirtualBox
Install SCSI and Ethernet drivers
Enable RDP
Part 2: Upload disk image to google cloud
Create bucket and upload
Import the vdi file into the compute engine image
Create instance
Part 3: Install driver on google cloud
Driver PCI
Driver NVIDIA GRID
Part 4 (optional): Install the necessary parts for gaming
Usage cost
Attention
Since many of you have problems with creating vdi files, you can use an existing vdi file made by me and skip Part 1 (this version is based on Windows 10 LTSC):
https://1drv.ms/u/s!AqHhN3byznPZowP37lw7RRzUJklr?e=csSJtcLogin username: xson | password: NuiBlog+
or username: ngxson | password: NuiBlog+You should change the password for both of these users. When logging in, remember to change the keyboard layout to English (QWERTY), otherwise it will use the AZERTY layout (press the ENG/FR button in the bottom corner next to the clock)
Part 1: Prepare hard disk file (vdi)
Create a VM on VirtualBox
Create a new VM on VirtualBox with the following parameters:
- CPU / RAM choose as you like
- Disk: create hard disk file in vdi format, at least 40GB
After creating, click Settings to set a few more parameters:
Network
Adapter 1: Attached to NAT
Adapter 2: Attached to NAT => click on Advance => Adapter type: paravirtualized network
Storage
Check if this controller has type: AHCI or not. Insert the Windows installation disc and the virtio disc.
Create more virtio-scsi controller, create a 1GB hard drive in this controller (this drive is not used for storage, only for Windows 10 to receive VirtIO drivers).
Start the virtual machine, install windows as usual (remember to set a password for your user windows, this is required).
Install SCSI and Ethernet drivers
(I forgot to take pictures in this part, please understand and follow the vegetarian instructions)
After the installation is complete and booting up, copy everything in the virtio CD to the Documents/virtio folder
Go to Devices Manager. You will see SCSI and Ethernet not recognized.
Right click on each => Update driver => Browse my computer for driver => select Documents/virtio folder
Then these 2 drivers will be installed. Any other driver that can’t be installed can be ignored, because here I just need to install virtio.
Enable RDP
Go to Settings > System > Remote Desktop, turn it on
Go to Control Panel > Windows Defender Firewall > Turn Windows Defender Firewall on/off
Then, if you want to test, you can switch VirtualBox’s Network to Bridge or Host-Only, and try RDP into the virtual machine.
Part 2: Upload disk image to google cloud
You need to create a new Project on Google Cloud Console. In this section, you should use free trial credit (if available).
Create bucket and upload
Go to Google Cloud Storage, create a new bucket. You should choose the location in the same location you want to place the VPS. Then, vpload the VirtualBox .vdi file to the newly created bucket.
Import the vdi file into the compute engine image
Go to Compute Engine > Images > Create an image
Name it as you like, at Source select Virtual disk, then select the vdi file in cloud storage
In the Operating system on virtual disk section, select No operating system. Data only
The import process will take about 30 minutes – 1 hour
Create instance
From this step, you can no longer use the $300 free trial of google cloud. Please turn off the free trial to continue.
Go to VM instance > Create
Should choose at least 2 vCPU and 7.5 GB RAM
Select advance > add GPU > Tesla P4 (cheap) or Tesla P100 (more expensive)
Tick the box virtual workstation
Note: Not all regions have GPUs, so try different locations. In addition, the GPU must support virtual workstations (must be ticked in the virtual workstation box below).
Tick the box Turn on display device
In the Boot disk section, select Custom image > Image created in the previous step
At the bottom, there will be a checkbox for Preemptibility > On
Start the instance, you can go to the Screenshot tab to see what the device is showing (if you get a blue screen error or don’t receive the network, please start over and read the instructions carefully)
If the machine boots successfully, you can use Remote Desktop Connecting (RDP) to access the virtual machine remotely using its public IP. Remember to check on the firewall on google cloud that TCP port 3389 is open
After the installation is complete, go to Image and delete the Image you created (remember to go to Storage to delete the bucket too). If you do not delete, you will be charged for storage for the image and the bucket.
Part 3: Install driver on google cloud
(I forgot to take pictures in this part, please understand and follow the vegetarian instructions)
Connect to the instance. Go to Devices Manager. You will see that the PCI is not recognized (the 3D driver belongs to the GPU)
You right-click again => Update driver => Browse my computer for driver => select Documents/virtio folder
For the GPU driver, you need to download the GRID driver at https://cloud.google.com/compute/docs/gpus/install-grid-drivers#grid-driver-windows
* See more: How to take advantage of Google Colab as a free VPS
Part 4 (optional): Install the necessary parts for gaming
Right-click the Start button > PowerShell (Admin)
Enter the command Set-ExecutionPolicy RemoteSigned
Press enter
Next, I installed Parsec to use as remote PC software. Parsec for a better experience than RDP or Teamviewer (much lower latency).
Go to https://github.com/parsec-cloud/Parsec-Cloud-Preparation-Tool
Enter the commands in the Instructions section in turn
At the end there will be something wrong (eg GPU driver updater), you can ignore it, because this driver was installed from the above step
Login / Create account Parsec
Restart the instance again and you’re done!
Usage cost
The fee to run the instance will be calculated according to the time the machine turns on, so when you don’t use it, you need to remember to turn it off. With Preemptibility mode, the device will automatically turn off after 24 hours (so if you forget to turn it off, it won’t cost you much)
The configuration I choose is 4 vCPU + 17.5 GB RAM, Tesla P4 GPU. Price to run is around $0.6/hour. With the Tesla P100 GPU it is a bit higher, at about $0.8 – $0.9 / hour.
In addition to the instance running fee, you will also be charged for hard disk storage. With the 50GB disk I created, it costs about $2.2/month. This disk is kept as long as you delete the instance.