Troubleshooting Wrong Mouse Movements when Virtualizing FreeBSD on Windows 11 with qemu-kvm

Abstract: Resolve jerky or inverted mouse cursor behavior in FreeBSD VMs on Windows 11 QEMU by adding the usb-tablet device and ensuring the ums driver is active.

Created: 2026-10-05 by

Fix incorrect mouse movements in FreeBSD on Windows 11 QEMU by ensuring the usb-tablet device is correctly added to your VM configuration and that the guest OS properly loads the ums (USB Mouse) driver. This issue typically stems from missing absolute coordinate reporting or improper driver initialization, which can be resolved through specific command-line flags and kernel module adjustments.

Understanding the Root Cause

When virtualizing FreeBSD using QEMU-KVM, the default mouse emulation often relies on relative coordinate movement. This works well for simple pointer tracking but fails when applications expect absolute positioning, leading to jerky, inverted, or overly sensitive cursor behavior. The core problem is usually that the virtual machine does not receive absolute mouse coordinates from the host system. QEMU provides a specialized device called usb-tablet designed specifically to solve this. Unlike standard PS/2 mice which send relative deltas, an USB tablet device reports the exact X and Y coordinates of the cursor within the window. Without this device, FreeBSD falls back to less accurate emulation methods. Additionally, modern FreeBSD versions have deprecated older input drivers, making it crucial to use the correct kernel modules.

Configuring QEMU for Absolute Positioning

The most effective fix involves modifying the QEMU launch command or your virtualization manager’s XML definition to include the USB tablet device. This ensures the hypervisor sends precise coordinate data to the guest operating system. If you are launching QEMU directly from the command line, add the following argument to your startup script:
-device usb-tablet
This flag tells QEMU to create a virtual USB tablet device attached to the virtual USB bus. It should be placed alongside other device definitions such as -device virtio-net-pci or -drive file=freebsd.img,format=qcow2. For example, a typical corrected command might look like this:
qemu-system-x86_64 \
    -enable-kvm \
    -m 4096 \
    -cpu host \
    -drive file=freebsd.qcow2,format=qcow2 \
    -device usb-tablet \
    -netdev user,id=net0 \
    -device virtio-net-pci,netdev=net0
If you are using libvirt (virsh), you must edit the domain XML. Locate the <devices> section and ensure there is a <input type="tablet" bus="usb"/> element. If it is missing, add it. Do not remove existing input devices unless you are certain they are conflicting; simply adding the tablet is usually sufficient. For users managing multiple VMs, consistency is key. Ensure every FreeBSD guest has this device enabled. You can verify the current configuration by checking the running state of the VM or inspecting the XML definition with virsh dumpxml <vm-name>.

Why Not Remove Existing Mouse Devices?

A common mistake is attempting to remove the default PS/2 mouse to "force" the use of the USB tablet. This approach is risky because some older FreeBSD installations or specific console environments may rely on the PS/2 interface for basic functionality. Removing it without ensuring the USB stack is fully initialized can lead to a frozen input subsystem. Instead, keep the default mouse and add the tablet. The FreeBSD kernel will prioritize the tablet for absolute positioning tasks while keeping the PS/2 mouse as a fallback for compatibility.

FreeBSD Guest Configuration

Once the host side is configured, you must ensure the FreeBSD guest recognizes and utilizes the USB tablet. Modern FreeBSD releases handle this largely automatically, but manual verification ensures stability. First, check if the ums (USB Mouse) module is loaded. You can do this by running:
kldload ums
If the module is already loaded, you can verify its status with kldstat | grep ums. The presence of ums indicates that the system is ready to process USB mouse events. Note that older guides might suggest loading psm (PS/2 Mouse) or using obsolete packages like xf86-input-synaptics. These are incorrect for this context. The psm module handles PS/2 interfaces, which do not provide absolute coordinates. The xf86-input-synaptics package is for touchpad drivers in Xorg and is irrelevant for a virtual USB tablet. To make the ums module load at boot, add the following line to /etc/rc.conf:
kld_list="ums"
This ensures that every time the system starts, the USB mouse driver is active before the desktop environment initializes. After updating rc.conf, restart the VM or manually load the module to apply changes immediately.

Verifying the Fix

After applying these changes, restart the FreeBSD VM. Upon login, test the mouse movement in different applications. The cursor should now move smoothly and accurately reflect your physical mouse movements, especially in full-screen mode or when using applications that require precise targeting. If issues persist, check the QEMU logs for any USB-related errors. You can also try switching the USB controller type in your VM settings from ich9-ehci1 to qemu-xhci if available, as newer controllers sometimes offer better compatibility with USB tablets. For related networking issues that might accompany virtualization setup, see our guide on Troubleshooting: No Internet on QEMU VM despite Connection Present. Similarly, if you encounter display artifacts after fixing the mouse, consult Prevent Mouse Hidden in Ubuntu while Running KVM/QEMU Guest for broader input troubleshooting techniques.

Frequently Asked Questions

Does removing the default PS/2 mouse improve performance?

No, removing the PS/2 mouse does not improve performance and may break basic input functionality. The usb-tablet device works best when added alongside existing input devices rather than replacing them. Keeping both ensures maximum compatibility across different FreeBSD versions and applications.

What if my FreeBSD version is very old?

Older FreeBSD versions may not support the ums module by default. In such cases, you may need to compile custom kernel options or upgrade the guest OS. However, for most modern systems, the ums module is built-in and requires only loading via rc.conf.

Can I use a different USB controller instead of the tablet?

While you can change the USB controller type (e.g., to xHCI), this does not replace the need for the usb-tablet device. The controller manages hardware communication, while the tablet device defines the input protocol. Both are necessary for optimal accuracy.

Why does the mouse still feel jittery after adding the tablet?

Jitteriness can result from high polling rates or conflicting software filters. Try disabling mouse acceleration in the FreeBSD desktop environment settings. Additionally, ensure no other virtualization software is capturing the mouse cursor simultaneously on the host system.

Is this fix applicable to Linux guests as well?

Yes, the usb-tablet device is standard for KVM/QEMU guests across all major operating systems, including Linux and Windows. The guest-side configuration differs slightly, but the host-side QEMU flag remains the same universal solution for absolute positioning.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More