Fitting Windows Server on a low-powered VPS with Windows Server Core

Fitting Windows Server on a low-powered VPS with Windows Server Core
Due to the resource-hungry nature of Windows systems, lightweight Linux distributions like Mint, Colibri OS, Debian, or Ubuntu dominate the VPS environment. As they say, it's all about the console, no frills! And this is not an exaggeration: Debian can boot on 256 MB of RAM and a single CPU core at 1 GHz, meaning it can run on almost any old hardware. For comfortable operation, you'll need at least 512 MB and a slightly faster processor. But what if we told you that a similar setup could work on a Windows VPS? That you don't need to install the heavy Windows Server, which requires at least three to four gigabytes of RAM and a couple of cores at 1.4 GHz? Just use Windows Server Core — eliminate the GUI and some services. This is what we'll discuss in the article.

Who is this Windows Server Core?

There is a lack of clear information on what Windows (Server) Core is, even on Microsoft's official site; in fact, it's so convoluted that it's hard to understand at first glance. However, the first mentions date back to the era of Windows Server 2008. Essentially, Windows Core is a functional core of Windows Server (surprise!), 'slimmed down' by the size of its own GUI and roughly half of its ancillary services.

The main feature of Windows Core is its low hardware requirements and complete console management via PowerShell.

If you check Microsoft's website for the technical requirements, you'll find that to start Windows Server 2016/2019, you need at least 2 GB of RAM and a minimum of one CPU core at 1.4 GHz. But we all understand that with such a configuration, we can only expect the system to start, but certainly not for a comfortable operating experience. For this reason, Windows Server typically requires more memory and at least 2 cores/4 threads from the processor, if not a dedicated expensive physical machine on a Xeon, instead of a cheap virtual machine.

At the same time, the core of the server system requires only 512 MB of memory, and the CPU resources that were consumed by the GUI just to render on the screen and maintain its numerous services can be allocated to something more useful.

Here's a comparison of the out-of-the-box services supported by Windows Core and a full Windows Server from Microsoft's official site:

application
server core
server withdesktop experience

Command prompt
available
available

Windows PowerShell/ Microsoft .NET
available
available

Perfmon.exe
not available
available

Windbg (GUI)
supported
available

Resmon.exe
not available
available

Regedit
available
available

Fsutil.exe
available
available

Disksnapshot.exe
not available
available

Diskpart.exe
available
available

Diskmgmt.msc
not available
available

Devmgmt.msc
not available
available

Server Manager
not available
available

Mmc.exe
not available
available

Eventvwr
not available
available

Wevtutil (Event queries)
available
available

Services.msc
not available
available

Control Panel
not available
available

Windows Update (GUI)
not available
available

Windows Explorer
not available
available

Taskbar
not available
available

Taskbar notifications
not available
available

Taskmgr
available
available

Internet Explorer or Edge
not available
available

Built-in help system
not available
available

Windows 10 Shell
not available
available

Windows Media Player
not available
available

PowerShell
available
available

PowerShell ISE
not available
available

PowerShell IME
available
available

Mstsc.exe
not available
available

Remote Desktop Services
available
available

Hyper-V Manager
not available
available

As can be seen, a lot has been cut from Windows Core. Services and processes related to the system's GUI, as well as unnecessary 'clutter' that will definitely not be needed on our console virtual machine, such as Windows Media Player, have been removed.

Almost like Linux, but not quite

Windows Server Core is tempting to compare with Linux distributions, but it’s not entirely correct. Yes, these systems are similar in terms of reduced resource consumption due to the absence of a GUI and many ancillary services, but in terms of operation and some approaches to assembly, it’s still Windows, not a Unix system.

The simplest example is that with a manual assembly of the Linux kernel and subsequent installation of packages and services, even the lightest Linux distribution can be transformed into something heavyweight and resembling a Swiss army knife (here I’m tempted to make a humorous comment about Python and insert a picture from the 'If Programming Languages Were Weapons' series, but we won’t). In Windows Core, there's much less freedom, as we are still dealing with a Microsoft product.

Windows Server Core comes as a pre-built assembly, the default configuration of which can be assessed according to the table above. If you need anything from the unsupported list, you'll have to add the missing elements online via the console. However, remember about Feature on Demand and the ability to download components as CAB files, which can then be added to the build before installation. But this scenario doesn't work if you discover during operation that you're missing any of the cut services.

What distinguishes the Core version from the full one is the ability to update the system and add services without stopping operations. Windows Core supports hot package deployment without rebooting. Consequently, based on practical observations: a machine running Windows Core needs to be restarted about 6 times less frequently than one running Windows Server, meaning once every six months instead of once a month.

A nice bonus for administrators is that if the system is used as intended — through the console, without RDP — and not turned into a second Windows Server, it becomes extremely secure compared to the full version. This is because most vulnerabilities in Windows Server are related to RDP and user actions taken via RDP that should not be done. It's somewhat similar to the story of Henry Ford and his attitude towards car color: "Any customer can have a car painted any color that he wants so long as it is black". Similarly, with the system: the user can interact with the system in any way, as long as they do it through the console.

Installing and Managing Windows Server 2019 Core

Earlier, we mentioned that Windows Core is essentially Windows Server without the GUI wrapper. This means you can use almost any version of Windows Server as a core version, effectively foregoing the GUI. For the Windows Server 2019 family of products, this applies to 3 out of 4 server builds: the core mode is available for Windows Server 2019 Standard Edition, Windows Server 2019 Datacenter, and Hyper-V Server 2019, meaning that only Windows Server 2019 Essentials is excluded from this list.

Moreover, the installation package for Windows Server Core doesn’t need to be searched for specifically. In the standard installer from Microsoft, the core version is literally offered by default, whereas the version with the GUI must be selected manually:

Fitting Windows Server on a low-powered VPS with Windows Server Core
There are actually more ways to manage the system than just the one mentioned, PowerShell, which is proposed by the manufacturer as default. You can manage a virtual machine on Windows Server Core in at least five different ways:

  • Remote PowerShell;
  • Remote Server Administration Tools (RSAT);
  • Windows Admin Center;
  • Sconfig;
  • Server Manager.

The first three options are of the greatest interest: standard PowerShell, RSAT, and Windows Admin Center. However, it is important to understand that while gaining the advantages of one tool, we also incur its imposed limitations.

We will not elaborate on the capabilities of the console; PowerShell is what it is, with its obvious pros and cons. However, the situation is a bit more complex with RSAT and WAC. 

WAC provides access to crucial system control elements such as registry editing and disk and device management. RSAT, in the first case, only operates in view mode and will not allow any changes, while for managing disks and physical devices, Remote Server Administration Tools require a GUI, which is not applicable in our case. In general, RSAT cannot work with files and, accordingly, updates, or installing/removing programs during registry editing.

▍System Management

 

WAC
RSAT

Component Management
Yes
Yes

Registry Editor
Yes
No

Network Management
Yes
Yes

Event Viewer
Yes
Yes

Shared Folders
Yes
Yes

Disk Management
Yes
Only for servers with GUI

Task Scheduler
Yes
Yes

Device Management
Yes
Only for servers with GUI

File Management
Yes
No

User Management
Yes
Yes

Group Management
Yes
Yes

Certificate Management
Yes
Yes

Updates
Yes
No

Program Uninstallation
Yes
No

System Monitor
Yes
Yes

On the other hand, RSAT gives us full control over roles on the machine, while Windows Admin Center literally can't do anything in this regard. Here's a comparison of RSAT and WAC capabilities for clarity:

▍Role Management

 

WAC
RSAT

Advanced Thread Protection
PREVIEW
No

Windows Defender
PREVIEW
Yes

Containers
PREVIEW
Yes

AD Administrative Center
PREVIEW
Yes

AD Domain and Trusts
No
Yes

AD Sites and Services
No
Yes

DHCP
PREVIEW
Yes

DNS
PREVIEW
Yes

DFS Manager
No
Yes

GPO Manager
No
Yes

IIS Manager
No
Yes

So it’s already evident that abandoning the GUI and PowerShell in favor of other management elements cannot be achieved by using just a single tool: for comprehensive administration across all fronts, we will need at least a combination of RSAT and WAC.

It should also be noted that using WAC will cost 150-180 megabytes of RAM. When connecting, Windows Admin Center creates 3-4 sessions on the server side, which do not terminate even when the tool is disconnected from the virtual machine. Additionally, WAC does not work with older versions of PowerShell, so you will need at least PowerShell 5.0. All of this contradicts our paradigm of strict resource conservation, but comfort comes at a price. In our case — RAM.

Another option for managing Server Core is installing a GUI through third-party means, to avoid dragging the tons of garbage that come with a full build along with the interface.

In this case, we have two options: install the original Explorer on the system or use Explorer++. As an alternative to the latter, any file manager will do: Total Commander, FAR Manager, Double Commander, and so on. The latter is preferable if saving RAM is critical for you. You can add Explorer++ or any other file manager by creating a network folder and launching it via the console or task scheduler.

Installing a full version of Explorer will give us more capabilities when working with software equipped with a UI. For this, we will have to refer to the Server Core App Compatibility Feature on Demand (FOD), which will bring back MMC, Eventvwr, PerfMon, Resmon, Explorer.exe, and even PowerShell ISE into the system. However, this comes at a cost, just like with WAC: we will irreversibly lose about 150-200 megabytes of RAM that will be ruthlessly consumed by explorer.exe and other services, even if there is no active user on the machine.

Fitting Windows Server on a low-powered VPS with Windows Server Core
Fitting Windows Server on a low-powered VPS with Windows Server Core
This is how memory consumption looks on machines with the native Explorer package and without it.

This raises a logical question: why all these dances with PowerShell, FOD, file managers, when any step to the left or right leads to increased memory consumption? Why burden ourselves with a bunch of tools and jump back and forth just to ensure comfortable work on Windows Server Core when we could simply install Windows Server 2016/2019 and live like a normal person?

There are several reasons to use Server Core. The first: it has nearly half the memory consumption. If you remember, this condition was the basis of our article from the very beginning. For comparison, here’s the memory consumption of Windows Server 2019; compare it with the screenshots above:

Fitting Windows Server on a low-powered VPS with Windows Server Core
And here it is, 1146 MB of memory consumption instead of 655 MB on Core. 

If we assume that you will not need WAC and will be using Explorer++ instead of the original Explorer, then you will still save nearly half a gigabyte on each virtual machine running Windows Server. If there is only one virtual machine, the gain is insignificant, but what if there are five? In that case, having a GUI matters, especially if you don't need it. 

Secondly, any tweaks around Windows Server Core won't resolve the main issue with Windows Server's operation — RDP and its security (or rather, the complete lack thereof). Windows Core, even with the add-ons like FOD, RSAT, and WAC, is still a server without RDP, meaning it remains unaffected by 95% of existing attacks.

In summary

Overall, Windows Core is just slightly 'bulkier' than any stock Linux distribution but offers far more functionality. If you need resource liberation and are willing to work with the console, WAC, and RSAT, using file managers instead of a full GUI — then Core is worth considering. Moreover, with it, you won’t have to pay for a full version of Windows, allowing you to invest the saved money into upgrades, VPS, such as adding RAM. For convenience, we have included Windows Server Core in our marketplace.

Fitting Windows Server on a low-powered VPS with Windows Server Core

Source: habr.com

Buy reliable website hosting with DDoS protection, VPS VDS servers 🔥 Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster