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

A simpler method of direct-to-console booting System
After reading this hint, I was going to post a comment on a better way to boot to the console, but thought it would make a better new hint rather than a comment.

By far the easiest way to have OS X boot straight to the console rather than to Aqua is to edit /etc/ttys. Near the beginning, you'll see these two lines (the second line has been split into three for easier reading here):

#console     "/usr/libexec/getty std.9600"     vt100     on secure
console "/System/Library/CoreServices/loginwindow.app/loginwindow"
  vt100 on secure window=/System/Library/CoreServices/
  WindowServer inoption="/usr/libexec/getty std.9600"
To boot into the console, you just need to uncomment (take the # sign) out from in front of the first line and then comment (put the # sign) in front of the second one. Save that file, and you'll boot into the console without editing any other files (you'll need to be root to edit and save the changes).

To have it look more like a tradition *nix login, do the command sudo nvram boot-args="-v"; that will get you the text while the system is loading rather than having the white screen up. Also, I wrote a little shell script to start Aqua up when you boot this way:

#!/bin/sh

/System/Library/CoreServices/loginwindow.app/loginwindow console &
/System/Library/CoreServices/WindowServer console &
I saved that as startAqua in /usr/local/bin. One needs to remember to chmod +x startAqua to be able to execute the shell script.
    •    
  • Currently 2.67 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (3 votes cast)
 
[14,943 views]  

A simpler method of direct-to-console booting | 13 comments | Create New Account
Click here to return to the 'A simpler method of direct-to-console booting' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A simpler method of direct-to-console booting
Authored by: suthercd on Jul 21, '03 11:40:02AM

How about entering >console as the user at login?

Craig



[ Reply to This | # ]
A simpler method of direct-to-console booting
Authored by: chabig on Jul 21, '03 11:57:29AM

>console works as always. But this hint is for "direct-to-console" booting, without starting the graphical user interface.



[ Reply to This | # ]
A simpler method of direct-to-console booting
Authored by: czar on Jul 21, '03 06:01:22PM

This is a truly special hint. Now I can mess w/ people's minds even more, and here I thought setting auto-login to >console was fun. (Course, that stopped working @ some point.)



[ Reply to This | # ]
A simpler method of direct-to-console booting
Authored by: bluehz on Jul 21, '03 07:28:10PM
Thx darkshadow for the instructions. I gathered all the info into a litte script I wrote that allows you to easily switch back and forth between the two modes.

Does anyone know how to kill the gui - e.g drop from Aqua into console mode? I was unable to get it to work in my script.

#!/bin/sh

# Filename: bootchoice
# Version: 1.0
#
# This script can be used to change the startup mode [aqua |
# console]. It will also display the current settings. Prior
# to running this script you will need to duplicate your
# current /etc/ttys file twice and make modifications to one
# of them. This process assumes you have not previously
# altered your /etc/ttys file.
# 
# Setup
# -----
# 1. Save this script into /usr/local/bin and change permissions
#    chmod 750 /usr/bin/bootchoice
# 2. Duplicate the /etc/ttys file twice
#    sudo cp -p /etc/ttys /etc/ttys.aqua
#    sudo cp -p /etc/ttys /etc/ttys.console
#    
# 3. Now modify the /etc/ttys.console file to allow for console booting
#    pico /etc/ttys.console
#    Change line 8 by removing the # at the beginning of the file
#    Change line 9 by adding the # at the beginning of the line
#    Save the file
#
#    /etc/ttys.console should now look like this...
#
#       console        "/usr/libexec/getty std.9600"   vt100   on secure
#       #console "/System/Library/CoreServices/loginwindow.app/Contents/MacOS/loginwin....... 
#
#    You do not need to modify /etc/ttys.aqua
#   
# Usage
# -----
# To boot into Aqua mode:
# 
#    bootchoice aqua
#    
# To boot into Console mode:
# 
#    bootchoice console
#    
# To check current mode:
# 
#    bootchoice current
#    
# To toggle between modes:
# 
#    bootchoice toggle
# 
# To display usage syntax:
#
#    bootchoice

#####################################################

# test current mode
test () {
   test="`diff /etc/ttys /etc/ttys.console`"
}

# reboot function
rebootq () {
   printf "Do you want to reboot now? [y/n]: "
   read fname
   if [ "$fname" = "y" ] || [ "$fname" = "Y" ]; then
      echo "Rebooting the system now..."
      reboot
   else  
      echo "Reboot later."
   fi
} 

case "$1" in

console)
# change to console mode
   test
   if [ "$test" = "" ]; then
      echo "Your system is already in Console mode"
      rebootq
   else
      sudo cp -p /etc/ttys.console /etc/ttys
      sudo nvram boot-args="-v"
      echo "Your System has been modified and will"
      echo "now boot into console only mode"
      rebootq
   fi
;;

aqua)
# change to aqua mode
   test
   if [ "$test" = "" ]; then
      sudo cp -p /etc/ttys.aqua /etc/ttys
      sudo nvram boot-args=""
      echo "Your System has been modified and will"             
      echo "now boot into standard Aqua mode"
      rebootq
   else
      echo "Your system is already in Aqua mode"
      rebootq
   fi
;;

current)
# display current settings
   test
   if [ "$test" = "" ]; then
      echo "Currently set to Console mode."
   else
      echo "Currently set to Aqua mode."
   fi
;;

toggle)
# toggles current mode aqua <> console
# this is experimental - currently only console > aqua works
   test
   if [ "$test" = "" ]; then
   # we are in console, switch to aqua
      /System/Library/CoreServices/loginwindow.app/loginwindow console &
      /System/Library/CoreServices/WindowServer console &
   else
   # we must be in aqua, switch to console
      killall loginwindow && killall WindowServer
   fi
;;

*)

echo "Usage: bootchoice (console | aqua | current | toggle)"
echo "          console       start in console mode"
echo "          aqua          start in aqua mode"
echo "          current       displays current settings"
echo "          toggle        switch from console to aqua"
esac


[ Reply to This | # ]
A simpler method of direct-to-console booting
Authored by: Darkshadow on Jul 22, '03 08:17:17AM
That is some script.

Um...glad you guys liked the hint. I should have posted it sooner...I actually stumbled onto this over a year ago.

[ Reply to This | # ]
A simpler method of direct-to-console booting
Authored by: bluehz on Jul 22, '03 08:54:26AM

I have been unable to get the toggle feature to work at all - so you might just coment that out. The hint you gave about launching Aqua from console doesn't seem to work for me.



[ Reply to This | # ]
Anyone know how to boot directly to X11?
Authored by: alvaromuir on Jul 22, '03 11:01:39AM

I wanted to use X11 instead of aqua / finder.. anyone know how>?



[ Reply to This | # ]
A simpler method of direct-to-console booting
Authored by: darkhalf on Jul 22, '03 04:37:03PM

starta only goes into the deep blue screen with cursor, and never arrives at the login window. bummer.



[ Reply to This | # ]
A simpler method of direct-to-console booting
Authored by: Darkshadow on Jul 22, '03 09:58:01PM

Ah! My error! I'll email Rob about it.

You need to run the startAqua script as root initially for it to work. Not sure why. (sudo will work, too).



[ Reply to This | # ]
A simpler method of direct-to-console booting
Authored by: bluehz on Jul 23, '03 07:29:08AM
startAqua still does not work for me even as root. Couple of other oddities running in console: * Shutdown, does not seem to work. When I issue a shutdown command I get those odd "unreachable port" error msgs that just keeps repeating. Have to hold down the power for several secs - which is not the cleanest method of restarting.

  • I am running console mode on my ibook for some server testing - I can find no way to dim or disable the screen
  • Sleep is out of the question
  • Like everything Apple Terminal related - screen refresh on the console is abysmal... lines chug crawl up the screen (no color). Really sad when you manage to screw up a technology (console terminal) that has been around since the earliest days of computing, and known for its speed and low cpu usage.
If any one knows any solutions to the above - please post!

[ Reply to This | # ]
A simpler method of direct-to-console booting
Authored by: Darkshadow on Jul 23, '03 11:41:10AM
Well, for the startAqua script, you can try taking off the console argument to the loginwindow & WindowServer. When I initially made the script, I didn't have those two lines and it worked for me - it was only later that I noticed those two arguments and edited my script.

The script works fine for me with those two arguments, but it's something to try.

As to the shutdown errors, I haven't seen them - what exactly is the command you're using to try to shut down? Using shutdown -h NOW always works for me.

I also believe the refresh issues with the console is actually dependent on your monitor, for some reason. I get a pretty quick refresh, but I also have a bug no one else I have talked to has - if I let the prompt get to the bottom of the screen, hitting return will either make the console think I hit it 5 times or everyonce in a while, 50 times. Interestingly, if I hit the enter key while this scrolling is going on, it'll stop immediately. I always forget to test if using the enter key exclusively will keep this weird bug from happening...so I'm not sure on that one.

The screen dimming and sleep should happen still - they're not actually tied to the system, but is part of the power management unit. You don't have a way to trigger it, as far as I know, but if you let the computer sit there without typing anything, the screen should still dim after you've been idle for awhile. I can't verify that the sleep works (as I don't actually have my machine ever go to sleep), but I do know the screen will dim. Typing any character will get it to come back awake after that. It may be that the console has a different set idle time than the system (in Aqua) does (I'm not sure of this, as I haven't ever thought to time it), but it will dim eventually.

[ Reply to This | # ]
A simpler method of direct-to-console booting
Authored by: sallred on Sep 17, '04 01:09:18PM

I need a why to boot into console directly, not single user mode nor '>console'.

I have attempted to edit the ‘ttys' file without any success under 10.3.5 client. See example below:

console "/usr/libexec/getty std.9600" vt100 on secure
#console "/System/Library/CoreServices/loginwindow.app/loginwindow"
vt100 on secure window=/System/Library/CoreServices/
WindowServer inoption="/usr/libexec/getty std.9600"

I uncommented out from in front of the first line above and placed comment in front of the second one. Saved the file, and rebooted and now the client machine stalls on "Login Window starting" boot splash screen.

If anyone has some updated information on this would be great, please let me know.
Thank you,
____________________________________________
Steven Allred




[ Reply to This | # ]
A simpler method of direct-to-console booting
Authored by: sallred on Sep 17, '04 01:22:19PM

CORRECTION: My first sentence should read " We need a way to boot into console directly, not single user mode nor '>console'."

Steven Allred



[ Reply to This | # ]