Disable the X Windows graphical interface and set Linux endpoints to boot into multi-user text mode
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.
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.
Evaluation phase: The Worklet always triggers remediation (exits with code 1) to check and configure the boot mode settings.
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.
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
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.
Run this Worklet on a pilot Linux endpoint and review evaluation output for disable x windows.
Confirm Automox activity logs show successful completion and exit code 0.
Verify endpoint state using checks aligned to evaluation script logic, such as exit.
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.


By submitting this form you agree to our Master Services Agreement and Privacy Policy.
Already have an account? Log in
Consider Worklets your easy button
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.

AUTOMOX + WORKLETS™
Uncover new possibilities with simple, powerful automation.
By submitting this form you agree to our Master Services Agreement and Privacy Policy