vnc连接HVM的DomainU时鼠标指针的问题
通过Xen自带的vnc server连接HVM的DomainU时,会出现两个鼠标指针的现象。其中的一个黑点是vnc传过来的绝对坐标确定的鼠标,而另一个指针是HVM中真实的鼠标。两个鼠标指针不是问题,问题是二者并不同步,使用起来很不方便。(参见Users' Manual。)其中的一个解决方法是在配置文件中将显示方式改为sdl,这样只会显示一个鼠标指针(但我装的一个Debian仍然显示两个,估计是bug);另外一个是将vnc的设置做一些改动:首先是将usb=1加上,然后再加上usbdevice='tablet',这样虽然仍显示两个,移动一个时,鼠标指针比起黑点有一些延时,但鼠标停下来后鼠标指针会定位到黑点,总的效果还可以(调整鼠标精确度后,似乎对鼠标没任何影响)。
p.s.
1. 如果同时加上usbdevice=mouse和usbdevice=tablet效果和只加usbdevice=tablet基本一样;而如果只加usbdevice=mouse,效果和没加一样,而且有时鼠标指针不能移动(黑点可以移动),整个屏幕没反应,等好一会儿才恢复正常。(只有usbdevice=tablet时也可能出现鼠标暂时失效的问题,仅在usbdevice=mouse和usbdevice=tablet同时出现时尚未发现此问题。)
2. 在Debian系统中,不需要设置usb选项,只需在系统设置中把鼠标精确度调整一下就可以了,黑点和鼠标指针始终重合,效果比设置了usb选项还好;但是在Windows系统中,设置了鼠标灵敏度后还是不行,其加速效果太明显:例如缓慢移动时鼠标指针比黑点慢,而快速移动时又比黑点快。
3. 以上都是在HVM中,而对于PV,也有相应的选项,以后再试试。
4. 下面来贴一下Debian和Windows系统的配置文件:
下面是Debian系统的:
# -*- mode: python; -*-
arch = os.uname()[4]
if re.search('64', arch):
arch_libdir = 'lib64'
else:
arch_libdir = 'lib'
#----------------------------------------------------------------
# hvmloader in place of a kernel image
kernel = "/usr/lib/xen/boot/hvmloader"
# guest domain build function (for HVM guests we use 'hvm')
builder='hvm'
device_model = '/usr/' + arch_libdir + '/xen/bin/qemu-dm'
# memory allocation at boot in MB
memory = 512
# shadow pagetable memory,
#should be at least 2KB per MB of memory plus a few MB per vcpu
shadow_memory = 8
name = "cs.fv.deb" # name for the domain
# number of CPUs guest has available (default=1)
vcpus=2
# HVM guest PAE support (default=0 disabled)
#pae=0
# HVM guest ACPI support (default=0 disabled)
#acpi=0
# HVM guest APIC support (default=0 disabled)
#apic=0
#----------------------------------------------------------------
# 1 NIC, auto-assigned MAC address
vif = [ 'type=ioemu, bridge=eth0' ]
# first device is LVM partition to use as hard disk,
# second device is an image of an installation CD-ROM
#disk = ['phy:/dev/XenGuests/hvm1,hda,w', 'tap:aio:/root/winxp.iso,hdc:cdrom,r']
#disk = ['file:/home/cs/xen/img/deb/fv.deb.img,hda,w', 'file:/home/cs/Desktop/mini.iso,hdc:cdrom,r']
disk = ['file:/home/cs/xen/img/deb/fv.deb.img,hda,w']
# boot order (a=floppy, c=hard disk, d=CD-ROM; default=cda)
boot="cda"
# function to execute when guest wishes to power off
#on_poweroff = 'destroy'
# function to execute when guest wishes to reboot
#on_reboot = 'restart'
# function to execute if guest crashes
#on_crash = 'restart'
#----------------------------------------------------------------
# SDL library support for graphics (default=0 disabled)
sdl=0
# VNC library support for graphics (default=0 disabled)
vnc=1
#------------------------VNC-------------------------------------
# address for VNC server to listen on,
# (default is to use the 'vnc-listen'
# setting in /etc/xen/xend-config.sxp)
vnclisten="0.0.0.0"
# set the VNC display number (default=domid)
vncdisplay=46
# find an unused port for the VNC server (default=1 enabled)
vncunused=1
# spawn vncviewer for domain's console (default=0 disabled)
#vncconsole=0
#------------------------VGA-------------------------------------
# no graphics, only serial (do not enable for Windows guests)
#nographic=0
# stdvga (cirrus logic model, default=0 disabled)
stdvga=0
# start in full screen (default=0 no)
#full-screen=1
#------------------------USB-------------------------------------
# USB support
#(devices may be specified through the monitor window)
#usb=1
# normal/relative mouse
#usbdevice='mouse'
# tablet/absolute mouse
#usbdevice='tablet'
#------------------------MISC------------------------------------
# serial port re-direct to pty device,
# allows xm console or minicom to connect
#serial='pty'
# sound card support (sb16, es1370, all; default none)
#soundhw='sb16'
# set real time clock to local time (default=0 UTC)
localtime=1
下面是Windows系统的:
# -*- mode: python; -*-
arch = os.uname()[4]
if re.search('64', arch):
arch_libdir = 'lib64'
else:
arch_libdir = 'lib'
#----------------------------------------------------------------
# hvmloader in place of a kernel image
kernel = "/usr/lib/xen/boot/hvmloader"
# guest domain build function (for HVM guests we use 'hvm')
builder='hvm'
device_model = '/usr/' + arch_libdir + '/xen/bin/qemu-dm'
# memory allocation at boot in MB
memory = 512
# shadow pagetable memory,
#should be at least 2KB per MB of memory plus a few MB per vcpu
shadow_memory = 8
name = "cs.fv.win" # name for the domain
# number of CPUs guest has available (default=1)
vcpus=2
# HVM guest PAE support (default=0 disabled)
#pae=0
# HVM guest ACPI support (default=0 disabled)
#acpi=0
# HVM guest APIC support (default=0 disabled)
#apic=0
#----------------------------------------------------------------
# 1 NIC, auto-assigned MAC address
vif = [ 'type=ioemu, bridge=eth0' ]
# first device is LVM partition to use as hard disk,
# second device is an image of an installation CD-ROM
#disk = ['phy:/dev/XenGuests/hvm1,hda,w', 'tap:aio:/root/winxp.iso,hdc:cdrom,r']
#disk = ['file:/home/cs/xen/img/win/winxp.img,hda,w', 'file:/mount/vfat/WindowsXP.iso,hdc:cdrom,r']
disk = ['file:/home/cs/xen/img/win/winxp.img,hda,w']
# boot order (a=floppy, c=hard disk, d=CD-ROM; default=cda)
#boot="cda"
boot="cda"
# function to execute when guest wishes to power off
#on_poweroff = 'destroy'
# function to execute when guest wishes to reboot
#on_reboot = 'restart'
# function to execute if guest crashes
#on_crash = 'restart'
#----------------------------------------------------------------
# SDL library support for graphics (default=0 disabled)
sdl=0
# VNC library support for graphics (default=0 disabled)
vnc=1
#------------------------VNC-------------------------------------
# address for VNC server to listen on,
# (default is to use the 'vnc-listen'
# setting in /etc/xen/xend-config.sxp)
vnclisten="0.0.0.0"
# set the VNC display number (default=domid)
vncdisplay=45
# find an unused port for the VNC server (default=1 enabled)
vncunused=1
# spawn vncviewer for domain's console (default=0 disabled)
#vncconsole=0
#------------------------VGA-------------------------------------
# no graphics, only serial (do not enable for Windows guests)
#nographic=0
# stdvga (cirrus logic model, default=0 disabled)
stdvga=0
# start in full screen (default=0 no)
#full-screen=1
#------------------------USB-------------------------------------
# USB support
#(devices may be specified through the monitor window)
usb=1
# normal/relative mouse
#usbdevice='mouse'
# tablet/absolute mouse
usbdevice='tablet'
#------------------------MISC------------------------------------
# serial port re-direct to pty device,
# allows xm console or minicom to connect
#serial='pty'
# sound card support (sb16, es1370, all; default none)
#soundhw='sb16'
# set real time clock to local time (default=0 UTC)
localtime=1
后记:
今天突然发现Debian的鼠标没问题了(VNC方式),配置也没改啊(如下所示),真奇怪。
# -*- mode: python; -*-
arch = os.uname()[4]
if re.search('64', arch):
arch_libdir = 'lib64'
else:
arch_libdir = 'lib'
#----------------------------------------------------------------
# hvmloader in place of a kernel image
kernel = "/usr/lib/xen/boot/hvmloader"
# guest domain build function (for HVM guests we use 'hvm')
builder='hvm'
device_model = '/usr/' + arch_libdir + '/xen/bin/qemu-dm'
# memory allocation at boot in MB
memory = 512
# shadow pagetable memory,
#should be at least 2KB per MB of memory plus a few MB per vcpu
shadow_memory = 8
name = "cs.fv.deb.5-0" # name for the domain
# number of CPUs guest has available (default=1)
vcpus=2
# HVM guest PAE support (default=0 disabled)
#pae=0
# HVM guest ACPI support (default=0 disabled)
#acpi=0
# HVM guest APIC support (default=0 disabled)
#apic=0
#----------------------------------------------------------------
# 1 NIC, auto-assigned MAC address
vif = [ 'type=ioemu, bridge=eth1' ]
#vif = [ 'type=ioemu' ]
# first device is LVM partition to use as hard disk,
# second device is an image of an installation CD-ROM
#disk = ['phy:/dev/XenGuests/hvm1,hda,w', 'tap:aio:/root/winxp.iso,hdc:cdrom,r']
#disk = ['file:/home/cs/xen/img/deb/fv.deb.5.0.img,hda,w', 'file:/home/cs/Desktop/mini.iso,hdc:cdrom,r']
disk = ['file:/home/cs/xen/img/deb/fv.deb.5-0.img,hda,w']
# boot order (a=floppy, c=hard disk, d=CD-ROM; default=cda)
boot="cda"
# function to execute when guest wishes to power off
#on_poweroff = 'destroy'
# function to execute when guest wishes to reboot
#on_reboot = 'restart'
# function to execute if guest crashes
#on_crash = 'restart'
#----------------------------------------------------------------
# SDL library support for graphics (default=0 disabled)
sdl=0
# VNC library support for graphics (default=0 disabled)
vnc=1
#------------------------VNC-------------------------------------
# address for VNC server to listen on,
# (default is to use the 'vnc-listen'
# setting in /etc/xen/xend-config.sxp)
vnclisten="0.0.0.0"
# set the VNC display number (default=domid)
vncdisplay=46
# find an unused port for the VNC server (default=1 enabled)
vncunused=1
# spawn vncviewer for domain's console (default=0 disabled)
#vncconsole=0
#------------------------VGA-------------------------------------
# no graphics, only serial (do not enable for Windows guests)
#nographic=0
# stdvga (cirrus logic model, default=0 disabled)
stdvga=0
# start in full screen (default=0 no)
#full-screen=1
#------------------------USB-------------------------------------
# USB support
#(devices may be specified through the monitor window)
#usb=1
# normal/relative mouse
#usbdevice='mouse'
# tablet/absolute mouse
#usbdevice='tablet'
#------------------------MISC------------------------------------
# serial port re-direct to pty device,
# allows xm console or minicom to connect
#serial='pty'
# sound card support (sb16, es1370, all; default none)
#soundhw='sb16'
# set real time clock to local time (default=0 UTC)
localtime=1
Labels: Linux, Operation and Maintenance
1 Comments:
今天突然发现Debian的鼠标没问题了(VNC方式),配置也没改啊(如下所示),真奇怪。
# -*- mode: python; -*-
arch = os.uname()[4]
if re.search('64', arch):
arch_libdir = 'lib64'
else:
arch_libdir = 'lib'
#----------------------------------------------------------------
# hvmloader in place of a kernel image
kernel = "/usr/lib/xen/boot/hvmloader"
# guest domain build function (for HVM guests we use 'hvm')
builder='hvm'
device_model = '/usr/' + arch_libdir + '/xen/bin/qemu-dm'
# memory allocation at boot in MB
memory = 512
# shadow pagetable memory,
#should be at least 2KB per MB of memory plus a few MB per vcpu
shadow_memory = 8
name = "cs.fv.deb.5-0" # name for the domain
# number of CPUs guest has available (default=1)
vcpus=2
# HVM guest PAE support (default=0 disabled)
#pae=0
# HVM guest ACPI support (default=0 disabled)
#acpi=0
# HVM guest APIC support (default=0 disabled)
#apic=0
#----------------------------------------------------------------
# 1 NIC, auto-assigned MAC address
vif = [ 'type=ioemu, bridge=eth1' ]
#vif = [ 'type=ioemu' ]
# first device is LVM partition to use as hard disk,
# second device is an image of an installation CD-ROM
#disk = ['phy:/dev/XenGuests/hvm1,hda,w', 'tap:aio:/root/winxp.iso,hdc:cdrom,r']
#disk = ['file:/home/cs/xen/img/deb/fv.deb.5.0.img,hda,w', 'file:/home/cs/Desktop/mini.iso,hdc:cdrom,r']
disk = ['file:/home/cs/xen/img/deb/fv.deb.5-0.img,hda,w']
# boot order (a=floppy, c=hard disk, d=CD-ROM; default=cda)
boot="cda"
# function to execute when guest wishes to power off
#on_poweroff = 'destroy'
# function to execute when guest wishes to reboot
#on_reboot = 'restart'
# function to execute if guest crashes
#on_crash = 'restart'
#----------------------------------------------------------------
# SDL library support for graphics (default=0 disabled)
sdl=0
# VNC library support for graphics (default=0 disabled)
vnc=1
#------------------------VNC-------------------------------------
# address for VNC server to listen on,
# (default is to use the 'vnc-listen'
# setting in /etc/xen/xend-config.sxp)
vnclisten="0.0.0.0"
# set the VNC display number (default=domid)
vncdisplay=46
# find an unused port for the VNC server (default=1 enabled)
vncunused=1
# spawn vncviewer for domain's console (default=0 disabled)
#vncconsole=0
#------------------------VGA-------------------------------------
# no graphics, only serial (do not enable for Windows guests)
#nographic=0
# stdvga (cirrus logic model, default=0 disabled)
stdvga=0
# start in full screen (default=0 no)
#full-screen=1
#------------------------USB-------------------------------------
# USB support
#(devices may be specified through the monitor window)
#usb=1
# normal/relative mouse
#usbdevice='mouse'
# tablet/absolute mouse
#usbdevice='tablet'
#------------------------MISC------------------------------------
# serial port re-direct to pty device,
# allows xm console or minicom to connect
#serial='pty'
# sound card support (sb16, es1370, all; default none)
#soundhw='sb16'
# set real time clock to local time (default=0 UTC)
localtime=1
Post a Comment
Subscribe to Post Comments [Atom]
<< Home