访问VM控制台
虚拟机串口
<serial type='pty'>
<source path='/dev/pts/1'/>
<target type='isa-serial' port='0'>
<model name='isa-serial'/>
</target>
<alias name='serial0'/>
</serial>
<console type='pty' tty='/dev/pts/1'>
<source path='/dev/pts/1'/>
<target type='serial' port='0'/>
<alias name='serial0'/>
</console> <serial type='file'>
<source path='/var/log/libvirt/vm_console/example-vm.log'/>
<target port='0'/>
</serial>
<console type='file'>
<source path='/var/log/libvirt/vm_console/example-vm.log'/>
<target type='serial' port='0'/>
</console>RHEL/CentOS 7
通过内核参数设置串口输出
CentOS 7使用grub2
CentOS 6.x
Ubuntu 16
已经测试:RHEL可以使用systemctl来激活serial-getty@ttyS0.service
systemctl来激活serial-getty@ttyS0.serviceDebian/Ubuntu
Ubuntu 15
参考
Last updated