2

I am using VMware to run a CentOS 7 virtual machine with a GNOME desktop.

I am having an issue where every time I shut down the virtual machine instead of showing a nice shutdown screen I get a terminal window with ugly poorly formatted messages.

enter image description here

This is how it seems to act by default (without touching any configuration). Does anyone know what could be causing this?

From what I understand, the startup and shutdown screens are configured using "grub". I'm not sure if it helps, but this is my "/etc/default/grub" configuration file:

GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=centos00/root 
rd.lvm.lv=centos00/swap rd.lvm.lv=centos01/swap rd.lvm.lv=centos00/usr rhgb 
quiet"
GRUB_DISABLE_RECOVERY="true"

EDIT

I tried following hildred's advice and added a serial console to the kernel command line. (I had to use ttyS1 instead of S0 because of the way VMware configured the serial port.)

enter image description here

It looks like the problem starts right after GNOME Display Manager is started.

I am in the process of figuring out how to submit a bug report.


UPDATE:

Jonas Stein
  • 3,898
  • 4
  • 34
  • 55
tjwrona1992
  • 153
  • 6
  • The "starting" messages are sent because the system is switching run-levels to an intermediate level (like safe-mode) so that filesystems can be shutdown properly. Those services don't have to be running interactively, but their messages were written with that assumption - and as you see, not applicable. – Thomas Dickey Jan 02 '18 at 21:30
  • Restarting `gdm` also shows this kind of randomly oriented text on screen in CentOS 7 and Fedora 27 (any other os also may have the same problem). This occurs irrespective of virtual box or physical machine. Don't know the reason. – Abhik Bose Jan 22 '18 at 16:35

1 Answers1

2

Grub is a bootloader and is not used after the kernel starts therefore has no relationship with shutdown or for that matter startup logging. Also the virtualization environment is almost certainly not a factor and the window manager is probably not.

So what is happening? the critical clue is visible in the screenshot, notice that in almost every case each message begins one line below and one character to the right of the previous message. This tells us that the terminal's line ending interpretation is in the wrong mode. Fixing this is what the reset command is written to do (reset|sudo tee /dev/tty would do this as a user, but by the time you login all the startup messages are past so this would only help with shutdown messages). On the other hand the most common cause of this is sending garbage to the screen or a crashing full screen program, neither of which should happen during startup.

To troubleshoot which service is causing this the easiest way is a serial console because a serial terminal allows logging during kernel panics, shutdown and for this case startup. Step one: setup a serial port in the VmWare for this machine. (I am not familiar with VmWare but similar tools allow directing the serial port to a file which is the simplest method for what you need. Other methods may also work.) Step two: add a serial console to the kernel command line. You only need to do this for one boot so when the grub menu comes up press e to edit the current boot option (after moving to the one you normally use) look for a line beginning with linux and add console=ttyS0,115200 console=tty0 to the end of that line. (115200 is the baud rate, change if needed. 8 bits no parity. the first console enables the serial port the second enables the default.) Step three: review the log. the problem is almost certainly with the last program to put it's startup message in the correct place. Step four: file a bug report. This should not happen. Do not forget to include the startup log in your bug report.

hildred
  • 5,759
  • 3
  • 30
  • 43
  • Thank you for the very detailed response. This problem doesn't seem to occur during startup, only during shutdown. (Even if I remove `rhgb` and `quiet` from the grub config so it shows all startup messages, they all show up formatted correctly.) Unfortunately, even though it only occurs during shutdown, `reset | sudo tee /dev/tty` doesn't seem to have an effect. :( – tjwrona1992 Jan 02 '18 at 19:13
  • Interesting as the screenshot looks to be from a startup, but the same log file would still be useful to find the problem. also check to make sure reset is installed and in your path. – hildred Jan 02 '18 at 19:17
  • You're right it is very misleading, I think these may be startup messages that somehow get displayed during shutdown. I will try what you suggested and see if I get anywhere. – tjwrona1992 Jan 02 '18 at 19:19
  • I gave it a shot, but nothing was being written to the file I directed serial output to. I did get more information though and have edited the question. – tjwrona1992 Jan 02 '18 at 19:38
  • I got the serial output to work! It looks like GNOME Display Manager may be the culprit. See the edited question for more details. – tjwrona1992 Jan 02 '18 at 20:23