Remove GUI from Windows Server 2022

GUIs are nice pieces of software. They often help with a lot of daily tasks. For example, they let you visualize what you're doing on the system, surf the internet, and much more, but they don't belong on servers. The reason for this strong claim comes from the fact that sysadmins shouldn’t be using a server as a desktop, and generally speaking, a server can be administered completely via the command line interface (CLI).

A full-fledged desktop environment is also resource-heavy. It can easily require 2 GB of RAM and three gigabytes or more disk space just to exist. Yes, you can install lightweight GUIs, but again, resources are unnecessarily wasted. 

[ You might also enjoy: Balancing Linux security with usability ]

There are other practical issues with a GUI on a server too. To use a GUI, you will probably use SSH X-Server forwarding, which is very slow as SSH encrypts the traffic. There are other ways to manage the server. You can either physically connect to the server (in case of bare metal) or have access to the hypervisor console, which you might or might not be able to, depending on security policies, access, geographic location, and so on.

Who uses a GUI on a server?

Every so often, though, you find that people, especially those coming from different backgrounds, prefer to have a desktop environment installed on their servers as they are not familiar with any shell. However, don't forget that skills can be learned and, after a certain amount of time, those who are administering Linux will find themselves more at home with the GNU/Linux shell.

Of course, visualizing server configurations still helps even the most experienced of us, but RHEL provides Cockpit for that. It is a lightweight browser-based administration tool for Linux.

How do I get rid of the desktop environment?

I have tried many times to eliminate the desktop environment on servers, recommending that administrators use Cockpit. However, it took some time to find a way to cleanly remove GNOME (the default desktop environment on RHEL) without reinstalling the OS.

It turns out that this is possible, but it requires a couple of extra steps.

When you want to learn what is installed on your systems, as usual, DNF comes in handy. Try this command:

$ dnf grouplist

You can see the Installed Environment Groups category. Those groups are there to help manage software collections. Notice the Installed Environment Groups listed below:

Figure 1: The dnf grouplist command displays the Server with GUI group.

As you can see, the Installed Environment Group is Server with GUI. This is the default during a standard installation via the RHEL ISO.

Remove the GUI

You want to install everything you need to replace your GUI-based tooling and then remove the GUI altogether.

As a first step, you need to install the group Minimal install. This will update the dependencies and make sure that the removal of the Server with GUI group won’t break anything.

Afterward, you also need the Server group. This will help enable Cockpit, the admin tool I mentioned earlier.

Use the following steps:

$ dnf groupinstall -y “Minimal Install”
$ dnf groupremove -y “Server with GUI”
$ dnf groupinstall -y “Server”

Finally, you can enable Cockpit with two additional simple steps:

systemctl enable --now cockpit.socket
sudo firewall-cmd --add-service=cockpit --permanent

To learn more about Cockpit and how to use it, take a look at, An introduction to Cockpit, a browser-based administration tool for Linux. 

[ Free online course: Red Hat Enterprise Linux technical overview. ] 

Wrapping up

In this article, you learned how to cleanly remove a default desktop environment from a RHEL 8 server in favor of Cockpit. This allows you to save resources and still comfortably manage the system with a browser-based software component.

Remove GUI from Windows Server 2022

Windows 2022 FAQ

Updated: 21 Aug 2021

Windows 2022 Server Core

1. How do I install Server Core?

You get the option between 'Server with Desktop Experience' or 'Server Core' during the initial stages
of installation. There are two Editions for Standard and Datacenter.

* Standard. No free guest licenses (you need to pay for VMs) and limited roles/features
* Datacenter. Licenced for unlimited guest virtual machines.

More info on Licensing fromWindows Activation.

2. What roles can I run on my Server Core server?

Active Directory Domain Services
Active Directory Lightweight Domain Services
Active Directory Certificate Services
DHCP Server
DNS Server
File Services
BITS Server
Hyper-V
Print Services
Telnet Server
Streaming Media Services
Web Server (IIS)

For Windows 2022, Nano server runs as a container based OS image.

DCB (Data Center Bridging)
DNS Server (Domain Naming Server)
DSC (Desired State Config) push mode
Failover Clustering
File Server
Hyper-V
MPIO
NPDS (Network Perf Diag Service)
Reverse Forwarders (for Ruby, Node.js etc)
SCOM
VMM agent (Virtual Machine Manager)
Web Server (IIS)
Windows Server Installer

NB: This version does not install PowerShell Core, .NET Core or WMI by default.
The servicing stack is no longer included.

See these instructions on installing Nano server using containers.

To install roles you can use the Powershell commands:
a) Get-WindowsFeature - List all Roles and Features
b) Install-WindowsFeatures - Install a Role or Feature
c) Uninstall-WindowsFeatures - Remove a Role or Feature
d) Install-ADDSDomainController - Install and promote server to AD DC.

or use normal Command Prompt:
a) Dism /online /get-features /format:table - List roles and features
b) Dism /online /enable-feature /featurename: - Install a role or feature
e.g. Dism /online /enable-feature /featurename:DHCPServerCore
c) Dism /online /disable-feature /featurename: - Remove a feature or role

3. What commands can I run from the command prompt?

Here are some useful commands to get you sorted:

a) Netdom - Change computer name, add/remove it from a domain.
b) Net Start|Stop - List, start or stop services (see Msinfo32 for service list)
c) IPConfig - View internet protocol configuration
d) Shutdown - Shutdown, restart (/r) or logout (/l) from computer in n time seconds (/t n)
e) Netsh - Change network settings
f) Net Time - Change time settings, set sntp server
g) Net User - Add, remove or change local user accounts
h) Ntdsutil - Active Directory utility.
i) Start /w ocsetup - Install a server role
j) dsadd, dsrm, dsmod - Add, delete or modify domain objects.
k) Taskmgr.exe - Task Manager
l) Notepad - Text Editor
m) Start Cmd - Open a new command window (also try Powershell instead of Cmd).
n) Wmic qfe list - List installed windows updates
o) Wusa /quiet - Install a windows update
p) Net LocalGroup Administrators / - Add a user to local admin group.
q) SCONFIG- Server configuration. Set computer name, local adminstrator, update settings ,remote access,network settings
date and time, log off, restart, shutdown or exit to cmd line.
r) Hostname - Show computer or host name.
s) iscsicpl.exe - iSCSI Initiator tool for connecting to iSCSI disks.
t) Server Manager - Run from a remote machine to configure server incl. NIC Teaming.
u) msinfo32 - Microsoft system information tool
v) dism - Deployment image servicing and mangement tool. Also used to install/remove roles and features.
w) Systeminfo.exe - View system information
x) Control.exe - Load a control panel e.g. intl.cpl or timedate.cpl
y) pnputil –i –a - Install a driver.
z) icacls - Set file or folder permissions
aa) Takeown - Take ownership of files or folders.

4. Powershell commands:

The power shell is not installed by default. So, the commands to install it are:

dism.exe /online /enable-feature /featurename:MicrosoftWindowsPowerShellRoot
dism.exe /online /enable-feature /featurename:MicrosoftWindowsPowerShell

or enable it via SConfig and select option 4) Configure Remote Management and enable the Powershell.

Some useful commands:

a) Get-Service, Stop-Service, Start-Service, Restart-Service - List, stop and start a service. Use '*' to list all services.
b) Set-Date - Change system time
c) Stop-Computer - Shuts down the computer.
d) Add-Computer - Add the computer to a workgroup or domain.
e) Get-Hotfix - List installed updates. See SConfig on installing new updates.
f) Get-ADUser, Get-ADGRoup . View AD users and groups.
g) Get-Acl, Set-Acl, Set-SmbPathAcl. View or set folder permissions or for shares.

5. Remote Administration

To effectively manage server core, you can use the following methods:

a) Use the traditional Remote Desktop Connection (excl. Nano serverrs).
b) Powershell 2 and remote windows administration sessions.
e.g.
New-PSSession - Authenticate a new session with the remote server.
Invoke-Command - Run a command to a remote server
c) Install Server Manager on your PC and remote connect to server to manage server (see Remote Administration in SConfig to allow access),
d) WinRM and use the winrs command to remotely execute commands.
e) Install the Windows Admin Center tool for web based management.

6. Web Access with Server Core

It is possible to access the web using server core using third party tools. If you have a web proxy server, you will need to
set the http_proxy environment variable first:

a) wget - Web Get tool, useful for downloads via the web.
b) Lynx - Lynx is a text based Web browser. Requires Python and NTLMaps for Proxy servers.
c) Firefox - Firefox 2.0.0.14 works with Server core.
d) Opera - Opera 9 web browser.
e) Chrome - Google Chrome will work.
f) Powershell - Use the Invoke-WebRequest cmdlet (similar to wget).

7. ZIP Tools for Server Core

In the full version of Windows 2022 you have the Zip Folders feature provided by the zipfldr.dll library. There are thousands of tools out
there to provide Zip and Unzip functionality.

a) 7-Zip. Includes the 7z.exe for command line access.
b) Powershell 4.5 or later can compress or uncompress files. E.g. Compress-Archive, Expand-Archive.

8. Can I convert a Server Core installation to a Windows GUI installation?

No, you cannot do a in-place upgrade from Server Core to the GUI version of Windows Server. You will need to reinstall Windows Server, and select the
Desktop Experience version to get the GUI.

Remove GUI from Windows Server 2022

9. How do I configure Network Teaming in Windows 2022?

Network teaming is built into Windows 2022. You can configure it remotely using Server Manager, Local Server, NIC Teaming.
If you are logged on to the server you can use Powershell commands to configure NIC Teaming. If Hyper-V is installed you can use the following useful commands:
a) Get-VMSwitch - list network connections
b) Get-VM - view local virtual machines
c) Get-VMNetworkAdapter - load local network adapters.
d) Get-NetAdapter - view VM adapters
e) Get-NetLbfoTeam - view teams.
f) New-NetLbfoTeam - create a new team

10. Is there an even more cut-down version of Windows server?

Yes, it is called Windows Nano server. The difference between Core and Nano, is that Nano has NO interface (graphical or command line) at all and it uses container technology.
It can be used for a "compute" host for Hyper-V virtual machines, a storage host for Scale-Out File Server, DNS server, IIS web server or a host for applications that are developed using
clould application patterns or VM guest machine. In Windows 2022, it is now a container based OS image.

Does Windows Server 2022 have a GUI?

Yes it is. Windows Server 2022 Datacenter (Desktop Experience) – A complete edition with all features and GUI for server management.

Can we convert full GUI server to core server?

Switching from the full GUI to Windows Core Mode is a reversible step. You can always bring the GUI back. There are two ways to remove the GUI and switch to Core Mode: Via the Windows Server GUI using the 'Remove Roles and Features' wizard, or.

Does Windows Server base have GUI?

Instead, Server Core is designed to be managed remotely through the command line, PowerShell, or a GUI tool (like RSAT or Windows Admin Center). ... Feature on Demand - available features in Feature on Demand Package 1809..

What is GUI in Windows Server?

The Windows Server Core concept, which centers on running Windows without a graphical user interface (GUI), has been around since Windows Server 2008, but Windows Server 2012 is the first version of Windows Server to offer the ability to add or remove the GUI without reinstalling the operating system.