변군이글루

[리눅스] KVM Virsh Console Access On CentOS 7 본문

서___리눅스

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

변군 변군이글루 2017.08.03 17:35

KVM Virsh Console Access On CentOS 7

 

 [Enable Serial Console on the Virtual Machine]

 

1. console=ttyS0 추가

[root@ANSIBLEmn01 ~]# vi /etc/default/grub 
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="net.ifnames=0 biosdevname=0 crashkernel=auto rhgb quiet
console=ttyS0"
GRUB_DISABLE_RECOVERY="true"

 

2. grub2-mkconfig 명령어 실행

[root@ANSIBLEmn01 ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.10.0-514.26.2.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-514.26.2.el7.x86_64.img
Found linux image: /boot/vmlinuz-3.10.0-514.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-514.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-5de8b61aa93e42d1ad9231d4b5035ed7
Found initrd image: /boot/initramfs-0-rescue-5de8b61aa93e42d1ad9231d4b5035ed7.img
done


[Enable Serial Console Access on the KVM host] -1

 

1. 수정

[root@ANSIBLE-KVM01 ~]# virsh edit ANSIBLEmn01

    <console type='pty'>
      <target type='serial' port='0'/>
    </console>

 

------


    <console type='pty' tty='/dev/pts/6'>
      <source path='/dev/pts/6'/>
      <target type='serial' port='0'/>
     
<alias name='serial0'/>
    </console>

 

2. VM 서버 다운

[root@ANSIBLE-KVM01 ~]# virsh shutdown ANSIBLEmn01

도메인 ANSIBLEmn01가 종료됨

 

3. VM 서버 기동

[root@ANSIBLE-KVM01 ~]# virsh start ANSIBLEmn01

도메인 ANSIBLEmn01가 시작됨

 

4. 콘솔 접속

[root@ANSIBLE-KVM01 ~]# virsh console ANSIBLEmn01

도메인 ANSIBLEmn01에 연결되었습니다

Escape character is ^]

 

CentOS Linux 7 (Core)

Kernel 3.10.0-514.26.2.el7.x86_64 on an x86_64

 

ANSIBLEmn01 login: root

암호:

Last login: Thu Aug  3 17:04:06 from 10.20.12.88

[root@ANSIBLEmn01 ~]#

 

[Enable Serial Console Access on the KVM host] - 2

# systemctl start serial-getty@ttyS0
# systemctl enable serial-getty@ttyS0

 

 

참고URL :

https://linuxadmin.io/enable-virsh-console-kvm/

http://www.geekpills.com/operating-system/linux/kvm-virtualization-enable-kvm-virsh-console-access-ubuntu-linux-vm

 

 

0 Comments
댓글쓰기 폼