lost and found ( for me ? )

Showing posts with label tty. Show all posts
Showing posts with label tty. Show all posts

iLO4 : access to an iLO VSP(virtual serial port) over SSH

Reference
http://blog.chrysocome.net/2013/05/proliant-virtual-serial-port.html
http://balazsdeak.blogspot.jp/2015/02/hp-dl380-serial-console-with-red-hat.html

OS : CentOS 6.7
iLO 4

  • BIOS settings ( default settings )

Set ‘BIOS Serial Console Port’ to COM2
Set ‘BIOS Serial Console Baud Rate’ to 115200

  • OS

When ttyS1(ttyS1 is for COM2) is not configured on your OS, you will see nothing when connecting to VSP as below.

Access to an iLO over SSH and enter VSP.
$ ssh 192.168.10.10 -l user

</>hpiLO-> VSP

Virtual Serial Port Active: COM2

Starting virtual serial port.
Press 'ESC (' to return to the CLI Session.

*** blank ***

</>hpiLO->

Configure ttyS1.
Create a file named “ttyS1.conf” under /etc/init directory.
$ sudo vi /etc/init/ttyS1.conf

$ sudo cat /etc/init/ttyS1.conf
stop on runlevel [S016]
start on runlevel [235]

respawn
instance /dev/ttyS1
exec /sbin/agetty 115200 ttyS1 vt100

Add ttyS1 in securetty file.
$ sudo tail -1 /etc/securetty
ttyS1

enable ttyS1.
$ sudo initctl start ttyS1
ttyS1 (/dev/ttyS1) start/running, process 8406

Access to the VSP over SSH.
</>hpiLO-> VSP

Virtual Serial Port Active: COM2

Starting virtual serial port.
Press 'ESC (' to return to the CLI Session.

localhost.localdomain login:
CentOS release 6.7 (Final)
Kernel 2.6.32-573.7.1.el6.x86_64 on an x86_64

In CentOS6, init daemon uses upstart, not Sys V init, so ‘telinit q’ does not work.
You need to create a file under /etc/init directory instead of editing /etc/inittab file.

edit /etc/grub.conf so that you can see boot messages.
timeout=5
# unit=0 for COM1, unit=1 for COM2
serial --unit=1 --speed=115200 --word=8 --parity=no --stop=1
terminal --timeout=5 serial console
#splashimage=(hd0,1)/grub/splash.xpm.gz
hiddenmenu

title CentOS (2.6.32-573.7.1.el6.x86_64)
       root (hd0,1)
       kernel /boot/vmlinuz-2.6.32-573.7.1.el6.x86_64 ro root=UUID=aaa rd_NO_LUKS rd_NO_MD crashkernel=auto  rhgb quiet console=tty0 consle=ttyS1,115200n8

Linux KVM : connect to a Linux Mint12 VM via virsh console


small tips


how to use virsh console.

KVM host : Ubuntu 11.10
VM : Linux Mint 12

[ on the KVM host (Ubuntu 11.10 ) ]

confirm the VM has serial ports.
# virsh dumpxml Mint12-64-1 | less
   <serial type='pty'>
     <source path='/dev/pts/5'/>
     <target port='0'/>
     <alias name='serial0'/>
   </serial>
   <console type='pty' tty='/dev/pts/5'>
     <source path='/dev/pts/5'/>
     <target type='serial' port='0'/>
     <alias name='serial0'/>


[ on the VM ( Linux Mint 12 ) ]

make /etc/init/ttyS0.conf file
# cat /etc/init/ttyS0.conf
start on stopped rc RUNLEVEL=[2345]
stop on runlevel [!2345]

respawn
exec /sbin/getty -L 115200 ttyS0 vt 102


“start ttyS0”
# start ttyS0
ttyS0 start/running, process 703


edit /boot/grub/grub.cfg

By default , grub.cfg is read-only permission.
add write permission.
# chmod u+w /boot/grub/grub.cfg


edit grub.cfg ( add red lines )
menuentry 'Linux Mint 12 64-bit, 3.0.0-16-generic (/dev/vda1)' --class linuxmint
--class gnu-linux --class gnu --class os {
       recordfail
       set gfxpayload=$linux_gfx_mode
       insmod gzio
       insmod part_msdos
       insmod ext2
       set root='(hd0,msdos1)'
       search --no-floppy --fs-uuid --set=root e1679c23-ba3c-4d9f-9d02-b2a3d69b
5af4
       linux   /boot/vmlinuz-3.0.0-16-generic root=UUID=e1679c23-ba3c-4d9f-9d02
-b2a3d69b5af4 ro   quiet splash vt.handoff=7 console=ttyS0,115200n8
       initrd  /boot/initrd.img-3.0.0-16-generic


reboot the VM.

connect to the VM via virsh console
virsh # console Mint12-64-1
Connected to domain Mint12-64-1
エスケープ文字は  ^] です