You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Use the Azure Serial Console for SysRq and NMI calls
19
20
20
21
**Applies to:**:heavy_check_mark: Linux Virtual Machines(VMs)
21
22
22
23
## System Request (SysRq)
23
24
24
-
A SysRq is a sequence of keys that's understood by the Linux operating system kernel and that can trigger a set of predefined actions. These commands are often used if virtual machine (VM) troubleshooting or recovery can't be performed through traditional administration. For example, if the VM isn't responding, you can use the SysRq feature of Azure Serial Console to mimic pressing the SysRq key and characters that are entered on a physical keyboard.
25
+
A SysRq is a sequence of keys understood by the Linux operation system kernel, which can trigger a set of pre-defined actions. These commands are often used when virtual machine troubleshooting or recovery can't be performed through traditional administration. For example, if the VM isn't responding. Using the SysRq feature of Azure Serial Console mimics pressing of the SysRq key and characters entered on a physical keyboard.
25
26
26
-
After the SysRq command is delivered, the kernel configuration controls how the system responds. For information about how to enable and disable SysRq, see [Linux Magic System Request Key Hacks](https://aka.ms/linuxsysrq) (SysRq Admin Guide).
27
+
Once the SysRq sequence is delivered, the kernel configuration controls how the system responds. For information on enabling and disabling SysRq, see the *SysRq Admin Guide*[text](https://aka.ms/kernelorgsysreqdoc) | [markdown](https://aka.ms/linuxsysrq).
27
28
28
-
The Azure Serial Console can be used to send a SysRq to an Azure VM by selecting the keyboard icon on the Command bar.
29
+
The Azure Serial Console can be used to send a SysRq to an Azure virtual machine using the keyboard icon in the following command bar.
29
30
30
-
:::image type="content" source="media/serial-console-nmi-sysrq/command-menu.png" alt-text="Screenshot of the Azure Serial Console showing the keyboard icon highlighted and its menu visible. That menu contains a Send SysRq Command item.":::
31
+
:::image type="content" source="media/serial-console-nmi-sysrq/command-menu.png" alt-text="Screenshot of the Azure Serial Console. The keyboard icon is highlighted, and its menu is visible. That menu contains a Send SysRq Command item.":::
31
32
32
-
Select "Send SysRq Command" to open a dialog box that provides common SysRq options or accepts a sequence of SysRq commands. The **Send SysRq** command enables a series of SysRq sequences to perform a high-level operation, such as a safe restart that uses the `REISUB` command.
33
+
Choosing "Send SysRq Command" opens a dialog, which provides common SysRq options or accept a sequence of SysRq commands entered into the dialog. This "Send SysRq Command allows for series of SysRq's to perform a high-level operation such as a safe reboot using: `REISUB`.
33
34
34
-
:::image type="content" source="media/serial-console-nmi-sysrq/sysreq-ui.png" alt-text="Screenshot of the Send SysRq command sent to a Guest dialog box when the entering key option is selected and REISUB is input." border="false":::
35
+
:::image type="content" source="media/serial-console-nmi-sysrq/sysreq-ui.png" alt-text="Screenshot of the Send SysRq Command to Guest dialog box when the entering key option is selected and REISUB is input into the following field." border="false":::
35
36
36
-
The SysRq command can't be used on VMs that are stopped or whose kernel is in a nonresponsive state (for example, a kernel panic).
37
+
The SysRq command can't be used on virtual machines that are stopped or whose kernel is in a non-responsive state. For example, a kernel panic.
37
38
38
39
### Enable SysRq
39
40
40
-
SysRq can be configured so that all, none, or only certain commands are available. You can enable all SysRq commands by using the following step, although this change doesn't survive a restart:
41
+
As described in the *SysRq Admin Guide*, SysRq can be configured such that all, none, or only certain commands are available. You can enable all SysRq commands using the following step, but it doesn't survive a reboot:
41
42
42
43
```console
43
44
echo "1" >/proc/sys/kernel/sysrq
44
45
```
45
46
46
-
To make the SysReq configuration persistent, follow these steps to enable all SysRq commands:
47
+
To make the SysReq configuration persistent, you can do the following to enable all SysRq commands
47
48
48
-
1.Add the following line to */etc/sysctl.conf*: <br />
49
+
1.Adding this line to */etc/sysctl.conf* <br>
49
50
`kernel.sysrq = 1`
50
-
1.Restart or update sysctl by running the following command: <br />
51
+
1.Rebooting or updating sysctl by running <br>
51
52
`sysctl -p`
52
53
53
-
### Command keys
54
+
### Command Keys
54
55
55
-
This command key table is taken from the SysRq Admin Guide.
56
+
From the SysRq Admin Guide:
56
57
57
58
|Command| Function
58
59
| ------| ----------- |
59
-
|``b`` | Immediately restarts the system without syncing or unmounting your disks.
60
-
|``c`` | Performs a system crash by a NULL pointer dereference. A crash dump file is created if configured.
60
+
|``b`` | Will immediately reboot the system without syncing or unmounting your disks.
61
+
|``c`` | Will perform a system crash by a NULL pointer dereference. A crashdump will be taken if configured.
61
62
|``d`` | Shows all locks that are held.
62
-
|``e`` | Sends a SIGTERM to all processes, except for init.
63
-
|``f`` | Calls the oom killer to kill a memory-intensive process.
64
-
|``g`` | Used by kgdb (kernel debugger).
65
-
|``h`` | Displays help. (Any key other than the keys that are listed here also displays help, but "h" is easy to remember.)
66
-
|``i`` | Send a SIGKILL to all processes, except for init.
67
-
|``j`` | Forcibly thaws filesystems that are frozen by the FIFREEZE ioctl.
68
-
|``k`` | Secure Access Key (SAK) that kills all programs on the current virtual console.
69
-
|``l`` | Shows a stack backtrace for all active CPUs.
70
-
|``m`` | Dumps current memory information to your console.
71
-
|``n`` | Allows real-time (RT) tasks to be reprioritized by using the "nice" value. NOTE: The "nice" value controls a process's priority for CPU scheduling, where lower values indicate higher priority.
72
-
|``o`` | Shuts off your system (if configured and supported).
73
-
|``p`` | Dumps the current registers and flags to your console.
74
-
|``q`` | Dumps CPU lists of all armed hrtimers (but not regular timer_list timers) and detailed information about all clockevent devices.
75
-
|``r`` | Turns off keyboard raw mode and sets it to XLATE.
76
-
|``s`` | Tries to sync all mounted filesystems.
77
-
|``t`` | Dumps a list of current tasks and their information to your console.
78
-
|``u`` | Tries to remount all mounted filesystems as read-only.
79
-
|``v`` | Forcefully restores the framebuffer console.
80
-
|``v`` | Creates an ETM buffer dump file [ARM-specific].
81
-
|``w`` | Dumps tasks that are in uninterruptible (blocked) state.
82
-
|``x`` | Used by the xmon interface on ppc/powerpc platforms. Shows global PMU registers on sparc64. Dumps all TLB entries on MIPS.
83
-
|``y`` | Shows global CPU Registers [SPARC-64 specific].
84
-
|``z`` | Dumps the ftrace buffer.
85
-
|``0``-``9`` | Sets the console log level to control which kernel messages are printed to your console. (For example, "0" restricts messages that are sent to your console to emergency messages, such as PANIC and OOPS.)
86
-
87
-
### Distribution-specific documentation
88
-
89
-
For distribution-specific documentation about SysRq and the steps to configure Linux to create a crash dump file when it receives a SysRq "Crash" command, see the following articles.
63
+
|``e`` | Send a SIGTERM to all processes, except for init.
64
+
|``f`` | Will call the oom killer to kill a memory hog process, but don't panic if nothing can be killed.
65
+
|``g`` | Used by kgdb (kernel debugger)
66
+
|``h`` | Will display help (any other key than those listed here also displays help, but ``h`` is easy to remember :-)
67
+
|``i`` | Send a SIGKILL to all processes, except for init.
68
+
|``j`` | Forcibly "Just thaw it" - filesystems frozen by the FIFREEZE ioctl.
69
+
|``k`` | Secure Access Key (SAK) Kills all programs on the current virtual console. NOTE: See important comments in the following SAK section.
70
+
|``l`` | Shows a stack backtrace for all active CPUs.
71
+
|``m`` | Will dump current memory info to your console.
72
+
|``n`` | Used to make RT tasks nice-able
73
+
|``o`` | Will shut off your system (if configured and supported).
74
+
|``p`` | Will dump the current registers and flags to your console.
75
+
|``q`` | Will dump per CPU lists of all armed hrtimers (but NOT regular timer_list timers) and detailed information about all clockevent devices.
76
+
|``r`` | Turns off keyboard raw mode and sets it to XLATE.
77
+
|``s`` | Will attempt to sync all mounted filesystems.
78
+
|``t`` | Will dump a list of current tasks and their information to your console.
79
+
|``u`` | Will attempt to remount all mounted filesystems read-only.
80
+
|``v`` | Forcefully restores framebuffer console
81
+
|``v`` | Causes ETM buffer dump [ARM-specific]
82
+
|``w`` | Dumps tasks that are in uninterruptible (blocked) state.
83
+
|``x`` | Used by xmon interface on ppc/powerpc platforms. Show global PMU Registers on sparc64. Dump all TLB entries on MIPS.
84
+
|``y`` | Show global CPU Registers [SPARC-64 specific]
85
+
|``z`` | Dump the ftrace buffer
86
+
|``0``-``9`` | Sets the console log level, controlling which kernel messages are printed to your console. (``0``, for example would make it so that only emergency messages like PANICs or OOPSes would make it to your console.)
87
+
88
+
### Distribution-specific documentation ###
89
+
90
+
For distribution-specific documentation on SysRq and steps to configure Linux to create a crash dump when it receives a SysRq "Crash" command, see the following links:
90
91
91
92
#### Ubuntu ####
92
93
@@ -105,24 +106,24 @@ For distribution-specific documentation about SysRq and the steps to configure L
A nonmaskable interrupt (NMI) creates a signal that software on a VM doesn't ignore. Historically, NMIs are used to monitor for hardware issues on systems that require specific response times. Today, programmers, and system administrators often use NMI as a mechanism to debug or troubleshoot systems that aren't responding.
111
+
A non-maskable interrupt (NMI) creates a signal that software on a virtual machine doesn't ignore. Historically, NMIs are used to monitor for hardware issues on systems that required specific response times. Today, programmers, and system administrators often use NMI as a mechanism to debug or troubleshoot systems that aren't responding.
111
112
112
-
You can use the Serial Console to send an NMI to an Azure VM by using the keyboard icon on the Command bar. After the NMI is delivered, the VM configuration controls how the system responds. Linux systems can be configured to stop responding and create a memory dump file that the OS receives as an NMI.
113
+
The Serial Console can be used to send an NMI to an Azure virtual machine using the keyboard icon in the following command bar. Once the NMI is delivered, the virtual machine configuration controls how the system responds. Linux operating systems can be configured to crash and create a memory dump the operating system receives an NMI.
113
114
114
-
:::image type="content" source="media/serial-console-nmi-sysrq/command-menu.png" alt-text="Screenshot of the Serial Console. The keyboard icon is highlighted, and its menu is visible. That menu contains a send nonmaskable interrupt item.":::
115
+
:::image type="content" source="media/serial-console-nmi-sysrq/command-menu.png" alt-text="Screenshot of the Serial Console. The keyboard icon is highlighted, and its menu is visible. That menu contains a Send Non-Maskable Interrupt item.":::
115
116
116
117
### Enable NMI
117
118
118
-
For Linux systems that support sysctl to configure kernel parameters, you can enable a panic by running the following commands when you receive the NMI:
119
+
For Linux systems that support sysctl for configuring kernel parameters, you can enable a panic when receiving this NMI by using the following commands:
119
120
120
-
1.Add this line to */etc/sysctl.conf*: <br>
121
+
1.Adding this line to */etc/sysctl.conf* <br>
121
122
`kernel.panic_on_unrecovered_nmi=1`
122
-
1.Restart or update sysctl by running: <br>
123
+
1.Rebooting or updating sysctl by running <br>
123
124
`sysctl -p`
124
125
125
-
For more information about Linux kernel configurations, including `unknown_nmi_panic`, `panic_on_io_nmi`, and `panic_on_unrecovered_nmi`, see: [Documentation for /proc/sys/kernel/*](https://www.kernel.org/doc/Documentation/sysctl/kernel.txt). For distribution-specific documentation about NMI and the steps to configure Linux to create a crash dump file when it receives an NMI, see the following articles:
126
+
For more information on Linux kernel configurations, including `unknown_nmi_panic`, `panic_on_io_nmi`, and `panic_on_unrecovered_nmi`, see: [Documentation for /proc/sys/kernel/*](https://www.kernel.org/doc/Documentation/sysctl/kernel.txt). For distribution-specific documentation on NMI and steps to configure Linux to create a crash dump when it receives an NMI, see the following links:
126
127
127
128
### Ubuntu
128
129
@@ -144,9 +145,9 @@ For more information about Linux kernel configurations, including `unknown_nmi_p
144
145
145
146
## Next steps
146
147
147
-
-See the main [Serial Console Linux documentation page](serial-console-linux.md).
148
-
- Use Serial Console to [start up into GRUB and enter Single User mode](serial-console-grub-single-user-mode.md)
149
-
-Learn about the [Serial Console for Windows VMs](../windows/serial-console-windows.md).
148
+
-The main Serial Console Linux documentation page is located [here](serial-console-linux.md).
149
+
- Use Serial Console to boot into [GRUB and enter single user mode](serial-console-grub-single-user-mode.md)
150
+
-The Serial Console is also available for [Windows](../windows/serial-console-windows.md) VMs
150
151
- Learn more about [boot diagnostics](../windows/boot-diagnostics.md)
151
152
152
153
[!INCLUDE [Azure Help Support](../../../includes/azure-help-support.md)]
0 commit comments