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
@@ -62,7 +62,7 @@ Other extensions such as Custom Script are available however these options requi
62
62
63
63
Ensuring you have access to the Azure Serial Console and GRUB means that a password change or an incorrect configuration can be rectified in a matter of minutes instead of hours. You could even force the VM to boot from an alternative kernel should you have multiple kernels on disk in the scenario where your primary kernel becomes corrupt.
64
64
65
-
:::image type="content" source="media/serial-console-grub-proactive-configuration/more-kernel.png" alt-text="Screenshot of the boot selected OS screen in GRUB, which shows multiple kernels can be chosen.":::
65
+
:::image type="content" source="media/serial-console-grub-proactive-configuration/more-kernel-updated.png" alt-text="Screenshot of the boot selected OS screen in GRUB, which shows multiple kernels can be chosen.":::
66
66
67
67
## Suggested order of recovery methods
68
68
@@ -96,19 +96,25 @@ To configure the VM to accept a reboot via SysRq commands on the Azure portal, y
96
96
97
97
For this configuration to persist a reboot, add an entry to the file **sysctl.conf**
98
98
99
-
`echo kernel.sysrq = 1 >> /etc/sysctl.conf`
99
+
```bash
100
+
sudo echo kernel.sysrq = 1 >> /etc/sysctl.conf
101
+
```
100
102
101
103
To configure the kernel parameter dynamically
102
104
103
-
`sysctl -w kernel.sysrq=1`
105
+
```bash
106
+
sudo sysctl -w kernel.sysrq=1
107
+
```
104
108
105
109
If you don't have **root** access or sudo is broken, it will not be possible configure sysrq from a shell prompt.
106
110
107
111
You can enable sysrq in this scenario using the Azure portal. This method can be beneficial if the **sudoers.d/waagent** file has become broken or has been deleted.
108
112
109
113
Using the Azure portal Operations -> Run Command -> RunShellScript feature, requires the waagent process be healthy you can then inject this command to enable sysrq
@@ -124,7 +130,7 @@ Select **Reboot** and **Send SysRq** Command
124
130
125
131
The system should log a reset message such as this
126
132
127
-
:::image type="content" source="media/serial-console-grub-proactive-configuration/retting-log.png" alt-text="Screenshot of the reset message log in the command-line interface.":::
133
+
:::image type="content" source="media/serial-console-grub-proactive-configuration/reset.png" alt-text="Screenshot of the reset message log in the command-line interface.":::
128
134
129
135
## Ubuntu GRUB configuration
130
136
@@ -135,7 +141,7 @@ By default you should be able to access GRUB by holding down **Esc** key during
135
141
Update the file /etc/default/grub.d/50-cloudimg-settings.cfg to keep the GRUB menu on screen for the specified TIMEOUT.
136
142
You aren't required to hit **Esc** as GRUB will be displayed immediately.
137
143
138
-
```console
144
+
```output
139
145
GRUB_TIMEOUT=5
140
146
GRUB_TIMEOUT_STYLE=menu
141
147
```
@@ -147,45 +153,23 @@ Similar behavior can be experienced by making changes to the file
147
153
148
154
Comment out these two lines:
149
155
150
-
```console
156
+
```output
151
157
#GRUB_HIDDEN_TIMEOUT=0
152
158
#GRUB_HIDDEN_TIMEOUT_QUIET=true
153
159
```
154
160
155
161
and add this line:
156
162
157
-
```console
163
+
```output
158
164
GRUB_TIMEOUT_STYLE=countdown
159
165
```
160
166
161
-
## Ubuntu 12\.04
162
-
163
-
Ubuntu 12.04 will allow access to serial console but doesn't offer the ability to interact.
164
-
A **login:** prompt isn't seen
165
-
166
-
For 12.04 to obtain a **login:** prompt:
167
-
168
-
1. Create a file called /etc/init/ttyS0.conf containing the following text:
169
-
170
-
```console
171
-
# ttyS0 - getty
172
-
#
173
-
# This service maintains a getty on ttyS0 from the point the system is
174
-
# started until it is shut down again.
175
-
start on stopped rc RUNLEVEL=[12345]
176
-
stop on runlevel [!12345]
177
-
178
-
respawn
179
-
exec /sbin/getty -L 115200 ttyS0 vt102
180
-
```
181
-
182
-
2. Ask upstart to start the getty
183
-
184
-
```console
185
-
sudo start ttyS0
186
-
```
167
+
Make sure the [email protected] is enabled so that systemd provides a login prompt on that console:
187
168
188
-
The settings required to configure serial console for Ubuntu versions can be found [here](https://help.ubuntu.com/community/SerialConsoleHowto)
The file to modify is /boot/grub/grub.conf. The `timeout` value will determine how long GRUB is shown for.
312
249
313
-
```console
314
-
#boot=/dev/vda
315
-
default=0
316
-
timeout=15
317
-
splashimage=(hd0,0)/grub/splash.xpm.gz
318
-
#hiddenmenu
319
-
serial --unit=0 --speed=9600
320
-
terminal serial
321
-
terminal --timeout=5 serial console
250
+
GRUB_DISTRIBUTOR="SLES15-SP5"
251
+
GRUB_GFXMODE=auto
252
+
GRUB_TERMINAL_INPUT="serial"
253
+
GRUB_TERMINAL_OUTPUT="serial"
254
+
GRUB_TIMEOUT_STYLE=countdow
322
255
```
323
256
324
-
The last line *terminal –-timeout=5 serial console* will further increase **GRUB** timeout by adding a prompt of 5 seconds displaying **Press any key to continue.**
325
-
326
-
:::image type="content" source="media/serial-console-grub-proactive-configuration/press-any-key-to-continue.png" alt-text="Screenshot shows a console with output.":::
327
-
328
-
GRUB menu should appear on-screen for the configured timeout=15 without the need to press Esc. Make sure to click in the Console in the Browser to make active the menu and select the required kernel.
329
-
330
-
:::image type="content" source="media/serial-console-grub-proactive-configuration/select-kernel.png" alt-text="Screenshot shows a console with two Linux options.":::
257
+
Make sure the [email protected] is enabled so that systemd provides a login prompt on that console:
This configuration will enable the message **Press any key to continue** to appear on the console for 5 seconds
291
+
This configuration will enable the message **Press any key to continue** to appear on the console for 5 seconds
383
292
384
293
It will then display the GRUB menu for an additional 5 seconds - by pressing the down arrow you will interrupt the counter and select a kernel you want to boot either append the keyword **single** for single user mode that requires root password to be set.
385
294
@@ -396,7 +305,9 @@ If you don't have root password and single user requires you to have a root pass
396
305
397
306
Remount your / (root) file system RW using the command
398
307
399
-
`mount -o remount,rw /`
308
+
```bash
309
+
mount -o remount,rw /
310
+
```
400
311
401
312
:::image type="content" source="media/serial-console-grub-proactive-configuration/bash-remount.png" alt-text="Screenshot shows a console with a re-mount action.":::
402
313
@@ -406,7 +317,9 @@ Now you can perform root password change or many other Linux configuration chang
0 commit comments