How to Force Quit the Hidden ‘WindowServer’ Process to Fix a Frozen Mac Desktop

If you are pushing your Mac to its absolute limits-running massive 3D renders, maintaining 100 open Chrome tabs, and driving multiple 4K external monitors-you might eventually experience a complete desktop freeze. The mouse cursor might still move, but absolutely nothing on the screen clicks. The clock stops ticking, the dock won’t rise, and pressing Cmd+Option+Esc to open the standard Force Quit menu does absolutely nothing.

Most users panic and hold down the physical power button on the back of the Mac to trigger a hard, catastrophic reboot. This is a terrible idea, as it instantly kills the kernel and guarantees data corruption in any unsaved files.

Instead of rebooting the entire computer, you can use a hidden Terminal command (from another machine via SSH) to surgically snipe the specific system process that draws the GUI on your screen: the WindowServer.

What is WindowServer?

WindowServer is the core graphical engine of macOS. It is responsible for drawing every single pixel, shadow, window border, and animation you see on your screen. When your Mac’s GUI completely freezes, it is almost always because the WindowServer process has crashed or entered an infinite loop. The underlying operating system (the Unix kernel) is actually running perfectly fine underneath the frozen picture.

The Fix: Restart the Graphical Engine

If the UI is frozen, you obviously cannot click the Terminal icon. You must SSH into your frozen Mac from another device (like your iPhone, an iPad, or a second laptop on the same Wi-Fi network).

  1. Open a Terminal app on your second device (like the “Termius” app on an iPhone).
  2. Connect to your frozen Mac by typing:
    ssh username@your_macs_IP_address
    (e.g., ssh [email protected])
  3. Enter your Mac’s administrator password. You are now communicating directly with the Unix heart of your frozen machine.
  4. Execute this specific kill command:
    sudo killall -9 WindowServer
  5. Press Enter and type your password again if prompted.

What Happens Next

The exact millisecond you execute that command, your frozen Mac’s screen will instantly flash black. The Apple logo will appear for about 3 seconds, and then you will be immediately dropped at the macOS login screen.

This is not a reboot. You just forcefully killed the broken graphical engine, and macOS instantly spawned a brand new, healthy WindowServer process to replace it.

While you will lose any unsaved data in the GUI applications that were running (because you killed the window manager they were attached to), the underlying Unix system, background file transfers, and the filesystem structure itself remain completely unharmed, allowing you to gracefully log back in and resume working without a terrifying hard reset.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.