- 09 Sep 2024
- 4 Minutes to read
- Print
Skillable Virtual Machine Optimization Recommendations
- Updated on 09 Sep 2024
- 4 Minutes to read
- Print
This article will help Lab Developers optimize their Virtual Machines (VMs) by providing the details required to ensure the VMs run efficiently and reliably. The following optimizations are already implemented on templates provided by Skillable as part of the Template Gallery and Lab Solutions offerings.
The optimizations that are applied are dependent on the platform, ESX or Hyper-V, the VM runs on, as well if the VM is running Linux or Windows operating systems.
Platform Optimizations
When constructing virtual machines (VMs), it is crucial to include the necessary software components so that the operating system within the VM recognizes the environment in which it operates. The table below indicates the operating systems and platforms where services are installed by default.
Windows | Linux | |
---|---|---|
Hyper-V | ✅ | ✅*** |
ESX | ⛔ | ✅*** |
Azure* | ✅ | ✅ |
AWS** | ✅ | ✅ |
*Assumes the VM was built using an Azure VM image
**Assumes the VM was built using an AWS EC2 AMI
***Linux installations ought to automatically recognize ESX or Hyper-V and install the appropriate components. If these components are not installed, this may manifest as mouse-related issues. If uncertain, refer to the specific vendor documentation below to verify the installation of the components.
For installing and validating services and tools or using custom images for the different platforms please see the following links:
Microsoft Hyper-V Integration Services
Installing VMware Tools
Azure custom Windows VM Images
Azure custom Linux VM images
AWS custom VM images
Operating System Optimizations
Regardless of the platform on which the VM operates, the following optimizations are recommended. Certain optimizations are only applicable if the operating system provides a graphical user interface.
Windows Optimizations
Set a meaningful computer name. Lab Solutions use the following as examples, server1, desktop1, etc
Disable IE Security for Admins and Users (Windows Servers)
Install MS Edge browser, if not already installed, other browsers can be installed as well
Set Browser home page to blank or a specific site
Clear browser history
Install all current Windows Updates
Install AutoHotKey to configure a watermark
Disable the lock screen
Disable Windows Updates - See below
Clear Windows Updates Cache.
Clear all event logs on local machine
Set passwords not to expire
Set admin password not to expire
Set keyboard to US (ensures best keyboard mapping in multiple languages)
Disable requirement for CTRL + ALT + DEL to sign in
Disable and refuse Domain Password change prompts
Clear PowerShell History
To clear the history Run the following PowerShell command Remove-Item (Get-PSReadlineOption).HistorySavePath
Clear Run History - See below
Disable Network Notifications
Set the following registry key to off using Regedit.exe: HKLM\System\CurrentControlSet\Control\Network\NewNetworkWindowOff
Clear out Network Profiles
Set Network profile to Private
Enable Remote Desktop Access
Remove recent Programs
Ensure appropriate power settings (Highest available performance, disable monitor timeout)
Power Display Settings to Never Shut Off
System Performance Settings (SystemPropertiesAdvanced.exe), Highest Performance available (Adjust for best performance, Check Smooth Edges Screen Fonts)
Optimize Edge (Policies)
Configure Edge settings
System tray clean up (Open the new Windows 'Settings' app and search for "Turn System Icons on or off"). Only leave Network and Clock
Configure firewall for as required. Lab Solution templates have a rule created to allow unrestricted traffic on the 192.168.10.0/24 network for all profiles
Empty the Recycle Bin.
Resize VM (Display settings-change to 1024 x 768).
Optional Optimizations
These optimizations are implemented on the Template Gallery Lab Solutions. However, depending on the use case of custom images some of these updates might not be required.
Module Update PS Help (Get-Help Update)
Hide Recently added apps in Start Menu:
Settings > Personalization > Start > Show Recently Added apps toggle OFF
run gpedit.exe > Computer Configuration > Administrative Templates > Start Menu and Taskbar > Remove "Recently Added" list from start menu ENABLED.
Disable Automatic Windows Updates via Local Group Policy Editor.
Run gpedit.exe
Navigate to Computer Configuration > Administrative Templates > Windows Components > Windows update
Adjusted the following:
Configure Automatic Updates: Disabled
Allow Automatic Updates immediate installation: Disabled
Do not adjust default option to 'Install Updates and Shut Down' in Shut Down Windows dialog box: Enabled
No auto-restart with logged on users for scheduled automatic updates installations: Enabled
Navigate to Computer Configuration > Administrative Templates > Windows Components > Store
Adjusted the following:
Turn off Automatic Download and Install of updates: Enabled
Turn off Automatic Download of updates on Win8 machines: Enabled
Hide Recently added apps in Start Menu
Clear the Windows Update cache
Navigate to the C:\Windows\SoftwareDistribution\Download folder
Remove all the files and folders from within the Download folder
Files in use error
If you get a file(s) or folder in use error. Open services.msc and find the Windows Update service in the list. Right click the service and select Stop. The delete should now work.
Clear the Windows Run history
Run Regedit.exe
Navigate to the path – HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU
Delete all the entries in the right window except for (Default)
Click the Yes button to confirm the value delete
Auto Hotkey setup
Auto Hotkey provides the image on the desktop of Windows VMs when the user signs in. This is displayed because the VM executes a file called C:\Program Files\SkillableInfo\SkillableInfo.exe. This can be removed be deleting SkillableInfo.exe from the folder C:\Users\Administrator\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup or C:\Users\Admin\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup. If you would like to create your own the Auto Hotkey website has full documentation with examples. If you would like an example file used by Skillable please contact Skillable Customer Support
Linux Optimizations
When optimizing Linux, the changes required are not as extensive as the Windows settings however with each new Linux version this list of settings is growing. Also note that not all Linux distributions work the same way, below are the common examples, depending on the distribution being used research might be required to find out how to complete a task.
Disable the lock screen
Passwords are set not to expire
Empty recycle bin
Clear browser history
Set Browser home page to blank or a specific site
Power Display Settings to Never Shut Off
Resize VM (Display settings-change to 1024 x 768)
Set keyboard to US (ensures best keyboard mapping in multiple languages)
Clear command history
Default history files are ~/.history or ~./bash_history
Check using echo $HISTFILE in a bash prompt
History can be cleared using history -c
Disable automatic updates. Different distributions do this differently here are some examples:
Linux Mint - Disable in Startup Applications from Control Panel
Ubuntu Desktop – Disable in Software & Updates from control Panel
Ubuntu command line – Edit /etc/apt/apt.conf.d/20auto-upgrades (set all values to 0)
Centos – Disable and remove the package packageit