Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Disable Aqua on bootup for server use System
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
    •    
  • Currently 2.33 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (3 votes cast)
 
[20,703 views]  

Disable Aqua on bootup for server use | 17 comments | Create New Account
Click here to return to the 'Disable Aqua on bootup for server use' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Why not just comment out the offending lines
Authored by: i_am_pi on May 01, '02 09:39:51AM

In pico, hit Ctl-W Ctl-T Line number enter, then put a # sign or a ": " (colon space, no quotes) at the beginning of the offending lines. Then to undo, just take the comments off.

Pi
For Great Justice|ecitsuJ taerG roF



[ Reply to This | # ]
also
Authored by: i_am_pi on May 01, '02 09:42:18AM

"sudo su -" is a little redundant. Try sudo tcsh or just su - to become root. You'll need to enter your root password for the simple su -.

Pi
For Great Justice|ecitsuJ taerG roF



[ Reply to This | # ]
Re: also
Authored by: sjk on May 01, '02 04:15:47PM
Or sudo -s.


[ Reply to This | # ]
sudo & root
Authored by: pecosbill on May 01, '02 06:24:43PM

To run a shell as root, you can also sudo -s



[ Reply to This | # ]
but it still works ...
Authored by: norby on Nov 14, '02 07:57:23PM

Actually, sudo su - is probably a habit for many people (it is for myself) and can be problematic when I'm on a system I don't actually have sudo on, but have the other user's password. There is always more than one way to do it, as they say. (And no, this does not require your root password - unless you have somehow changed your sudo or su so that UID 0 can't su to root w/o a passwd.)



[ Reply to This | # ]
Darwin
Authored by: playdrums on May 01, '02 12:03:10PM

Why not just download and use Darwin if you prefer your servers not to run the GUI. Not sure what type of server you're running - that could make a difference. I also confess I don't know what all the implications are of running Darwin instead of Mac OS X. Possibly some services aren't there? For some though, I would think installing Darwin would be a better solution than OS X to begin with.



[ Reply to This | # ]
Darwin
Authored by: jambiscuit on May 01, '02 01:30:26PM

Actually, this is a very useful hint for someone like myself. I travel for months at a time and leave my computer up as a server. I had never thought about disabling the window manager, but it's a great idea. Great tip!



[ Reply to This | # ]
Why use OS X in this case?
Authored by: etwoy on May 01, '02 04:30:04PM

OK, there are a few things I don't quite understand about this.

You must be running as an AppleShare server, right? Otherwise you'd just use Darwin, and avoid even more cruft, right? (Or run Linux/BSD on an x86 box, why pay the premium for Apple hardware in this case?)

How are you backing up your HFS+ file system? AFAIK all the backup apps out for OS X, Veritas, Retrospect, all need to use the GUI.... Unless you're just using Amanda or something, but then you mustn't need to keep resource forks, so wtf are you doing running OS X as a server in this case?


Anyway I just don't think this is something people should be running out and doing on their servers.... If you need to do something like this, then you're running the wrong OS or the wrong hardware.

If you don't need to run Mac Manager or use the interface of Server Admin, then you shouldn't be running OS X Server. If you don't need to be an AppleShare server, then run Darwin. If your box is too old to handle the load of the GUI, run Linux/BSD.

of course if you've just got some old crap box at home, and you're not really talking about a server in a working environment.....



[ Reply to This | # ]
the /etc/ttys by itself works
Authored by: tz on May 01, '02 04:44:25PM

I just did the change to console in /etc/ttys, and it came up with a login prompt when I rebooted.



[ Reply to This | # ]
the /etc/ttys by itself works
Authored by: zerologic on May 01, '02 06:51:34PM

Indeed it does. I've been using this trick since public beta. :-D

0



[ Reply to This | # ]
Startup Aqua?
Authored by: gilburns on May 01, '02 07:38:25PM
Is there an command to startup aqua once you set it to command line only? Then once it's started up, can it be shutdown again to get back to command line only?


Also, what would the difference be if you just logged in as user >console at the login screen, and left it at that command line?

[ Reply to This | # ]
Wouldn't it work to just log out?
Authored by: tomem on May 01, '02 09:30:53PM

I sometimes leave my server machine running with no one logged into it. I can log in anytime for maintenance, adjustments, etc. Doesn't this accomplish more or less the same thing?

I need AppleShare access to the machine for things like backing up to it and sharing files that are stored on it. Could I perhaps do that even with no one logged in? Hafta try that...



[ Reply to This | # ]
Easier way....
Authored by: sunwolf on May 01, '02 10:21:51PM

Why not just type >console for username at the login window?

You immediately get a command line login and can go from there.



[ Reply to This | # ]
Easier way....
Authored by: vDog on May 01, '02 10:56:05PM

or Single User mode by restarting with cmd + s...vDog



[ Reply to This | # ]
FreeBSD? OpenBSD?
Authored by: macubergeek on May 02, '02 08:07:06AM

Why no just use OpenBSD on your mac hardware and get virtually uncrackable security to boot?



[ Reply to This | # ]
Java needs Mac OS X
Authored by: JonConradt on May 03, '02 10:50:03AM

Sure you can run Darwin, or Linux, or BSD on the same hardware and get the command line from the beginning, but if you want Apple's release of Java you are going to need Mac OS X. I would love to see Apple port their release of Java to Darwin, but that would probably require releasing Aqua as well.

Jon



[ Reply to This | # ]
Disable Aqua - new and improved for 10.2.x!
Authored by: Usr bin Login on May 10, '03 06:44:06AM
While this works perfectly for OS X 10.1.x, it falls flat in Jaguar 'cause /etc/rc has changed drastically.

On the plus side, it's even easier to hack now.

As root, jump to the end of /etc/rc. You should see this line:

SystemStarter -g ${VerboseFlag} ${SafeBoot}

That -g is where the magic is (man SystemStarter for details). Remove the '-g', write, quit and reboot (or kill init if that's your style).

As in the initial hint I also edited /etc/ttys as above. I dunno if it is critical in 10.2 also, but it hasn't hurt anything, and [sheepish] I'm too lazy to test further - hey it works, right? [/sheepish]

For bonus BOfH points, save the originals of /etc/rc and /etc/ttys as /etc/rc.aqua and /etc/ttys.aqua and the edits as /etc/rc.cons and /etc/ttys.cons, then write a shell script to automagically toggle between pure console and gui goodness.

Usr bin Login

---
--------


QA implies some sort of quality to begin with.

[ Reply to This | # ]