Getting a terminal console
From Linux on Power wiki
The HMC can be used to obtain a virtual serial-port console to a given partition. This console can be used to:
- Get access to the open firmware prompt (before the operating system has been booted),
- Get access to the yaboot bootloader prompt (to select a kernel, or supply special bootloader arguments),
- View the kernel and operating system boot messages during boot,
- Get a Linux operating system login prompt (this is the only way to login if SSH or networking is unconfigured or broken).
- Work a kernel debugger (KDB or xmon session) if the kernel has crashed, or view the magic-sysreq output.
There are several ways to get a console for a system.
Console via HMC GUI
A console can be obtained from the HMC GUI. This console has several disadvantages, one of which is that is uses an old xterm without modern terminal features.
Console via HMC commandline
A console can be obtained from the HMC command line. This has several advantages; most notably, if you are logged in remotely to the HMC, this will use the terminal that you are currently using.
To open a console terminal:
- mkvterm -m <machine> -p <partition>
This can be exited with ~~.
To remove a terminal someone else is using:
- rmvterm -m <machine> -p <partition>
A menu-driven selection of attached machines and pertitions can be gotten via
An escape sequence to leave vtmenu terminal session is:
In case you've forgotten what the machine or partition is, the HMC can be asked to list everything attached to it. See the article "viewing partition state" for details.
Kernel boot line parameters
If kernel boot output is not going to the console, this may be because the kernel is misconfigured or is confused about where to send console output. One can force boot output to go to the HMC console by adding the following to /etc/yaboot.conf:
Equivalently, one may append console=hvc0 to the boot prompt.
If you see
for an HMC-attached system, this is incorrect. The hvsi driver sends output directly to the serial port, and is appropriate if the machine is not attached to an HMC. However, if the machine is attached to an HMC, you will want to use the hvc driver. If you alternate between an attached and un-attached setup, you will need to make this change when you remove/add the HMC.
A note about serial port numbering
The hvsi0 driver sends output to the serial port physically labelled 1 on the back of the box. The hvsi1 driver sends output to the serial port physically marked 2 on the back of the box.
Console tty configuration
If, after booting, there is no login prompt at the console, then a getty line is missing from the inittab. Edit /etc/inittab and add something similar to this:
- co:2345:respawn:/sbin/agetty hvc0 38400 vt100-nav
On a debian testing (etch) installation, replace the /etc/inittab line that says
- 1:2345:respawn:/sbin/getty 38400 tty1
- 1:2345:respawn:/sbin/getty 38400 hvc0 vt100-nav
"agetty" is, on a more recent distribution, no longer called that way. It is now just "getty"
Comment out the other lines that try to spawn getty on tty's. They won't work.
If a root login is consistently denied, then edit /etc/securetty and add hvc0 (and hvsi0, hvsi1) to the list. This file controls what terminals are allowed to have root logins.