admin 发表于 2019-9-13 10:39:09

error: internal error: cannot find character device <null> virsh console报

virsh console 报错
error: internal error: cannot find character device <null>
Error "internal error cannot find character device" when trying to connect a domain's consoleSymptom% virsh console test2 Connected to domain test2 Escape character is ^] error: internal error cannot find character device (null)
InvestigationThe error tells there is no serial console configured for the domain.SolutionSetup serial console in the domain's XML.1) Add the following XML in domain's XML (using "virsh edit") NOTE: It's necessary to write this in the <devices>-Section. <serial type='pty'>   <target port='0'/> </serial> <console type='pty'>   <target type='serial' port='0'/> </console>2) Setup console in guest kernel command line, you can login into the guest to edit /boot/grub/grub.conf directly, or using tool "virt-edit". Append following to the guest kernel command line: console=ttyS0,1152003) % virsh start vm --console

admin 发表于 2019-9-19 14:05:12

解决办法:
通过virsh edit 修改xml文件,添加如下信息,即可:
    <interface type='bridge'>
      <mac address='52:54:00:af:49:04'/>
      <source bridge='vpc-connection'/>
      <target dev='peer-175.73'/>
      <model type='virtio'/>
      <driver name='qemu'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </interface>
    <serial type='pty'>
      <target port='0'/>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <channel type='spicevmc'>
      <target type='virtio' name='com.redhat.spice.0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
修改完成后保存:
vi /etc/libvirt/qemu/xxx.xml文件的配置信息是否正确


重启kvm虚机:
virsh destroy xxx
virsh start xxx

admin 发表于 2019-9-19 14:05:30

解决办法:
通过virsh edit 修改xml文件,添加如下信息,即可:
    <interface type='bridge'>
      <mac address='52:54:00:af:49:04'/>
      <source bridge='vpc-connection'/>
      <target dev='peer-175.73'/>
      <model type='virtio'/>
      <driver name='qemu'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </interface>
    <serial type='pty'>
      <target port='0'/>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <channel type='spicevmc'>
      <target type='virtio' name='com.redhat.spice.0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
修改完成后保存:
vi /etc/libvirt/qemu/xxx.xml文件的配置信息是否正确


重启kvm虚机:
virsh destroy xxx
virsh start xxx

admin 发表于 2019-9-19 14:05:34

解决办法:
通过virsh edit 修改xml文件,添加如下信息,即可:
    <interface type='bridge'>
      <mac address='52:54:00:af:49:04'/>
      <source bridge='vpc-connection'/>
      <target dev='peer-175.73'/>
      <model type='virtio'/>
      <driver name='qemu'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </interface>
    <serial type='pty'>
      <target port='0'/>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <channel type='spicevmc'>
      <target type='virtio' name='com.redhat.spice.0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
修改完成后保存:
vi /etc/libvirt/qemu/xxx.xml文件的配置信息是否正确


重启kvm虚机:
virsh destroy xxx
virsh start xxx
页: [1]
查看完整版本: error: internal error: cannot find character device <null> virsh console报