bhyve Trying to share a mouse within a bhyve vm using the virtio-input parameter...

Hello.

After 4 months of research,comparaisons,questions here and there,I've been able to watch NowTV on Linux.
An epic victory because SKY does not support this ; they want that we use Windows or Android for ARM on the mobile phones or MacOS. I want to do the same when I use FreeBSD. Unfortunately I still have some problems to fix 'cause some bhyve deficiencies. I've used Android X86 inside a vm.

Istantanea_2024-10-08_13-35-18.jpg


The version of Android that I've used does not support my nVidia GPU maybe because Android needs the drivers (I have the RTX 2080 ti). Point is that my GPU has one USB controller integrated that usually I use to pass inside a VM a mouse and a keyboard and it does not work.

With qemu and virt-manager I solved the problem because they allow to share individual USB devices. I've also installled the Fresco USB 3.0 to PCI controller to a free PCI-e slot,but Android also does not recognize it.

In addition bhyve does not support EHCI or XHCI I think,because even without passing an USB controller,mouse and keyboard don't work on Android.

So,I don't know how to pass a mouse and keyboard to Android through bhyve. Without them,I can't use it and I can't watch Netflix or NowTV.

Someone can suggest something ? Maybe a tecnique,tool to share a mouse between the host (FreeBSD) and the guest (Android).
 
so is that a linux host running virt manager with an android guest

I know,but I do one step at a time. Widevine does not work generally on Android X86. To be able to watch NowTV instead of NetFlix adds a layer of complexity. Another layer of complexity is added by bhyve,that's not flexible as qemu because it does not allow the sharing of the individual USB devices...
 
I'm trying to use the virtio-input parameter in bhyve to share one of my mouses within a Linux vm :

From “man bhyve” (https://www.freebsd.org/cgi/man.cgi...FreeBSD+14.0-CURRENT&arch=default&format=html):

Virtio input device backends:

/dev/input/eventX

Send input events of /dev/input/eventX to guest

by VirtIO Input Interface.

Ok,I tried on my FreeBSD system :

Code:
[marietto@marietto ~]==> sudo libinput debug-events
Password:

-event0   DEVICE_ADDED            System keyboard multiplexer       seat0 default group1  cap:k
-event1   DEVICE_ADDED            System mouse                      seat0 default group2  cap:p left scroll-nat scroll-button
-event2   DEVICE_ADDED            Sleep Button                      seat0 default group3  cap:k
-event3   DEVICE_ADDED            Power Button                      seat0 default group4  cap:k
-event4   DEVICE_ADDED            AT keyboard                       seat0 default group5  cap:k
-event5   DEVICE_ADDED            ITE Tech. Inc. ITE Device(8595), class 0/0, rev 2.00/0.03, addr 8 seat0 default group6  cap:k
-event6   DEVICE_ADDED            SIGMACHIP Trust Keyboard, class 0/0, rev 1.10/1.01, addr 12 seat0 default group7  cap:k
-event7   DEVICE_ADDED            SIGMACHIP Trust Keyboard, class 0/0, rev 1.10/1.01, addr 24 seat0 default group8  cap:k
-event8   DEVICE_ADDED            Logitech USB Optical Mouse, class 0/0, rev 2.00/72.00, addr 25 seat0 default group9  cap:p left scroll-nat scroll-button
-event9   DEVICE_ADDED            vendor 0x04b3 USB Optical Mouse, class 0/0, rev 2.00/2.00, addr 26 seat0 default group10 cap:p left scroll-nat scroll-button
 event9   POINTER_MOTION          +0.176s     -0.30/  0.00 ( -1.00/ +0.00)
 event9   POINTER_MOTION          +0.184s     -1.77/  0.88 ( -2.00/ +1.00)
 event9   POINTER_MOTION          +0.352s     -0.89/  0.00 ( -1.00/ +0.00)
 event9   POINTER_MOTION          +0.360s     -0.89/  0.89 ( -1.00/ +1.00)
 event9   POINTER_MOTION          +0.368s     -2.00/  1.00 ( -2.00/ +1.00)
 event9   POINTER_MOTION          +0.376s     -2.00/  0.00 ( -2.00/ +0.00)
 event9   POINTER_MOTION          +0.384s     -4.13/  2.06 ( -4.00/ +2.00)
 event9   POINTER_MOTION          +0.392s     -4.60/  1.15 ( -4.00/ +1.00)
 event9   POINTER_MOTION          +0.400s     -9.41/  2.69 ( -7.00/ +2.00)
 event9   POINTER_MOTION          +0.408s     -8.97/  2.99 ( -6.00/ +2.00)
 event9   POINTER_MOTION          +0.416s     -8.58/  2.86 ( -6.00/ +2.00)
 event9   POINTER_MOTION          +0.424s     -8.58/  2.86 ( -6.00/ +2.00)
 event9   POINTER_MOTION          +0.432s     -5.21/  2.60 ( -4.00/ +2.00)
 event9   POINTER_MOTION          +0.440s     -2.06/  0.00 ( -2.00/ +0.00)
 event9   POINTER_MOTION          +0.480s      1.93/  0.00 ( +2.00/ +0.00)
 event9   POINTER_MOTION          +0.488s      8.00/ -3.43 ( +7.00/ -3.00)
 event9   POINTER_MOTION          +0.496s     11.25/ -4.82 ( +7.00/ -3.00)
 event9   POINTER_MOTION          +0.504s     11.09/ -3.17 ( +7.00/ -2.00)
 event9   POINTER_MOTION          +0.512s     13.17/ -4.94 ( +8.00/ -3.00)
 event9   POINTER_MOTION          +0.520s     11.39/  0.00 ( +7.00/ +0.00)
 event9   POINTER_MOTION          +0.528s      6.93/  0.00 ( +5.00/ +0.00)
 event9   POINTER_MOTION          +0.536s      6.24/  0.00 ( +5.00/ +0.00)
 event9   POINTER_MOTION          +0.544s      2.14/  0.00 ( +2.00/ +0.00)
 event9   POINTER_MOTION          +0.552s      1.00/  0.00 ( +1.00/ +0.00)
 event9   POINTER_MOTION          +0.576s     -0.95/  0.00 ( -1.00/ +0.00)
 event9   POINTER_MOTION          +0.584s     -2.86/  0.00 ( -3.00/ +0.00)
 event9   POINTER_MOTION          +0.592s     -4.18/  0.00 ( -4.00/ +0.00)
 event9   POINTER_MOTION          +0.600s     -9.21/  0.00 ( -7.00/ +0.00)
 event9   POINTER_MOTION          +0.608s     -8.76/  1.46 ( -6.00/ +1.00)
 event9   POINTER_MOTION          +0.616s     -6.75/  2.70 ( -5.00/ +2.00)
 event9   POINTER_MOTION          +0.624s     -6.41/  1.28 ( -5.00/ +1.00)
 event9   POINTER_MOTION          +0.632s     -3.39/  1.13 ( -3.00/ +1.00)
 event9   POINTER_MOTION          +0.640s     -1.00/  1.00 ( -1.00/ +1.00)
 event9   POINTER_MOTION          +0.696s      0.91/  0.00 ( +1.00/ +0.00)
 event9   POINTER_MOTION          +0.704s      0.91/  0.00 ( +1.00/ +0.00)
-event0   KEYBOARD_KEY            +1.408s    *** (-1) pressed
 event0   KEYBOARD_KEY            +1.560s    *** (-1) pressed

The USB mouse that I want to pass is this :

Code:
-event9   DEVICE_ADDED            vendor 0x04b3 USB Optical Mouse, class 0/0, rev 2.00/2.00, addr 26 seat0 default group10 cap:p left scroll-nat scroll-button

so,between the bhyve parameters I've added ---> "-s 10,virtio-input,/dev/input/event9"

Code:
/usr/sbin/./bhyve-lin -S -c sockets=2,cores=2,threads=2 -m 4G -w -H -A \
-s 0,hostbridge \
-s 1,ahci-hd,/mnt/zroot2/zroot2/bhyve/img/Linux/Ubuntu2410.img,bootindex=1 \
-s 10,virtio-input,/dev/input/event9 \
-s 13,virtio-net,tap1 \
-s 14,virtio-9p,sharename=/ \
-s 29,fbuf,tcp=0.0.0.0:5901,w=1600,h=950,wait \
-s 30,xhci,tablet \
-s 31,lpc \
-l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI_CODE.fd \
vm0:1 < /dev/null & sleep 2 && vncviewer 0:1

unfortunately inside Ubuntu 24.04 the "0x04b3 USB Optical Mouse" does not move at all. What could be missing ?
 
someone correct me if im wrong

but i dont think vnc connections use hardware accelerated video
so playing a video over a vnc connection wont be as good as a more native solution

i know you dont like jails

however if you use a linux jail you can use the wayland socket and get native performance
instead of using vnc

i dont know if you can use a wayland socket from the host to a bhyve guest

also if you use bhyve dont you have to disable your gpu so you can pass it though to the guest
which only works if you have 2 gpu's

if you use a jail you can use the gpu in the jail without disabling it on the host
 
someone correct me if im wrong

but i dont think vnc connections use hardware accelerated video
so playing a video over a vnc connection wont be as good as a more native solution

i know you dont like jails

however if you use a linux jail you can use the wayland socket and get native performance
instead of using vnc

i dont know if you can use a wayland socket from the host to a bhyve guest

also if you use bhyve dont you have to disable your gpu so you can pass it though to the guest
which only works if you have 2 gpu's

if you use a jail you can use the gpu in the jail without disabling it on the host

I'm only evaluating if I can use the virtio-input parameter in bhyve. To make things easy I've decided to use Ubuntu 24.04 as a vm,but the real OS that I need to use is Android X86. So,I should create a jail for Android X86. Do you think it is an easy task ?

Some time ago I found a similar problem,explained here :


This reply :


solved the problem. In this case I don't use Windows 7,but luckily I can install the app called "Remote Desktop" by Microsoft.
 
looks like android-x86 was last updated 2 years ago



they only seem to have iso download which you cant use with a jail

also the latest versions of ubuntu wont run in a jail because of systemd issues
however the latest version of rocky linux works
 
they only seem to have iso download which you cant use with a jail

also the latest versions of ubuntu wont run in a jail because of systemd issues
however the latest version of rocky linux works

Usually an ISO image can be unpacked and the files inside can be managed in the way you want....
We can stop talking about Ubuntu...the OS where I need to enable the movements of the mouse is Android.
 
i extracted an iso and into a jail
but it doesnt work

you cant start up the jail and enter it
doesnt have the right file system layout

not sure if waydroid would let you install and andriod browser


i think waydroid uses a container and i have had issue trying to run containers in a jail
tried flatpak, snap, podman and none worked
 
Back
Top