注意这些设置都在你要进入虚拟机里设置,不是在你的物理机设置
首先debian12 需要设置
grep ttyS0 /etc/securetty
#没有则加上
echo ttyS0 >> /etc/securetty
#启动
systemctl start serial-getty@ttyS0
systemctl enable serial-getty@ttyS0
#CentOS Stream 9, opensuse:tumbleweed,ubutun,直接启动即可
systemctl start serial-getty@ttyS0
systemctl enable serial-getty@ttyS0
进入
virsh console test-202
#或者
virsh console 51(序号)