I'm using the Apple slim aluminum keyboard, which doesn't have the SysRq key:
What key(s) should I press for the magic SysRq key when I need to type REISUB?
keyboardreboot
I'm using the Apple slim aluminum keyboard, which doesn't have the SysRq key:
What key(s) should I press for the magic SysRq key when I need to type REISUB?
Best Answer
This answer also posted here.
After 3 or 4 hrs of hard searching, reading, and trial and error, here's a more thorough and generic answer which should work for any Apple/Mac laptop or keyboard, not just the "Apple slim aluminum keyboard." In my particular case, however, I'm using this solution for a 2008 MacBook white running Xubuntu 16.04 LTS.
Many thanks to Bengt Olsson for his excellent instructions here which gave me the necessary start to figure out the missing details.
This solution is done in the user space, and does NOT require recompiling the kernel like some suggestions.
Download source for keyfuzz, and extract it (I can right-click it and go to "Extract Here" to extract it in my GUI file manager, for instance). To read more about keyfuzz, see here. It is released under the GNU GPL 2.0 or later open source license (yaaay open source!).
./configure
command below will fail.Install dependencies, or else running
./configure
below may spit out some errors:Compile and install keyfuzz with the usual commands:
Navigate to
/dev/input/by-id
and find your Apple keyboard that ends in-event-kbd
:For me it's:
Add the following line to your
/etc/rc.local
file, to cause this command to run each time your computer boots up and loads this user. Notice we are using the Apple keyboard entry we just found above. This command uses keyfuzz to map F12 or F13 on your Apple keyboard or laptop to the system "Magic SysRq key", for soft reboots.458821 99
. Many thanks to "pjjjv" for figuring that out here!458856 99
.rc.local
for my case is:/etc/rc.local
file, with the appropriate entry:Reboot.
Now I can press Alt+F12 (or you can use Alt+F13 as described above) and issue REISUB to soft-reboot your computer. Works perfectly on my MacBook 2008 laptop running Xubuntu 16.04 LTS.
Note that you can see the results returned by issuing REISUB as you press each key by first jumping to an alternate session with Ctrl+Alt+F1 (F1 through F6 work actually) before issuing the command. To get back to your main X Window session use Ctrl+Alt+F7.
If you get a result that says
that's normal for several of the commands, as they pose a potential security risk. The Boot one should still work, however, allowing you to soft-reboot your computer. Here is some more information on this, from mniess here: