Linux
View all Worklets
LinuxLinux

Disable X Windows

Disable the X Windows graphical interface and set Linux endpoints to boot into multi-user text mode

Worklet Details

What the X Windows Disabler does

This Automox Worklet™ configures Linux endpoints to boot into multi-user text mode (runlevel 3) instead of the graphical X Windows environment (runlevel 5). The Worklet modifies either /etc/inittab or GRUB boot configuration depending on the system type.

For systems using traditional init, the Worklet changes the default runlevel from 5 to 3 in /etc/inittab. For systems using GRUB, it sets GRUB_CMDLINE_LINUX_DEFAULT to text and runs systemctl set-default multi-user.target to configure systemd.

The Worklet includes optional settings to automatically reboot after changes and to uninstall the X Window System packages completely, though these options are disabled by default.

Why disable the graphical interface on servers

Graphical environments introduce unnecessary complexity and potential vulnerabilities on servers that are managed remotely. X Windows and associated desktop components consume system resources and expand the attack surface with additional services and libraries.

CIS Benchmarks recommend disabling X Windows on servers as a security hardening measure. Running in text mode reduces the number of packages that require patching and monitoring. Server workloads rarely require graphical interfaces because administrators typically manage them through SSH or web-based consoles.

Removing the GUI also improves boot times and reduces memory usage, freeing resources for application workloads. This optimization is particularly valuable on virtual machines where resources are shared.

How X Windows disabling works

  1. Evaluation phase: The Worklet always triggers remediation (exits with code 1) to check and configure the boot mode settings.

  2. Remediation phase: The Worklet checks for /etc/inittab or /etc/default/grub. For inittab systems, it changes id:5:initdefault to id:3:initdefault using sed. For GRUB systems, it sets the default target to multi-user.target and updates GRUB_CMDLINE_LINUX_DEFAULT to text. If performReboot is enabled, the system reboots immediately.

X Windows configuration requirements

  • Linux endpoint with either /etc/inittab or GRUB boot loader

  • Root or sudo privileges for boot configuration changes

  • Optional: Set performReboot=1 to automatically reboot after changes

  • Optional: Uncomment the yum remove or apt-get remove lines to uninstall X Windows packages

Expected boot behavior after configuration

After successful remediation and a reboot, the endpoint starts in multi-user text mode without launching the graphical desktop environment. The system presents a text login prompt instead of a graphical login screen.

You can verify the configuration by running systemctl get-default, which returns multi-user.target. Administrators access the system through SSH or the text console. To revert, run systemctl set-default graphical.target and reboot to restore the graphical environment.

How to validate disable x windows changes

  1. Run this Worklet on a pilot Linux endpoint and review evaluation output for disable x windows.

  2. Confirm Automox activity logs show successful completion and exit code 0.

  3. Verify endpoint state using checks aligned to evaluation script logic, such as exit.

  4. Validate remediation effects from script operations such as sed, else, exit, then rerun evaluation for compliance.

For technical validation, compare endpoint state to the Worklet evaluation logic and remediation flow for disable x windows. This supports repeatable system preferences workflows, faster change control review, and auditable compliance evidence.

Useful script references for this Worklet include evaluation operations such as exit and remediation operations such as sed, else, exit. Use these indicators to verify that endpoint changes match intended policy outcomes.

View in app
evalutation image
remediation image

Consider Worklets your easy button

What's a Worklet?

A Worklet is an automation script, written in Bash or PowerShell, designed for seamless execution on endpoints – at scale – within the Automox platform. Worklet automation scripts perform configuration, remediation, and the installation or removal of applications and settings across Windows, macOS, and Linux.

do more with worklets