본문 바로가기

리눅스

[리눅스] KVM Virsh Console Access On CentOS 6

반응형

KVM Virsh Console Access On CentOS 6

 

Step #1

vi /boot/grub/menu.lst
#

# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/sda3
#          initrd /initrd-[generic-]version.img

#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
serial -–unit=0 –speed=115200
terminal –-timeout=10 console serial
hiddenmenu
title CentOS (2.6.32-696.16.1.el6.x86_64)
        root (hd0,0)
        kernel /vmlinuz-2.6.32-696.16.1.el6.x86_64 ro root=UUID=032b264d-f0f8-45a5-b092-ece4fa4ff30d
rd_NO_LUKS LANG=ko_KR.UTF-8 nomodeset crashkernel=auto rhgb quiet rd_NO_MD crashkernel=auto KEYBOARDTYPE=pc
KEYTABLE=us rd_NO_LVM rd_NO_DM rhgb quiet console=tty0 console=ttyS0,115200
        initrd /initramfs-2.6.32-696.16.1.el6.x86_64.img
title CentOS 6 (2.6.32-696.el6.x86_64)
        root (hd0,0)
        kernel /vmlinuz-2.6.32-696.el6.x86_64 ro root=UUID=032b264d-f0f8-45a5-b092-ece4fa4ff30d
rd_NO_LUKS LANG=ko_KR.UTF-8 nomodeset crashkernel=auto rhgb quiet rd_NO_MD crashkernel=auto 
KEYBOARDTYPE=pc KEYTABLE=us rd_NO_LVM rd_NO_DM rhgb quiet
        initrd /initramfs-2.6.32-696.el6.x86_64.img

-----

splashimage=(hd0,0)/grub/splash.xpm.gz

serial -–unit=0 –speed=115200

KEYTABLE=us rd_NO_LVM rd_NO_DM rhgb quiet console=tty0 console=ttyS0,115200

        initrd /initramfs-2.6.32-696.16.1.el6.x86_64.img

-----

 

Step #2

vi /etc/inittab
...
# Default runlevel. The runlevels used are:
#   0 - halt (Do NOT set initdefault to this)
#   1 - Single user mode
#   2 - Multiuser, without NFS (The same as 3, if you do not have networking)
#   3 - Full multiuser mode
#   4 - unused
#   5 - X11
#   6 - reboot (Do NOT set initdefault to this)
#

S0:2345:respawn:/sbin/agetty ttyS0 115200 linux

id:3:initdefault:

-----

S0:2345:respawn:/sbin/agetty ttyS0 115200 linux

-----

 

Step #3

vi /etc/securetty
console
vc/1
vc/2
vc/3
vc/4
vc/5
vc/6
vc/7
vc/8
vc/9
vc/10
vc/11
tty1
tty2
tty3
tty4
tty5
tty6
tty7
tty8
tty9
tty10
tty11
ttyS0

-----

ttyS0

-----

 

Step #4

vi /etc/init/ttyS0.conf
stop on run level [S016]

start on runlevel [345]

respawn

instance /dev/ttyS0

exec /sbin/mingetty /dev/ttyS0

-----

stop on run­level [S016]

start on runlevel [345]

respawn

instance /dev/ttyS0

exec /sbin/mingetty /dev/ttyS0

-----

 

Step #5

initctl start ttyS0

 

Step #6

reboot

 

참고URL :

https://www.cyberciti.biz/faq/centos-rhel-6-install-serial-console/

https://sathisharthars.com/2013/05/03/setting-up-a-serial-console-in-qemu-and-libvirt/

 

728x90
반응형