连接虚拟机时鼠标和键盘无法在VNC查看器和tightVNC中工作

问题描述 投票:0回答:0

我使用我的 Windows 10 PC 来控制远程 CentOS7 服务器并在该服务器上创建一个 VM。 VM是第一次创建,需要安装CentOS7。 从VNC查看器中,我发现我可以在选择“安装CentOS7”或“测试此媒体并安装CentOS7”的界面中看到运行时间,但我无法在安装配置中使用我的鼠标和键盘。 enter image description here

虚拟化方法:qemu-kvm

创建VM的方法:编辑xml文件并virsh定义

虚拟机管理工具:libvirt 4.5.0

配置VM的xml文件如下:

<domain type='kvm'>
    <name>centos7-chj-1st</name>
    <memory unit='GiB'>8</memory>
    <vcpu>4</vcpu>
    <os>
    <type arch='aarch64' machine='virt'>hvm</type>
    <loader readonly='yes' type='pflash'>/usr/share/AAVMF/AAVMF_CODE.fd</loader>
    <nvram>/var/lib/libvirt/qemu/nvram/centos7_VARS_1st.fd</nvram>
    </os>
    <features>
    <acpi/>
    <gic version='3'/>
    </features>
    <cpu mode='host-passthrough'>
        <topology sockets='2' cores='2' threads='1'/>
    </cpu>
    <iothreads>1</iothreads>
    <clock offset='utc'/>
    <on_poweroff>destroy</on_poweroff>
    <on_reboot>restart</on_reboot>
    <on_crash>restart</on_crash>
    <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <disk type='file' device='disk'>
        <driver name='qemu' type='qcow2' cache='none' io='native' iothread="1"/>
        <source file='/home/chj/firstVM/test-image.qcow2'/>
        <target dev='vda' bus='virtio'/>
        <boot order='1'/>
    </disk>
    <disk type='file' device='cdrom'>
        <driver name='qemu' type='raw' cache='none' io='native'/>
        <source file='/home/chj/firstVM/CentOS-7-aarch64-Minimal-2009.iso'/>
        <readonly/>
        <target dev='sdb' bus='scsi'/>
        <boot order='2'/>
    </disk>
    <interface type='bridge'>
        <source bridge='br0'/>
    </interface>
    <console type='pty'/>
    <video>
        <model type='virtio'/>
     </video>
     <controller type='scsi' index='0' model='virtio-scsi'/>
        <graphics type='vnc' port='5902' autoport='no' listen='0.0.0.0' passwd='xxxxxx'/>
        <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    </devices>
    <seclabel type='dynamic' model='dac' relabel='yes'/>
</domain>

  1. 我检查我的 VNC 查看器是否勾选了“仅查看”框。我发现它没有被勾选。
  2. 我检查我的输入,我发现它是 en-us.
  3. 我在远程服务器上安装了 firewalld。防火墙和端口 5902 是打开的,但我发现在这种情况下我的 vnc 查看器无法连接到它。
  4. 我检查了我远程服务器的iptables,结果如下:
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:5902
ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0            state RELATED,ESTABLISHED
ACCEPT     icmp --  0.0.0.0/0            0.0.0.0/0           
ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0           
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0            state NEW tcp dpt:22
REJECT     all  --  0.0.0.0/0            0.0.0.0/0            reject-with icmp-host-prohibited

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         
REJECT     all  --  0.0.0.0/0            0.0.0.0/0            reject-with icmp-host-prohibited

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destinati

我认为问题可能与xml文件有关,但我不知道如何编辑它。

xml virtual-machine kvm vnc libvirt
© www.soinside.com 2019 - 2024. All rights reserved.