SEARCH

How-To Geek

How to Turn the GUI Off and On in Windows Server 2012

image

When Server Core originally shipped, a lot of Windows admins avoided it because you could only use the command line, but this changes with Windows Server 2012 which enabled the use of a hybrid mode.

Turning the GUI Off

In Windows Server 8 the GUI has kept with the modular nature of recent Windows Server Operating Systems and in turn has become a “Feature”. This makes removing the GUI very easy. To get started launch Server Manager.

image

Click on Manage, and then select Remove Roles or Features from the menu.

image

Click next to skip past the before you begin page, then select your server from the server pool and click next.

image

Since the GUI is not a Role, we can just click next again to skip past the Roles section.

image

When you reach the Features page, you need to uncheck the box next to the “User Interfaces and Infrastructure” option, and then click next.

image

Now tick the “Restart Destination Server” box, then click remove.

image

The GUI will now be removed.

image

After the binaries are removed your server will automatically reboot.

image

Once it comes back up, and you log in, you will only be able to use the command line.

image

Turning the GUI On

Once the GUI has been turned off, you will want to know how to get it back. To do this we use SConfig, so go ahead and type SConfig into the command line and hit enter.

image

You can see near the bottom of the screen that we can use “12” to Restore the GUI, so type 12 and hit enter.

image

You will be warned that enabling the GUI requires a reboot, click the yes button.

image

That will kick off DISM which will start to add the binaries for the GUI Shell.

image

When its finished you will be asked if you would like to restart the computer now, type “y” and hit enter to reboot.

GUI Off with PowerShell

You can do the same thing as we did in the GUI much quicker with a PowerShell cmdlet. To do so, open Server Manager, click on Tools and launch PowerShell.

image

We can use the Remove-WindowsFeature cmdlet to remove the feature:

Remove-WindowsFeature Server-Gui-Shell, Server-Gui-Mgmt-Infra

Since Remove-WindowsFeature is just an alias, you could also use:

Uninstall-WindowsFeature Server-Gui-Shell, Server-Gui-Mgmt-Infra

image

Not long after you have  hit the enter key, the removal will begin.

image

When it’s done, you will be notified that you need to restart your server to complete the process, which can be easily done from the current PowerShell window by running:

Shutdown –r -t 0

image

When your machine restarts you will only have the command line to work with .

image

GUI On with PowerShell

The first thing we need to do is get into PowerShell, so type PowerShell and hit enter.

image

Now we need to use the Add-WindowsFeature to add the components  back:

Add-WindowsFeature Server-Gui-Shell, Server-Gui-Mgmt-Infra

Again this is just an alias for:

Install-WindowsFeature Server-Gui-Shell, Server-Gui-Mgmt-Infra

image

When its done, we will need to restart our server by using the Shutdown command:

Shutdown –r -t 0

image

When your server reboots you will have the GUI back.

Taylor Gibb is a Microsoft MVP and all round geek, he loves everything from Windows 8 to Windows Server 2012 and even C# and PowerShell. You can also follow him on Google+

  • Published 06/6/12

Comments (4)

  1. SatoMew

    Also, as seen here, the Classic shell has been completely removed, so that’s why a revised Aero Basic-like theme is used instead of it when the GUI is turned off, since Aero in Windows 8 is now software-accelerated.

    And inb4 “Aero is removed from Windows 8″ comments, what Microsoft has announced is about the theme, not the whole technology behind it, so Aero is here to stay.

  2. Diminuendo

    Interesting, but being able to toggle it on and off without a reboot would be handy. Off to minimize resource use, flip it on, do some work, flip it off again. Some servers just can’t be rebooted, and I hate working in Core if I don’t have to.

  3. Taylor Gibb

    I don’t think they intend on it being used like that though, I imagine it more like, install with a GUI and do config, once you’ve set up your servers, switch them to command line only mode :)

  4. nova1

    great article… just as my attention was being turned to server 2012

Enter Your Email Here to Get Access for Free:

Go check your email!