admin 发表于 2023-9-22 15:00:01

kvm虚机添加console方式获取vnc连接

在xml文件中添加如下信息:
<serial type='file'>
      <source path='/var/lib/nova/instances/windows2019/console.log'/>
      <target port='0'/>
      <alias name='serial0'/>
    </serial>
    <serial type='pty'>
      <source path='/dev/pts/0'/>
      <target port='1'/>
      <alias name='serial1'/>
    </serial>
    <console type='file'>
      <source path='/var/lib/nova/instances/windows2019/console.log'/>
      <target type='serial' port='0'/>
      <alias name='serial0'/>
    </console>
    <input type='tablet' bus='usb'>
      <alias name='input0'/>
    </input>
    <input type='mouse' bus='ps2'/>
    <graphics type='vnc' port='5909' autoport='yes' listen='0.0.0.0' keymap='en-us'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>

保存退出:

virsh destroy 虚机

virsh start 虚机即可正常使用。

页: [1]
查看完整版本: kvm虚机添加console方式获取vnc连接