Creating Linux VMs on Azure and GCP

This article is part of Using the Linux Agent.

2.0 Creating Linux VMs on Azure and GCP

We will cover Linux VM creation first for Azure, then for GCP. These VMs will be used to create templates visible in Workspot Control.

In general, choose the same VM parameters (RAM, vCPUs, etc.) as you expect to use for the desktops built from the template.

2.1 Azure VM Creation

2.1.1 Create an Azure Linux VM

Step 1. Sign into the Azure console for the customer’s Workspot deployment.

Step 2. Choose a Linux image based on the customer’s requirements. At this writing, we support Ubuntu 20.04, Debian 10, Redhat 7.9, CentOS 7.9, and CentOS 9.4.

Step 3. For the Administrator account, choose either SSH or Password. The SSH option requires extra steps.

Step 3a. SSH public key option. SSH public keys allow you to sign in without a password. Enter a local username to use as the default login account, or accept the default name.

Step 3b. Password. Enter the local username of your choice, such as localadmin. Enter (and confirm) the password of your choice.

Step 4. In the Disks tab, Choose “HDD” and deselect “Use managed disks.”

Step 5. In the Networking tab, the customer’s Workspot network and subnets are selectable.

Step 5a. Choose the desired Virtual Network and subnet,

Step 5b. Select “None” as the Public IP. For security, communication is via RD gateways (or, more rarely, a jump server on the same network).

Step 5c.

Step 6. Go to the “Tags” tab. In the Tag tab, create a tag named “WorkspotTemplate” with a value of 1. This identifies the VM as a template to Control.

Step 7. In the “Review+create” tab, click “Create VM.”

Step 8. If you chose the SSH public key option, you will see a pop-up to download the .pem certificate, which is the SSH private-key file.

Step 8a. Download this file. You need it to sign in to the VM.

Step 9. Once the VM is created, you will get a confirmation.

Step 10. Go to “Resource > Search for created VM.” Find the VM you just created and copy its Private IP. You need this to sign in.

Step 11. Go to Configuring the Template VM (Section 3.)

2.2 GCP Template Creation

GCP template creation is similar to Azure, but it handles SSH public keys differently and requires extra steps at the end to turn your VM into a template.

2.2.1 Create the VM

The following steps are done on the GCP console.

Step 1. On the “VM instance” page, Click “Create Instance.”

Step 2. Enter a name for your VM

Step 3. Choose the desired region/zone.

Step 4. Choose “Machine configuration” parameters that match what you expect to use for your desktop VMs, except for disk size, which can remain at the (small) default size. GCP will auto-expand the partition to fill the target VM’s disk.

Step 5. Choose “Boot disk” parameters according to customer requirements. At the time of this writing, we support Ubuntu 20.04 LTS, Debian 10 Buster, CentOS/RedHat 7.9, and CentOS/RedHat 9.4. Disk size can be left at 10 GB or increased to your actual target size, at your option.

Step 6. Choose “Network interfaces” settings as appropriate.

Step 6a. The customer’s Workspot networks and subnets are available in the pull-down menus.

Step 6b. Do not add an external IP. For security, communication is via RD gateways (or, more rarely, a jump server on the same network).

Step 7. Click “Create” to create the VM.

2.2.2 Generate SSH Keys for the VM

In GCP, we generate our own SSH keys.  

Step 8. Go to any convenient Windows device, preferably the Workspot desktop you’ll use as a jump server later.

Step 8a. Install PuTTY if it isn’t installed already. (Use the steps in Using a Jump Server.)

Step 9. Generate SSH private keys for the VM using PuTTYgen (included with PuTTY).

Step 9a. Launch PuTTYgen.

Step 9b. Click on Generate button (the default of RSA/2048 bits is correct).

Step 9c. Rename the key comment to match the username for signing into the VM. This username is the one assigned automatically by GCP when creating the VM.

Step 10. Click “Save private key.”

Step 10a. Say “Yes” to “are you sure you want to save this key without a passphrase?”

Step 10b. Select a file name and save the key. It will be saved in .ppk (PuTTY private key) format.

Step 11. Before leaving PuTTYgen, select and copy the public key from the “Public key for pasting into OpenSSH authorize_keys file” field. We’ll use this in a minute.

2.2.3 Add SSH Keys to the VM

Step 12. Well, that was complicated! Return to the VM instance in the GCP console.

Step 13. There is an EDIT button at the top of the page. Click EDIT, then click “Show and edit.”

 

 

Step 14. Paste the key we just copied into the SSH keys box.

Step 15. Save the changes. We can now log into the VM.

Step 16. Go to Configuring the Template VM (Section 3).