Configuring an ECS
Scenario
This section describes how to install application software, configure patch update, and install system patches on an ECS.
Prerequisites
- You have obtained the username and password for logging in to the ECS.
- You have created an ECS.
- You have obtained the files listed in Required Software and decompressed Workspace_HDP_WindowsDesktop_Installer_x.x.x.iso to obtain the folder Workspace_HDP_WindowsDesktop_Installer_x.x.x.
Procedure
The operations vary depending on the OS. Follow the instructions on the GUI.
Installing a Windows OS and the VirtIO driver
- Log in to the console.
- Choose Service List > Computing > Elastic Cloud Server.
- Locate the row that contains the ECS created in Creating an ECS, and click Remote Login to log in to the Windows VM.
- For details, see Installing a Windows OS and VirtIO Drivers.
Activating the Administrator account for the VM
Skip this operation if Windows Server 2016 or Windows Server 2019 is used.
- In the VM, right-click in the lower left corner and choose Run from the shortcut menu.
- In the Run dialog box, enter compmgmt.msc and press Enter.
The Computer Management page is displayed.
- In the navigation pane on the left, choose Computer Management (Local) > System Tools > Local Users and Groups, and select Users.
- In the right pane, right-click Administrator and choose Properties.
The Administrator Properties window is displayed.
- On the General tab page, deselect Account is disabled, and click OK.
The Administrator account is activated, and its default password is empty.
- Right-click Administrator and choose Set Password.
- Set a password for the Administrator account and ensure that the password is not empty. Otherwise, the task fails.
- Password requirements:
- Contains at least one uppercase letter (A–Z), one lowercase letter (a–z), one digit (0–9), and one special character (~!@#$%^&*()-_=+\|{};:'",<.>/? or space).
- Contains 8 to 32 characters.
- Cannot be the same as the recent three passwords.
- Cannot contain the username or the username in reversed order.
- Click Proceed. The Set Password for Administrator dialog box is displayed.
- Set a password for the Administrator account as required, confirm the password, and click OK.
The password has been set.
- Click OK.
- Right-click in the lower left corner and choose Shut down or sign out > Sign out from the shortcut menu to log out of the OS and log in to the ECS again using the Administrator account.
- On the Choose privacy settings for your device window, click Accept.
Manage Your Server page not displayed upon login
- Click Start > Run.
The Run dialog box is displayed.
- Enter gpedit.msc in the Open text box and press Enter.
The Local Group Policy Editor window is displayed.
- In the navigation pane, choose Computer Configuration > Policy > Administrative Templates > System > Server Manager, as shown in Figure 1.
- In the right pane, double-click Do not display Server Manager automatically at logon.
The Do not display Server Manager automatically at logon dialog box is displayed.
- Select Enabled.
- Click OK.
Disabling hybrid sleep
- Click Start > Run.
The Run dialog box is displayed.
- Enter gpedit.msc in the Open text box and press Enter.
The Local Group Policy Editor window is displayed.
- In the navigation pane, choose Computer Configuration > Administrative Templates > System > Power Management > Sleep Settings. Enable Specify the system sleep timeout (plugged in), Turn off hybrid sleep (plugged in), Specify the system sleep timeout (on battery), Turn off hybrid sleep (on battery), Specify the unattended sleep timeout (plugged in), and Specify the unattended sleep timeout (on battery), as shown in Figure 2.
- Double-click Specify the system sleep timeout (plugged in). In the displayed dialog box, select Enabled and set System Sleep Timeout (seconds) to 0.
Figure 3 Specifying the system sleep timeout (plugged in)
- Click OK.
- Double-click Turn off hybrid sleep (plugged in). In the displayed dialog box, select Enabled.
Figure 4 Turning off hybrid sleep (plugged in)
- Click OK.
- Double-click Specify the system sleep timeout (on battery). In the displayed dialog box, select Enabled and set System Sleep Timeout (seconds) to 0.
Figure 5 Specifying the system sleep timeout (on battery)
- Click OK.
- Double-click Turn off hybrid sleep (on battery). In the displayed dialog box, select Enabled.
Figure 6 Turning off hybrid sleep (on battery)
- Click OK.
- Double-click Specify the unattended sleep timeout (plugged in). In the displayed dialog box, select Enabled and set Unattended Sleep Timeout (seconds) to 0.
Figure 7 Specifying the unattended sleep timeout (plugged in)
- Click OK.
- Double-click Specify the unattended sleep timeout (on battery). In the displayed dialog box, select Enabled and set Unattended Sleep Timeout (seconds) to 0.
Figure 8 Specifying the unattended sleep timeout (on battery)
- Click OK.
Enabling the group policy that allows the standard user group to shut down Windows
Perform this operation for Windows Server 2016 and Windows Server 2019.
- In the Local Group Policy Editor navigation pane, choose Computer Configuration > Windows Settings > Security Settings > Local Policies > User Rights Assignment, as shown in Figure 9.
- In the right pane, double-click Shut down the system.
The Shut down the system properties dialog box is displayed.
- Click Add User or Group. The Select Users or Groups dialog box is displayed.
- Click Object Types, select Groups, and click OK.
- In the Enter the object names to select area, enter Users to query and add the Users group to the policy.
- Click OK.
- Click OK.
Disabling the firewall
- In the navigation pane of the Local Group Policy Editor, choose Computer Configuration > Administrative Templates > Network > Network Connections > Windows Firewall > Domain Profile.
The Domain Profile page is displayed, as shown in Figure 10.
- In the right pane, double-click Windows Firewall: Protect all network connections.
The Windows Firewall: Protect all network connections dialog box is displayed.
- Select Disabled.
- Click OK.
- In the navigation pane, choose Standard Profile.
The Standard Profile page is displayed, as shown in Figure 11.
- In the right pane, double-click Windows Firewall: Protect all network connections.
The Windows Firewall: Protect all network connections dialog box is displayed.
- Select Disabled.
- Click OK.
- Close the Local Group Policy Editor window.
- Click Start > Run.
The Run dialog box is displayed.
- Enter services.msc in the Open text box and press Enter.
The Services window is displayed.
- In the right pane, double-click Application Layer Gateway Service.
The Application Layer Gateway Service Properties (Local Computer) page is displayed.
- On the General tab, set Startup Type to Disabled, as shown in Figure 12.
- Click OK.
- Set the Startup Type of Internet Connection Sharing (ICS) and Windows Firewall to Disabled by referring to 34 to 36.
You do not need to configure Windows Defender Firewall for Windows Server 2019.
- Close the Services window.
Disabling Windows update
- Click Start > Run.
The Run dialog box is displayed.
- Enter gpedit.msc in the Open text box and press Enter.
The Local Group Policy Editor window is displayed.
- Choose Computer Configuration > Administrative Templates > Windows Components > Windows Update, and double-click Configure Automatic Updates. The Configure Automatic Updates dialog box is displayed.
- Select Disabled and click OK, as shown in Figure 13.
- In the Local Group Policy Editor window, choose Computer Configuration > Administrative Templates > Windows Components > Windows Update, and double-click Remove access to all Windows Update features. The Remove access to all Windows Update features dialog box is displayed.
- Select Enabled and click OK, as shown in Figure 14.
Creating a temporary local user admin
- After Cloudbase-Init is installed, it will randomize the password of the Administrator account if application software that takes effect only after a restart is installed. To prevent login failure after randomization, create a temporary account and reset the password of Administrator.
- If your login using the default password of Administrator fails after the restart, log in as the admin user and reset the password of Administrator. Then use the Administrator account to log in again.
- On the ECS, click , enter compmgmt.msc, and press Enter.
The Computer Management window is displayed.
- In the navigation pane, choose Local Users and Groups > Users.
- Right-click and choose New User from the shortcut menu.
- In the New User dialog box, enter the username and password, confirm the password, and click Create.
- In the navigation pane, choose Local Users and Groups > Groups.
- Right-click Administrators and choose Add to Group from the shortcut menu.
If you need to add administrators to other groups, select an option as required.
- In the Administrators Properties dialog box, click Add to add the user to the group.
- Click OK and close the Administrators Properties dialog box.
- Close the Server Manager window.
Configuring a private DNS
You can configure a private DNS server address for OBS so that Windows ECSs on Huawei Cloud can directly access OBS through the private network.
- On the ECS, right-click in the lower left corner, enter cmd, and press Enter.
- Run the ipconfig /all command to check whether the DNS server is at the private DNS address in the region where the ECS resides.
Huawei Cloud provides different private DNS server addresses for different regions. For details, see What Are Huawei Cloud Private DNS Server Addresses?
- Change the DNS server address of the VPC subnet.
Locate the VPC where the ECS resides and change the DNS server address of the VPC subnet to the private DNS address. In this manner, ECSs in the VPC can use the private DNS for resolution and thereby you can access OBS on Huawei Cloud intranet. For details, see Modifying a Subnet.
The private DNS server address must be selected based on the region where the ECS is. For details, see What Are Huawei Cloud Private DNS Server Addresses?
Enabling applications to access the microphone of the OS
- Choose Start > Settings. The OS setting page is displayed.
- Click Privacy. The privacy setting page is displayed.
- In the list on the left, click Microphone. The page for setting microphone permissions is displayed.
- Set Microphone access to On.
Obtaining required installation packages
- Upload the packages obtained in Required Software, except the OS ISO file, to the OBS bucket used in Registering a Private Image Using an ISO File.
Set the object permission to public-read.
- Record the link of each package in the OBS bucket.
On OBS Browser+, right-click the package, choose Share from the shortcut menu, and click Copy Link to obtain the download link of the package. You need to download the package within the sharing validity period.
- In the root directory of drive C on the ECS, create a folder, for example, software, for storing the package to be installed.
- Open the browser on the ECS, copy the package link recorded in 62 to the address box, and press Enter to download the package.
- Switch the input mode of the ECS to English.
- Download the required packages in sequence.
- Copy the obtained packages to C:\software.
Installing the 7-Zip
- Go to C:\software to find and decompress the 7-Zip installation package.
Installing the Visual Studio 2017 runtime library
- Go to C:\software to find the vc_redist.x64.exe and vc_redist.x86.exe packages, and double-click to install the Visual Studio 2017 runtime library.
- Restart the ECS.
(Optional) Deleting the Microsoft language package
- Search for Windows PowerShell in the Start menu and click Run as administrator. The Windows PowerShell running page is displayed.
- Run the following command to delete the Microsoft language package:
Get-Appxpackage -allusers *Microsoft.LanguageExperiencePackzh-CN* | remove-appxpackage
- To ensure that users can purchase Workspace desktops, you need to delete the Microsoft language package when creating a Windows 10 image.
- If there are multiple users, you need to log in to the system using each user account to delete the language package.
(Optional) Installing the OS patch
- Go to C:\software where the package is stored and install the OS patch.
OS patches are updated by Microsoft on an irregular basis. Pay attention to Microsoft announcements and update the OS in a timely manner.
(Optional) Installing applications
- Go to C:\software where the package is stored and install the application.
Some security software (antivirus software, safeguards, and firewalls) may conflict with the Microsoft encapsulation tool. As a result, desktop creation may fail, and the blue screen of death (BSOD) or black screen may occur on the created desktop. Therefore, install security software only after desktops are provisioned.
(Optional) Installing peripheral drivers
- Go to C:\software where the package is stored and install the peripheral driver.
Installing the Cloudbase-Init software
- Go to C:\software where the package is stored, open the Cloudbase-Init installation package, and install Cloudbase-Init as prompted.
- On the Configuration options page, configure parameters by referring to Figure 15.
The version number in the figure is for reference only. Use the actual version number.
- After the configuration is complete, deselect the options shown in Figure 16.
- Click Finish.
Configuring Cloudbase-Init
- Edit the configuration file C:\Program Files\Cloudbase Solutions\Cloudbase-Init\conf\cloudbase-init.conf in the Cloudbase-Init installation path.
- Add the netbios_host_name_compatibility=false configuration item to the last line of the configuration file so that the host name of the Windows OS can contain a maximum of 63 characters.
NetBIOS supports up to 15 characters due to the constraint of Windows OS.
- Add the configuration item metadata_services=cloudbaseinit.metadata.services.httpservice.HttpService to enable the agent to access the OpenStack data source.
- Add the following configuration item to disable Cloudbase-Init restart:
plugins=cloudbaseinit.plugins.windows.extendvolumes.ExtendVolumesPlugin,cloudbaseinit.plugins.windows.createuser.CreateUserPlugin,cloudbaseinit.plugins.common.sshpublickeys.SetUserSSHPublicKeysPlugin,cloudbaseinit.plugins.common.setuserpassword.SetUserPasswordPlugin,cloudbaseinit.plugins.common.localscripts.LocalScriptsPlugin,cloudbaseinit.plugins.common.userdata.UserDataPlugin
- Add the netbios_host_name_compatibility=false configuration item to the last line of the configuration file so that the host name of the Windows OS can contain a maximum of 63 characters.
- In C:\Program Files\Cloudbase Solutions\Cloudbase-Init\conf\cloudbase-init-unattend.conf, check whether cloudbaseinit.plugins.common.sethostname.SetHostNamePlugin, exists.
- If yes, delete it and perform subsequent operations.
- If no, perform subsequent operations.
- Add cloudbaseinit.plugins.common.userdata.UserDataPlugin at the end of plugins=. Add a comma (,) in front of the added configuration item.
- If you use a Windows ECS to create an image, change the SAN policy of the ECS to OnlineAll. Otherwise, when you use the image to create ECSs, the disks may be offline.
Windows has three types of SAN policies: OnlineAll, OfflineShared, and OfflineInternal.
Table 1 SAN policies of Windows Type
Description
OnlineAll
All newly found disks are online.
OfflineShared
All newly found disks on sharable buses, such as iSCSI and FC, are left offline by default, while disks on non-sharable buses are online.
OfflineInternal
All newly found disks are left offline.
- Execute cmd.exe and run the following command to query the current SAN policy of the ECS using DiskPart:
diskpart
- Run the following command to view the SAN policy of the ECS:
- If the SAN policy is OnlineAll, run the exit command to exit DiskPart and close cmd.exe.
- If no, go to 80.c.
- Run the following command to change the SAN policy to OnlineAll:
san policy=onlineall
- Run the exit command to exit DiskPart and close cmd.exe.
- Execute cmd.exe and run the following command to query the current SAN policy of the ECS using DiskPart:
Changing the power settings to high performance/ultimate performance
You need to modify the power settings of all Windows desktops.
- Choose Control Panel > System and Security > Power Options, and select High performance for Preferred plans, or Ultimate Performance after showing additional plans.
- Click Change plan settings on the right of High performance or Ultimate Performance. On the page displayed, select Never for Turn off the display:
Installing SysAgent and SysPrep
- Double-click HW.SysAgent.Installer_64.msi and HW.SysPrep.Installer_64.msi in C:\software.
Installing AppCenterAgent and AppCenter
- Double-click WKSAppCenterAgent.msi and WKSAppCenter.msi in C:\software.
Deleting a system recovery partition
This operation is required for Windows 10 or Windows 11 images.
- Right-click Start and choose Disk Management from the shortcut menu. Check whether the system disk (generally drive C) has a recovery partition. Go to the next step only when there is a recovery partition.
- Press Win + R, enter cmd, and enter
diskpart.
The diskpart window is displayed.
- Run the following commands in sequence to delete the system recovery partition:
- Print the disk list and select the system disk.
list disk # The number 0 indicates that the selected disk 0 is the system disk. Select a disk as required. select disk 0
- Print the disk partition list and select the recovery partition to be deleted.
list partition # In this example, 3 indicates the number of the recovery partition. Select a value as required. select partition 3
- Delete the recovery partition.
delete partition override
- Print the disk list and select the system disk.
Enabling hibernation
- Click Start > Run.
The Run dialog box is displayed.
Run the powercfg -h on command to enable hibernation.
Configure this parameter only for Windows Server 2016 and 2019.
Encapsulating the image
- To create an encapsulated image, perform 5 to 8.
- To create an image that is not encapsulated, perform 5 to 7, and 9.
1. If images are not encapsulated, problems may occur on some applications, such as Windows Server Update Services (WSUS).
2. In Windows 8 or Windows Server 2012, you may encounter problems where push notifications do not work.
3. Images that are not encapsulated can be provisioned more quickly.
- On the ECS, find the Windows image creation tool in C:\software and decompress it to obtain the Workspace_HDP_WindowsDesktop_XXX folder.
- Right-click in the lower left corner, enter cmd, and press Enter.
- Run the following command to switch to the directory containing the template tool:
cd C:\software\Workspace_HDP_WindowsDesktop_Installer_x.x.x
- In the displayed CLI, run the following command to encapsulate the image:
run_silent.bat --passive --environment_type 2 --nocheck --noshutdown
During image encapsulation, the ECS automatically restarts. Do not exit or stop the ECS. After the ECS is restarted, enter the ECS password to proceed with image encapsulation.
- (Optional) In the displayed CLI, run the following command to create an image not encapsulated:
run_silent.bat --passive --environment_type 2 --nocheck --noshutdown --nosysprep
Deleting the temporary admin user
- Click Start > Run.
The Run dialog box is displayed.
- Enter sysdm.cpl in the Open text box and press Enter.
The System Properties window is displayed.
- On the Advanced tab, click Settings under User Profiles.
- On the User Profiles page, select the profiles of the user to be deleted and click Delete.
- Click OK.
- Close the System Properties window.
- Click Start > Run.
The Run dialog box is displayed.
- Enter compmgmt.msc in the Open text box and press Enter.
The Computer Management window is displayed.
- In the navigation pane on the left, choose System Tools > Local Users and Groups > Users.
- In the right pane, right-click the username to be deleted and choose Delete.
- Click Yes.
- Click OK.
- Close the Computer Management window.
Stopping the ECS
- On the ECS list page of the console, locate the row that contains the ECS created in Creating an ECS, and choose More > Stop to stop the ECS.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot