Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] qemu - mouse/keyboard not working
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
eleanor
l33t
l33t


Joined: 01 Nov 2004
Posts: 666

PostPosted: Sun Oct 20, 2013 9:53 pm    Post subject: [SOLVED] qemu - mouse/keyboard not working Reply with quote

Hi,

I compiled KVM support into my kernel and installed qemu and virt-manager. When creating VM in virt-manager I'm able to start it, which looks like this (it's also very slow):

http://shrani.si/f/v/wb/3cjyZPfY/qemu2.png

Sometimes only this is displayed:

http://shrani.si/f/38/WW/3RGKaFBc/qemu3.png

After that when the VM grabs my mouse, I cannot use mouse or keyboard; they just don't work. They work only if I make a change, close the window, reopen the window, which is a nightmare, because they don't work in real-time.

I'm not sure what's wrong but I sure do need help. Let me also present the used USE flags:

Quote:

# equery uses app-emulation/virt-manager
- - debug : Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see
+ + gnome-keyring : Enable support for storing passwords via gnome-keyring
- - policykit : Enables sys-auth/polkit authentication support, required when using app-emulation/libvirt with PolicyKit authentication
- - python_single_target_python2_6 : Build for Python 2.6 only
+ + python_single_target_python2_7 : Build for Python 2.7 only
- - python_targets_python2_6 : Build with Python 2.6
+ + python_targets_python2_7 : Build with Python 2.7
- - sasl : Depend on the proper libraries needed to connect to SASL-enabled libvirtd instances (e.g. Kerberos-protected instances).




Quote:

# equery uses qemu
- - accessibility : Adds support for braille displays using brltty
+ + aio : Enables support for Linux's Async IO
+ + alsa : Enable alsa output for sound emulation
- - bluetooth : Enable Bluetooth Support
+ + caps : Use Linux capabilities library to control privilege
+ + curl : Support ISOs / -cdrom directives vis HTTP or HTTPS.
- - debug : Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see
http://www.gentoo.org/proj/en/qa/backtraces.xml
- - fdt : Enables firmware device tree support
+ + filecaps : Use Linux file capabilities to control privilege rather than set*id
+ + gtk : Add support for x11-libs/gtk+ (The GIMP Toolkit)
- - iscsi : Enable direct iSCSI support via net-libs/libiscsi instead of indirectly via the Linux block layer that sys-block/open-iscsi does.
+ + jpeg : Enable jpeg image support for the VNC console server
- - mixemu : Enable audio mixer emulation. On Fedora, known to cause performance problems when using SDL output and ALSA. For OSS, locks the sound device from other applications.
+ + ncurses : Enable the ncurses-based console
- - opengl : Add support for OpenGL (3D graphics)
+ + png : Enable png image support for the VNC console server
+ + pulseaudio : Enable pulseaudio output for sound emulation
+ + python : Add optional support/bindings for the Python language
- - python_targets_python2_6 : Build with Python 2.6
+ + python_targets_python2_7 : Build with Python 2.7
- - qemu_softmmu_targets_alpha : system emulation target
- - qemu_softmmu_targets_arm : system emulation target
- - qemu_softmmu_targets_cris : system emulation target
+ + qemu_softmmu_targets_i386 : system emulation target
- - qemu_softmmu_targets_lm32 : LatticeMico32 system emulation target
- - qemu_softmmu_targets_m68k : system emulation target
- - qemu_softmmu_targets_microblaze : system emulation target
- - qemu_softmmu_targets_microblazeel : system emulation target
- - qemu_softmmu_targets_mips : system emulation target
- - qemu_softmmu_targets_mips64 : system emulation target
- - qemu_softmmu_targets_mips64el : system emulation target
- - qemu_softmmu_targets_mipsel : system emulation target
- - qemu_softmmu_targets_moxie : moxielogic system emulation target
- - qemu_softmmu_targets_or32 : OpenRISC system emulation target
+ + qemu_softmmu_targets_ppc : system emulation target
+ + qemu_softmmu_targets_ppc64 : system emulation target
- - qemu_softmmu_targets_ppcemb : system emulation target [81/351]
- - qemu_softmmu_targets_s390x : system emulation target
- - qemu_softmmu_targets_sh4 : system emulation target
- - qemu_softmmu_targets_sh4eb : system emulation target
- - qemu_softmmu_targets_sparc : system emulation target
- - qemu_softmmu_targets_sparc64 : system emulation target
- - qemu_softmmu_targets_unicore32 : system emulation target
+ + qemu_softmmu_targets_x86_64 : system emulation target
- - qemu_softmmu_targets_xtensa : system emulation target
- - qemu_softmmu_targets_xtensaeb : system emulation target
- - qemu_user_targets_alpha : userspace emulation target
+ + qemu_user_targets_arm : userspace emulation target
- - qemu_user_targets_armeb : userspace emulation target
- - qemu_user_targets_cris : userspace emulation target
+ + qemu_user_targets_i386 : userspace emulation target
- - qemu_user_targets_m68k : userspace emulation target
- - qemu_user_targets_microblaze : userspace emulation target
- - qemu_user_targets_microblazeel : userspace emulation target
- - qemu_user_targets_mips : userspace emulation target
- - qemu_user_targets_mips64 : userspace emulation target
- - qemu_user_targets_mips64el : userspace emulation target
- - qemu_user_targets_mipsel : userspace emulation target
- - qemu_user_targets_mipsn32 : MIPS N32 ABI userspace emulation target
- - qemu_user_targets_mipsn32el : MIPS N32 ABI LE userspace emulation target
- - qemu_user_targets_or32 : OpenRISC userspace emulation target
- - qemu_user_targets_ppc : userspace emulation target
- - qemu_user_targets_ppc64 : userspace emulation target
- - qemu_user_targets_ppc64abi32 : userspace emulation target
- - qemu_user_targets_s390x : userspace emulation target
- - qemu_user_targets_sh4 : userspace emulation target
- - qemu_user_targets_sh4eb : userspace emulation target
- - qemu_user_targets_sparc : userspace emulation target
- - qemu_user_targets_sparc32plus : userspace emulation target
- - qemu_user_targets_sparc64 : userspace emulation target
- - qemu_user_targets_unicore32 : userspace emulation target
+ + qemu_user_targets_x86_64 : userspace emulation target
- - rbd : Enable rados block device backend support, see http://ceph.newdream.net/wiki/QEMU-RBD
- - sasl : Add support for the Simple Authentication and Security Layer
- - sdl : Enable the SDL-based console
+ + seccomp : Utilize sys-libs/libseccomp to enable kernel filtering of system calls to prevent malicious guests from doing damage.
- - smartcard : Enable smartcard support
+ + spice : Enable Spice protocol support via app-emulation/spice
- - static : Enables both 'static-softmmu' and 'static-user'
- - static-softmmu : Builds the Software MMU (system) targets as static binaries
- - static-user : Build the User targets as static binaries
- - systemtap : Enable SystemTAP/DTrace tracing
- - tci : Enable the TCG Interpreter which can speed up or slowdown workloads depending on the host and guest CPUs being emulated. In the future it
will be a runtime option but for now its compile time.
- - test : Workaround to pull in packages needed to run with FEATURES=test. Portage-2.1.2 handles this internally, so don't set it in
make.conf/package.use anymore
+ + threads : Add threads support for various packages. Usually pthreads
- - tls : Enable TLS support for the VNC console server. For 1.4 and newer this also enables WebSocket support.
- - usbredir : Use sys-apps/usbredir to redirect USB devices to another machine over TCP
+ + uuid : Enable UUID support in the vdi block driver
- - vde : Enable VDE-based networking
+ + vhost-net : Enable accelerated networking using vhost-net, see http://www.linux-kvm.org/page/VhostNet
- - virtfs : Enable VirtFS via virtio-9p-pci / fsdev. See http://wiki.qemu.org/Documentation/9psetup
+ + vnc : Enable VNC (remote desktop viewer) support
+ + xattr : Add support for getting and setting POSIX extended attributes, through sys-apps/attr. Requisite for the virtfs backend.
- - xen : Enables support for Xen backends
+ + xfs : Support xfsctl() notification and syncing for XFS backed virtual disks.



I aslo have to mention that I'm running hardened gentoo.

I appreciate any ideas.

Thank you


Last edited by eleanor on Tue Oct 22, 2013 7:21 pm; edited 1 time in total
Back to top
View user's profile Send private message
eccerr0r
Advocate
Advocate


Joined: 01 Jul 2004
Posts: 4601
Location: USA

PostPosted: Sun Oct 20, 2013 11:29 pm    Post subject: Reply with quote

I thought virt-manager put in a warning... hitting control and alt at the same time (without any other button) will release the focus of the window. Is this the problem you were having?

I think the control-alt thing is fairly common in a lot of virtual machines and emulators.

I found that my virtual machines with QEMU/KVM are faster than half native speed. However disk i/o is awful and I haven't figured out why (it may be bad interaction with the RAID I'm running on).
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed to be advocating?
Back to top
View user's profile Send private message
eleanor
l33t
l33t


Joined: 01 Nov 2004
Posts: 666

PostPosted: Mon Oct 21, 2013 6:49 am    Post subject: Reply with quote

Hi,

I don't have the problem of virt-manager not releasing the focus: I know I can release it with ctrl+alt. The problem is that after grabbing the focus, I cannot use mouse+keyboard in a guest VM not the host. The mouse/keyboard only work if the VM grabs focus, then I press the key, then I close the VM window and reopen it (only after that the keyboard press was detected).


I believe the problem is the display of the VM not being updated. This would mean the the following settings are wrong:

http://shrani.si/f/35/FS/3BRRwhj2/qemu4.png

http://shrani.si/f/2R/Kq/uMUuNky/qemu5.png

There is a service running on port 5900, so the connection occurs, but I still don't think it's actually working.

Quote:

tcp 0 0 127.0.0.1:5900 0.0.0.0:* LISTEN 5489/qemu-system-x8


It is as the screen was not updated to display the change in mouse arrow or press of a button. What can cause this?
Back to top
View user's profile Send private message
eccerr0r
Advocate
Advocate


Joined: 01 Jul 2004
Posts: 4601
Location: USA

PostPosted: Mon Oct 21, 2013 4:06 pm    Post subject: Reply with quote

Hmm, then I've never seen this problem you're having, it seemed to have worked fine out of the box - granted I was using VNC at first instead of SPICE.

But SPICE works fine too.

What are your use flags for qemu, libvirt, and virt-manager? Did you try re-emerging all of them?

Tried VNC instead of SPICE?

(bleah, I hate SPICE, wish they chose another name for it... name conflicts with this other piece of software that I'm more familiar with...)
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed to be advocating?
Back to top
View user's profile Send private message
eleanor
l33t
l33t


Joined: 01 Nov 2004
Posts: 666

PostPosted: Tue Oct 22, 2013 7:20 pm    Post subject: Reply with quote

The following solved it:

Code:

# paxctl-ng -m /usr/bin/qemu-system-x86_64


After that I can run and interact with VMs normally.
Back to top
View user's profile Send private message
dyatel15
n00b
n00b


Joined: 14 Mar 2006
Posts: 20

PostPosted: Sat Oct 26, 2013 3:25 am    Post subject: Reply with quote

eleanor wrote:
The following solved it:

Code:

# paxctl-ng -m /usr/bin/qemu-system-x86_64


After that I can run and interact with VMs normally.


That helped me too. Thank you!

But I found a better way fixing it, it's in RH faq:
http://www.linux-kvm.org/page/FAQ#When_I_click_the_guest_operating_system_window.2C_mouse_is_grabbed._How_can_I_get_mouse_to_not_to_do_that.3F_OR_Mouse_doesn.27t_show_up_.2F_doesn.27t_work_in_the_guest._What_do_I_do.3F

"-usb -usbdevice tablet"
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum