Movatterモバイル変換


[0]ホーム

URL:


Documentation

Setting up a serial console

Many modern motherboards support remote console access. Intel calls theirsolution Baseboard Management Controller. Apart from the friendlywebinterface BMC also offers a facility called SOL SSH. With this it ispossible to access the first serial port (ttya/com1) over ssh. When youconfigure it you can access BIOS settings and other boot time things likeboot media selection over ssh which is quite nice in it self. But evenbetter, you can also configure OmniOS to provide access to a serial consoleover this path. Which is a great recovery option. Here is how to set thisup.

The following examples are screenshots from an Intel S2600ST Motherboard.

Configuring the BMC

Configure the SSH SOL Port

BMC SSH SOL Activation

Enable SSH SOL

BMC SSH SOL Port

BIOS Settings

Enable the Serial Port

Enable the Serial Port

Enable Console Redirection. Since we are running the console on adedicated ethernet interface I enable SOL only there.

Enable the Serial Port

Setup the Serial Console in OmniOS

Setup the ttya port

sttydefs-r ttyasttydefs-a ttya-i'115200 hupcl opost onlcr ofill'-f'115200'

Configure a new console-login instance

svccfg-s svc:/system/console-login delete-f ttyasvccfg-f -<<EOFselect svc:/system/console-loginadd ttyaselect svc:/system/console-login:ttyaaddpg ttymon applicationsetprop ttymon/device = astring: /dev/term/asetprop ttymon/terminal_type = astring: xtermsetprop ttymon/label = astring: ttyasetprop ttymon/modules = astring: ldterm,ttcompatsetprop ttymon/nohangup = boolean: truesetprop ttymon/prompt = astring: "`uname -n` ttya login:"addpg general frameworkEOF

and enable the new console login

svcadmenablesvc:/system/console-login:ttya

Allow root logins on all consoles

perl-i-p-e's/\s*(CONSOLE.+)/# $1/' /etc/default/login

Get the Loader to use the Serial Console

You can also make the omnios loader talk over serial:

cat>/boot/conf.d/serial<<EOFboot_multicons="YES"boot_serial="YES"comconsole_speed="115200"os_console="text"console="ttya,text"ttya-mode="115200,8,n,1,-"EOF

Finally update the boot archive and reboot

bootadm update-archivereboot

Trying it out

Now you can ssh into your server by simply doing:

ssh-p 66 server-console-ip

Console Resizing

If you tried vim on your new serial console, you were probably in for adisapointed — somehow it jumbled up the screen. The reason for this is,that over the serial console connection stty does not seem to get properlyinformed about screen size and screen size changes. Runstty and it will report rows and cols as0 which is not ideal. There is a way to fix this though.

The easiest is to just typeresize to get things fixed … unfortunatelytheresize comand is part of thexterm package which is probably notinstalled on your omnios GZ. There is another way though. If you are runningbash, a little shell function will do:

resize(){old=$(stty-g)stty-echoprintf'\033[18t'IFS=';'read-d t _ rows cols _stty"$old"sttycols"$cols" rows"$rows"}

I have put the following into~root/.bash_profile to make it allautomatic:

if[!-f /usr/bin/resize];thenresize(){old=$(stty-g)stty-echoprintf'\033[18t'IFS=';'read-d t _ rows cols _stty"$old"sttycols"$cols" rows"$rows"}fi# resize terminalif["$(tty)"='/dev/term/a'];thenresizefi

Now whenever I login on ttya the screen gets automatically resized.

The SMASH-CLP Console

Maybe your system has a SMASH console. This also lets you connect to theserial port. Just type:

start /system1/sol1

to get started and^. to disconnect. (^ is not the control key, but thelittle hat above the6 key on a US keyboard).

Help making this better

If you have figured out how to make the SOL SSH console work on anothermotherboard, pleaseprovide a PR.

OmniOS Newsletter

Subscribe to our newsletter, to keep up to date with new releases of OmniOS and major security updates!


[8]ページ先頭

©2009-2025 Movatter.jp