Bug 270883 - Enable mouse on Hyper-V 2022 Gen2 VM
Summary: Enable mouse on Hyper-V 2022 Gen2 VM
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: usb (show other bugs)
Version: 13.2-RELEASE
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-usb (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-04-16 18:51 UTC by ovidiup@microsoft.com
Modified: 2023-08-27 19:14 UTC (History)
4 users (show)

See Also:


Attachments
FreeBSD 13.2 Rc. conf content and XFCE printscreen (632.81 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2023-04-16 18:51 UTC, ovidiup@microsoft.com
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description ovidiup@microsoft.com 2023-04-16 18:51:17 UTC
Created attachment 241532 [details]
FreeBSD 13.2 Rc. conf content and XFCE printscreen

Hi,

Mouse does not work on FreeBSD 13.2 Hyper-V 2022 Gen 2 VM
FeeBSD 13.2 ISO downloaded from website.
XFCE installed in the VM. Content of rc.conf is in the file attached.

Please help on how to enable mouse to work inside the virtual machine - Hyper-V 2022 Gen2 VM.

Thank you,
Ovidiu Pismac
Comment 1 fgorter 2023-04-18 08:53:20 UTC
It would be very helpful if you attach your rc.conf file as a plain text file instead of a <filename>.docx document. Screenshots usually do not help very much ;)

Why are you using both GDM & SLiM at the same time? You only need one Display Manager to run at a time, *NOT* both.
Is your mouse device connected via USB? No need to invoke moused_enable in that case.
You are using XFCE4, yet have Gnome services enabled too. Try eliminating some things first; which may be causing runtime conflicts.

Remove: 
moused_enable (if using USB mouse)
gnome_enable
hald_enable
gdm_enable

To see if you can gain any mouse functionality.
Comment 2 ovidiup@microsoft.com 2023-04-18 18:53:36 UTC
Hi,

Thank you very much for prompt answer and help.
I have removed the 4 lines and behavior is the same after poweroff and power on of the virtual machine.

Content of /etc/rc.conf file is below

hostname="freebsd132.virt.local"
ifconfig_hn0="DHCP"
sshd_enable="YES"
ntpdate_enable="YES"
ntpd_enable="YES"
dumpdev="AUTO"
zfs_enable="YES"
dbus_enable="YES"
slim_enable="YES"

Thank you for any advice,
Ovidiu Pismac
Comment 3 fgorter 2023-04-18 23:25:34 UTC
Same behavior is not entirely unexpected, to be honest.

Just-in-case, what happens if you remove dbus_enable from rc.conf as well?

I've experienced something roughly similar some years ago with some recently released (2014/2015) Xeon CPUs. Executing a normal reboot from console (on bare metal), would lead to the machine to shutdown normally (somewhat...) but not actually boot after BIOS POST. It required a hard reset -- press and hold power button -- to start correctly again.

Recalling from memory, I believe a switch in /boot/device.hints was required. I forget exactly which, but I think it was to one of the hint.atrtc* knobs, to deal with some (unclean) ACPI state quirks.

What is the make/model of your hardware? Motherboard / CPU combo.

If this is a AMD Ryzen based system, not that "hw.vmm.amdvi.enable=1" should probably be present in /boot/loader.conf -- default FreeBSD install ships with this knob disabled. With it disabled does allow a normal install, but with some more advanced features switched off.

Please also double check the system BIOS for any USB-specific (legacy) switches.
Comment 4 ovidiup@microsoft.com 2023-04-19 06:24:04 UTC
Hi,

Thank you for the reply.
Without dbus_enable - machine does not start XFCE GUI Intrface.

I have VM's on Windows Server 2022 Hyper-V (latest updates) on physical machine HP Proliant DL360p Gen 8 - processors Xeon E5-2650 @2 Ghz 8 cores.

Thank you,
Ovidiu
Comment 5 fgorter 2023-05-06 10:41:23 UTC
(In reply to ovidiup@microsoft.com from comment #4)

I came across something (by chance) while looking for some more information about the sysctl switches to kern.evdev.rcpt_mask modes...

Have a look at https://reviews.freebsd.org/D24370

"EVDEV_RCPT_KBDMUX bit in evdev_rcpt_mask will make it silent.
It also applicable to Hyper-V Gen 2 keyboards enabled by default in i386|amd64/conf/GENERIC kernel configs."

Now, this is obviously for the keyboard, rather than the mouse & for powerpc32 hardware, rather than x86/amd64 -- but it may offer a hint why you might be having trouble with your mouse. Perhaps there is something peculiar about HP Proliant hardware interfacing with certain VMs.

In any case, you may want to try doing some sysctl switches to kern.evdev.rcpt_mask yourself. Old default was kern.evdev.rcpt_mask=3 if I am not mistaken & kern.evdev.rcpt_mask=6 or kern.evdev.rcpt_mask=12 are more modern standards.

The pkg info to xorg-server offers some clues that may give a hint -- it is in regards to more advanced features of mice, but perhaps helpful; particularly when moused & sysmouse are present / not present.
Double check if libinput & evdev related packages are installed as well.
Check to see what "sysctl -a | grep -i evdev" output says.

Example: On one of my laptops (with custom kernel), if I do not have libinput installed, the mouse/touchpad will not work (pointer does not even show up) & I need kern.evdev.rcpt_mask=6 to gain full functionality.
Comment 6 Vladimir Kondratyev freebsd_committer freebsd_triage 2023-08-27 19:14:06 UTC
FreeBSD 13.2 does not support Hyper-V Gen 2 VM mice. Support for it was MFC-ed shortly after 13.2-RELEASE had been released. 13-STABLE should work.