Disable Aqua on bootup for server use

May 01, '02 09:04:20AM

Contributed by: Anonymous

Generally on my UNIX servers, I disable any GUI's so the server has more memory available and no processor time is being spent doing something that is not being used. Here is how to completely disable to GUI upon bootup in OS X and have just a plain UNIX login prompt.

Read the rest of the article for the details...

[Editor's note: You should be quite comfortable with the command line before trying this hint. I have not tested this on my own machines, but the author has assured me that it works as described.]

Disabling Aqua on bootup:

  1. Set the boot-args verbose flag in the open firmware. You do this from a 'terminal' window with the command:
     % nvram boot-args="-v"
  2. You have to modify the startup script to not kick off the "WindowServer". Here are the commands to do that:
     % sudo su -  [NOTE: become root; enter password at prompt]
    % cd /etc
    % cp /etc/rc /etc/rc.orig [NOTE: backs up existing script]
    The following lines need to be commented out of the rc script:
    if [ -z "${VerboseFlag}" ] &&
    [ -x /System/Library/CoreServices/WindowServer ]; then
    ConsoleMessage "Starting Window Server"
    /System/Library/CoreServices/WindowServer ${SafeBoot}
    fi
    In OS X 10.1.4, these are lines 155 through 159. Verify that they are lines 155 through 159 on your system:
     % head -159 /etc/rc | tail -5
    If the lines match what I pasted above, then you're good to go with the next sed command:
     % sed -e 155,159s/^/#/ /etc/rc > /etc/rc.new && cat /etc/rc.new > /etc/rc
    The above command will comment out lines 155 - 159 and put it into a file called rc.new, then put the contents of rc.new into the rc file then delete the rc.new file. The reason for doing the 'cat' into the orig file is to make SURE you don't change ownership or file permissions .. it's a little fussy, but it's better safe then sorry.

  3. Last step, modify the /etc/ttys file to change the console TTY to kick off the regular login prompt instead of the GUI login window:
     % cp /etc/ttys /etc/ttys.orig  [NOTE: backs up existing ttys file]
    Comment out line 9 and uncomment line 8. The two lines look like this in my orig file:
    #console        "/usr/libexec/getty std.9600"   vt100   on secure
    console "/System/Library/CoreServices/loginwindow.app/loginwindow" vt100 on secure
    window=/System/Library/CoreServices/WindowServer
    onoption="/usr/libexec/getty std.9600"
    NOTE: This snippet is only two lines; the second line is shown wrapped on three lines due to its excessive length. Again verify the line numbers look like above:
     % head -9 /etc/ttys | tail -2
    If it looks like above then go ahead with this sed command:
     % sed -e 8s/^#// -e 9s/^/#/ /etc/ttys > /etc/ttys.new && cat /etc/ttys.new > /etc/ttys
All done! Reboot and you're good to go:
 % shutdown -r now
To put the GUI back, here are the commands:
 % nvram boot-args=""
% cat /etc/rc.orig > /etc/rc
% cat /etc/ttys.orig > /etc/ttys
% shutdown -r now

Comments (17)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20020501090420147