vnc连接linux时出现双鼠标的问题
前文提到过,在虚拟硬件配置中使用绝对定位设备(tablet)取代相对定位设备(mouse)是解决 QEMU VNC 访问 Xen 虚拟机时“双鼠标指针”问题的办法之一。这种办法对于 Windows 和 Ubuntu 虚拟机都有效,无需在虚拟机操作系统内做额外配置。但这对于 CentOS 虚拟机无效,初步判断是 CentOS 没有相应的 tablet 设备驱动。不过经实验发现,CentOS 中已包含相应驱动,只是没有对 X 进行适当的配置。只要对 CentOS 虚拟机进行以下配置,即可使两个鼠标指针同步移动:
1、确保系统中存在 evdev 驱动模块:/usr/lib/xorg/modules/input/evdev_drv.so(x86_64 系统为 /usr/lib64/xorg/modules/input/evdev_drv.so)。
2、在 proc 文件系统下查看 QEMU USB Tablet 对应的 event 设备名。在本例中为 event2。
- $ cat /proc/bus/input/devices
- ?
- I: Bus=0003 Vendor=0627 Product=0001 Version=0000
- N: Name=”QEMU 0.8.2 QEMU USB Tablet”
- P: Phys=usb-0000:00:01.3-2/input0
- S: Sysfs=/class/input/input2
- H: Handlers=mouse1 event2 js0
- B: EV=b
- B: KEY=70000 0 0 0 0 0 0 0 0
- B: ABS=103
3、修改 xorg.conf,添加一个 InputDevice(本例中命名为“MouseTS”),并将其加入 ServerLayout 段。其中 Device 选项的值参考上一步找到的 event 设备名。
- $ vi /etc/X11/xorg.conf
- ?
- Section “ServerLayout”
- ?? ? ? ?Identifier? ? ?”Default Layout”
- ?? ? ? ?Screen? ? ? 0? “Screen0” 0 0
- ?? ? ? ?InputDevice? ? “Keyboard0” “CoreKeyboard”
- ?? ? ? ?InputDevice? ? “MouseTS” “CorePointer”
- EndSection
- ?
- Section “InputDevice”
- ?? ? ? ?Identifier? ? ?”MouseTS”
- ?? ? ? ?Driver? ? ? ? ?”evdev”
- ?? ? ? ?Option? ? ? ? ?”Device” “/dev/input/event2”
- ?? ? ? ?Option? ? ? ? ?”DeviceName” “touchscreen”
- EndSection
参考:
http://thread.gmane.org/gmane.comp.emulators.qemu/11516
http://forums.opensuse.org/english/get-help-here/hardware/418972-usb-mouse-device-problem.html