microsoft / azserialconsole

Azure Serial Console
17 stars 11 forks source link

Serial Console ignoring input during grub loader #86

Closed BDworak closed 4 years ago

BDworak commented 4 years ago

Having issues with a VM ignoring all keyboard input during the GRUB loader stage. I have gotten the grub loader to show up and have uninstalled plymouth as recommended by the documentation. What is the next step to determine why GRUB just counts down to 0 and ignores all attempts at "esc, up, down, left, right, enter, c, v, ^, etc."?

asinn826 commented 4 years ago

Hey Bart, happy to dive into this a bit more. What distro are you using and what does your grub config look like?

BDworak commented 4 years ago

RedHat Enterprise Linux running version 7.7. I think the server was originally set up from a non-azure image since I did have to modify GRUB_CMDLINE_LINUX to actually display the grub loader in Azure Serial console.

GRUB_TIMEOUT=60
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="serial console"
GRUB_CMDLINE_LINUX="console=tty1 console=ttyS0,115200n8 earlyprintk=ttyS0,115200 rootdelay=300 net.ifnames=0"
GRUB_DISABLE_RECOVERY="false"

Currently grub will show up, but no matter what keyboard commands are used they are all ignored. Once the OS boots, the keyboard works and I am able to login via the serial console. I have tried this in both MS Chromium Edge and in Google Chrome with the same results.

asinn826 commented 4 years ago

Can you share your VM name, resource group name, and subscription id? Feel free to email me if you're not comfortable sharing here - I think you have my email.

BDworak commented 4 years ago

Emailed the details. We can continue non resource specific discussions here in case anyone runs into this in the future and finds this thread :)

asinn826 commented 4 years ago

Brief, probably not-too-helpful update, we're still unsure as to why this is occurring, but we're still looking into it!

asinn826 commented 4 years ago

Turns out this is an issue with RHEL. Mitigation is to add the following line into your grub config: GRUB_TERMINAL_INPUT="serial console"

And then rebuild grub with grub2-mkconfig -o /boot/grub2/grub.cfg if your VM is Gen 1.

You could probably get away with just serial, but I would recommend putting both the serial and the console options in there.

asinn826 commented 4 years ago

Alternatively, just set the GRUB_TERMINAL line to "serial console" and rebuild grub, That should work too.

BDworak commented 4 years ago

This worked!! Thanks Alfred!

bj00rn commented 2 years ago

@BDworak Can we have this documented in the official documentation? Cheers!