8

Like with old-days-UNIX when you can just send a command to init and you're staring at black text screen with shell for your own use. ;)

  • After many hours of testing using various versions of OS X/macOS from 10.11.6 thru 10.14.2, with and without SIP enabled, different physical and virtual machines, not one time out of several dozens of times did sudo launchctl reboot userspace -s preform a successful and usable userspace reboot! Simply put, regardless of the source of the documentation, the aforementioned command did not and does not work and therefore regardless of the fact the answer to this question was accepted nevertheless, I did not find it to work and is the reason for my downvote. – user3439894 Jan 10 at 23:58
  • my answer stated exactly “tested on El Captian”, where it works. The answer is heavily edited now, but this still can be found in its revision history. Simply put I didn’t say it would work on anything else – poige Jan 11 at 2:35
  • 1
    I tested under El Capitan as well as Sierra, High Sierra and Mojave. In no instance did sudo launchctl reboot userspace -s preform a successful and usable userspace reboot from Terminal while in the GUI! Please respect that not only did I take considerable time, energy and effort, I also expressed a valid reason for my downvote, which of course I'm under no obligation to do so. The fact that on three different Apple systems, a MacBook Pro, iMac and MacBook Air, running El Capitan and later, it did not work for me as advertised here or in the documentation! AFAIC For me, end of story. – user3439894 Jan 11 at 3:26
  • Worked for me. Here: 15.6.0 x86_64 root:xnu-3248.73.11~1/RELEASE_X86_64 x86_64. What respect are you talking about? :) Or if you talk about respect where's your respect to my words? :) – poige Jan 11 at 3:48
  • Edited answer. Thinking about video recording and uploading it on youtube. ;) – poige Jan 11 at 4:08
5

Depending on your needs, try changing the log in window to ask for a user name and then enter >console as the user.

This likely was removed at 10.10 so you’d need to boot to recovery or ssh in or use a terminal app if this legacy init type bypass isn’t what you seek.

Also, this isn’t true root single user mode, that needs to happen early in the boot process on modern macOS.

  • It seems I've found real answer to my question. Will check and reply – poige Jan 6 at 19:16
  • @poige I certainly can’t get it to work on Mojave (but I didn’t mess with defaults write.) Feel free to edit my answer to make it exactly what you want or self answer if a cleaner answer is best once you test. – bmike Jan 6 at 19:18
  • > There’s no documented way to transition from a booted OS to single user mode without a reboot. that's false claim. – poige Jan 8 at 9:21
  • Hi @poige maybe there is confusion what single user mode is. One person upvoted your answer and 5 down. Feel free to make a new answer if you have something else to add? That Wikipedia mentions that single user mode on macOS only happens Pre-boot so I’m open to you having a different meaning than I on what you consider single user. Let me know if I can help – bmike Jan 8 at 23:07
3

Theory

In a nutshell, there's a documented in man launchctl way to accomplish such a switch into Single Mode w/o kernel reboot. It can be deployed, for e. g., from Terminal window with a SHELL-command:

sudo launchctl reboot userspace -s

Practice

El Capitan

I tested it in El Capitan on a Macbook Air 2015 where it worked. But I also have report from a user that his attempts on El Capitan were unsuccessful though. The only difference I can think of is Retina which requires different graphics mode or somesuch. I don't have Macbook with Retina running El Capitan, so for the time being I can't tell anything more in support of such a version.

High Sierra, Mojave

My tries with High Sierra were showing that this functionality is no longer working (compared to El Capitan). Again, may be it's due Retina, it's not clear. Mojave doesn't have it working also.


Thorough explanation by a contributor¹

There is a way to get back down to single user mode from an up und running macOS without doing a full reboot by running

sudo launchctl reboot userspace -s

This will relaunch just the userspace part of macOS without restarting the Darwin kernel and is equivalent to changing the runlevel on old-day-UNIXes.

For additional details see man launchctl:

reboot [system|userspace|halt|logout|apps|reroot ]
    Instructs launchd to begin tearing down userspace. With no argu-
    ment given or with the system argument given, launchd will make
    the reboot(2) system call when userspace has been completely
    torn down. With the halt argument given, launchd will make the
    reboot(2) system call when userspace has been completely torn
    down and pass the RB_HALT flag, halting the system and not ini-
    tiating a reboot.

    With the userspace argument given, launchd will re-exec itself
    when userspace has been torn down and bring userspace back up.
    This is useful for rebooting the system quickly under conditions
    where kernel data structures or hardware do not need to be re-
    initialized.

    -s       When rebooting the machine (either a full reboot or
             userspace reboot), brings the subsequent boot session
             up in single-user mode.

This means that on a technical level sudo launchctl reboot userspace -s doesn't call reboot(2) and therefore provides a way to switch to single user mode without a reboot.

Also the Wikipedia article on Single user mode says:

In OS X El Capitan and later releases of macOS, the mode can be reversed to single user mode with the command sudo launchctl reboot userspace -s in Terminal, and the system can be fully rebooted in single-user mode with the command sudo launchctl reboot system -s.


1 — Courtesy of @nohillside

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .