How to Create a Server Image to Use When Configuring a New Remote Desktop (Partner)

In this tutorial, you will learn the simple process to create a server image that you can use when setting up a new remote desktop.

 

Setting up a remote desktop from scratch can take time, and it can be quite a tedious process if you are a Partner and have to do this for multiple customers. At Jotelulu, we have developed a function that allows you to create an image of an existing server to speed up the process next time when deploying a remote desktop.

Simplified diagram showing how to create a server image to configure a new remote desktop

Simplified diagram showing how to create a server image to configure a new remote desktop

How to create a server image to use when configuring a new remote desktop​?

 

 

 

Before you begin​:

 

To successfully complete this tutorial, you will need:

  • To be registered as a Partner on the Jotelulu Platform, have signed in using your username and password and have a registered customer for whom you wish to deploy a remote desktop.
  • To have previously deployed a Windows 2019 or 2016 server.
  • To have installed the desired software and/or configured the desired settings on the existing server.
  • IMPORTANT: The following is a list of other technical requirements to ensure that everything functions correctly when creating the server image:
    • Do not remove the local administrator profile: We will automatically use this local account to interact with the server. A new, random password will be generated each time a server is deployed.
    • Cloudbase-init: Do not remove the Cloudbase-init user or the Cloudbase-init software. This is required by the orchestration software to configure and run startup scripts or generate and change the administrator password.
    • DHCP network interface: Jotelulu servers are configured this way by default, and this should not be changed. If a server image is created using a static IP, the new server may not be able to establish a network connection once the server image has been deployed.
    • Do not install the “Remote Desktop Services” role: This role is not required because the software to establish remote desktop connections will be installed when the server is deployed. In Server Manager > Local Server, go to Manage > Remove Roles and Features and untick “Remote Desktop Services” if they are installed:

Before you begin: Ensure that Remote Desktop Services are not installed on the server.

Before you begin: Ensure that Remote Desktop Services are not installed on the server.

    • Do not use ports 80 or 443: Do not install any service that uses TCP ports 80 or 443. These ports will be used by the remote desktop software once the server is deployed. If you need to enable IIS, you should change the default IIS port 80 for your website to another port, such as 8080 or 4443, then publish the desired public port using port forwarding (Server Firewall section). To change the IIS port for your website, go to Internet Information Services Manager, right-click on the website and click “Edit Bindings…”.

Before you begin: Do not use ports 80 or 443

Before you begin: Do not use ports 80 or 443

Step 1. (Server Preparation) Uninstall the Monitoring Agent.

 

Once the Jotelulu server has been deployed, the necessary software has been installed and you have reviewed the important points detailed above, you are now ready to remove the Monitoring Agent from the deployed server.

 

Currently, in order to automate the server deployment process, the Jotelulu platform creates a different type of image depending on the operating system (in this case, Windows 2019 or 2016). For such servers, the Monitoring Agent is installed to provide graphs for different sections of the Jotelulu platform and enable alerts when there is a problem. However, to create a server image, this monitoring agent needs to be removed.

 

 

To do this, you will need to access the server via the remote desktop (RDP) (1).

 

REMEMBER: Open port 3389 on the Jotelulu Firewall (Servers > Firewall)

Step 1. Open the Server tab and access using the command prompt

Step 1. Open the Server tab and access using the command prompt

Once connected to the server, the command prompt will open. Run the following commands (2):
> cd “C:\Program Files\Zabbix\bin\win64\”
> zabbix_agentd.exe –uninstall
> cd “C:\Program Files\”
> rmdir /s Zabbix

Step 1. Run these commands to uninstall the monitoring agent

Step 1. Run these commands to uninstall the monitoring agent

Now that the monitoring agent has been uninstalled, you can proceed to create a server image.
*Note: If you encounter any problems when removing the Zabbix directory, you will need to stop Zabbix in the SERVICES manager.

Step 2. (Server Preparation) Run SYSPREP.

 

Once the monitoring agent has been uninstalled, you will now use Sysprep on the server to create a unique SID. This is to avoid any potential security problems caused by having the same SID on different servers.

 

TIP 1: At this point, we recommend stopping the server and creating a VM Snapshot. This will allow you to restore the server if there is a problem or if you need to make changes to the image after it has been created. For more information about how to do this, see the tutorial entitled ‘How to Create and Restore a VM Snapshot’, which you will find on the Servers subscription page. Bear in mind that Sysprep can only be run eight times on the same system. You can avoid this limit by restoring the server to a snapshot taken before Sysprep was run.

 

To continue running Sysprep, go to the Server tab (Servers subscription page > Servers > Server), and click on the CMD button (3).

 

TIP 2: It is a good idea to have the RDP connection (1) open at the same time to run commands and the commandprompt (3) open to see when the server actually stops.

Step 2. Open the Server tab and open the command prompt

Step 2. Open the Server tab and open the command prompt

Using the RDP, open the command prompt in administrator mode and run the following commands (4):

 

> cd C:\Windows\System32\Sysprep
> sysprep.exe /oobe /generalize /shutdown

 

Step 2. Run Sysprep commands

Step 2. Run Sysprep commands

As soon as the command prompt closes, stop the server using the Stop button on the platform (5).

Step 2. Stop the server from the platform once the command prompt closes

Step 2. Stop the server from the platform once the command prompt closes

Note: To create the server image, it is important for the server to remain stopped after running Sysprep. This is why the server needs to be stopped as soon as the command prompt closes. If you do not stop the server using the button on the platform, it will automatically restart. This is because, when Sysprep finishes, the server will stop and the HA (High Availability) system will interpret this as a “problem”, quickly restarting the server. It is important that this does not happen.

 

If you do not have enough time to stop the server before it automatically restarts, you will need to repeat the Sysprep process. Should this happen, you will need to restore the VM snapshot mentioned in TIP 1 and start again.

 

 

 

 

Step 3. Creating a server image.

 

Once you have completed the Sysprep process and the server has been stopped, you can now create an image of the server.

 

First, open the Servers subscription page on the Jotelulu platform, where you will find the server ready to be copied. At this point, you have twooptions:
  1. Access the server itself through the Servers section (6) (this is the process we will follow in this tutorial).
  2. Open the Images section (7).
The process is the same regardless of which option you choose.

Step 3. Creating a server image from the Servers subscription page

Step 3. Creating a server image from the Servers subscription page

Once you open the Servers section (6), identify the server in the list (remember that it will be stopped) and click on the three dots to the right. Click on Edit (8).

Step 3. Select the server that you want to create an image of.

Step 3. Select the server that you want to create an image of.

On the next page, click on the Convert button (9).

Step 3. Convert your server into an image

Step 3. Convert your server into an image

At this point, the Images section will open, where you will be able to enter a name for the new image (10.1) (in this example, “Partner template 2”). On this page, you will also be able to select the services that the image can be used for. Since we want to use this image to configure a new remote desktop, tick the “Remote Desktop” checkbox (10.2). Then, click Continue (11).

Step 3. Name the image and choose the services for which it can be used

Step 3. Name the image and choose the services for which it can be used

The platform will now run the necessary tasks to create the image. Notifications will appear to confirm whether or not the image has been created successfully (12).

Step 3. Notifications will indicate that the image has been created successfully

Step 3. Notifications will indicate that the image has been created successfully

Once the template has been created with the relevant software and configurations, we can use it in future deployments of the remote desktop service carried out in each of the partner’s clients.

Step 4. Using the image to configure a new remote desktop​.

 

Once the image has been created, you will then be able to use it when configuring future remote desktops.

When subscribing to a new remote desktop service, the final step of the setup wizard will suggest a server configuration.

Step 4. Subscribing to a new remote desktop service.

Step 4. Subscribing to a new remote desktop service.

At this point, simply click on Choose Another Configuration (13).

Step 4. Choose another server configuration in the final step

Step 4. Choose another server configuration in the final step

Next, go to Images My Images (scrolling down a little) and choose the server image that you previously created (14) [In this example, “Partner template 2”].

Step 4. Choose the image created in step 3 and click on Save.

Step 4. Choose the image created in step 3 and click on Save.

Once you click on Save (15), the platform will deploy the new remote desktop service using the chosen server image.

Summary:

At Jotelulu, we understand that many businesses seek to automate their processes and be as efficient as possible. That is why we have added this functionality to make life easier for system administrators. We have no doubt that being able to create a reusable server image will save you a lot of time and effort when setting up new services.
We hope that this tutorial has been useful for you. If you have any questions, please write to us at platform@jotelulu.com and we will be happy to help.

Categorias:Servers