cursor not working in Ubuntu desktop vm (TrueNAS Core VM)

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Ubuntu Server worked brilliantly. 10 minutes after installing as a Truenas VM, I now have a working pi-hole server.
BTW ... after I learned that Ubuntu LTS covers only the "main" repository and not the "universe" repository and that you need an "Ubuntu Pro" Subscription to get e.g. up to date ImageMagick, I am switching all my private Linux systems to Debian.

I knew that patches for "universe" are supposed to be "best effort" but they do have a patch for ImageMagick and they explicitly serve it to subscription customers only. So much open source, got to love it.

Also will bring this to the next cross-team ("devops") company meeting.

Seriously, Canonical?
 

Yangorang

Cadet
Joined
Sep 17, 2015
Messages
7
Stellar find! Never came up in my Googling. Seeing that this happens with Fedora for one poster in that thread that means my weekend plans just got less involved.


This requires a change in the usb_mouse.c file for bhyve based on the bug thread alephant linked to.
Noob question....but where exactly is this usb_mouse.c file? I can't seem to find this this usr.sbin/bhyve directory.
 

HoneyBadger

actually does care
Administrator
Moderator
iXsystems
Joined
Feb 6, 2014
Messages
5,112
Noob question....but where exactly is this usb_mouse.c file? I can't seem to find this this usr.sbin/bhyve directory.

This is a change that needs to happen in the source code of the bhyve hypervisor.
 

Bikerchris

Patron
Joined
Mar 22, 2020
Messages
210
I'm NOT posting a solution, merely wish to add this is an issue with my multiple TrueNAS instances as well. I thought I would try the ubuntu instance via a terminal, that didn't work either.

In case useful:

Ctrl + Alt + T Gets into the terminal.

Then the usual

sudo apt-get update

and

sudo apt-get upgrade
 

Anoecto

Cadet
Joined
Jan 15, 2024
Messages
2
I manage all of my Linux (actually 100% Ubuntu) VMs with ssh only. For your requirement: doesn't Linux offer some remote desktop protocol similar to RDP that runs in the VM itself instead of relying on some VGA emulation? I remember using X11vnc or some such, but probably there are better solutions today.
I've been experiencing this same issue with TrueNAS-13.0.-U6.1, sine at least v 6.0 using Ubuntu 20.04.6 LTS. I had tried the typical work arounds like changing all VM devices to use VirtIO and CPU counts from even to odd, none of those worked for me. I don't truly need the gui, but I enjoy having it as an option, so I decided to do another search to see what others have been doing and stumbled upon this post and Patrick's reply, I can confirm for me that I was able to install x11vnc and it works great, using TightVNC. Here are the steps I followed: https://tecadmin.net/setup-x11vnc-server-on-ubuntu-linuxmint/ I had to switch to display:1 instead of display:0 I'm thinking it's because VNC is on display:0

This is as far as I'm going with this. I only use my Ubuntu VM to host my Omada Controller and I don't really need gui for that.

Cheers all and thanks for the tip Patrick!
 

lmcore

Cadet
Joined
Sep 5, 2023
Messages
9
Hello, I am experiencing the same problem on debian based linux distros. I tested 4 linux distros, 3 based on debian and one a non-debian. Ubuntu 22, Zorin and XFce. These 3 have the same issue, mouse no functioning (unable to enumerate USB device for USB-Port2). This is the screenshot:
1706382754107.png


I tested one more distro that is called AlmaLinux (I think it is based on Centos) and it works perfectly using the Truenas Core VNC. It works fine. Mouse, keyboard, etc.
I agree with Patrick that console is perfect for most of the tasks.
However, access to the VM using the VNC is too good to lose it. I have a couple of apps that are much easier to manage using the GUI.
I am extremely concerned about the fate of Truenas Core.
The message included in last update from iX says that "Jails, Plugins, VM, etc." are provided on an "as is" basis.
I understand it when they are referring to plugins but the fact, they are including the "jails" in the same list is worrisome.
I infer they will continue neglecting support to Core overtime pushing people to Scale.
BTW a couple of weeks ago I tested installing VMs on the Scale too.
I used the same PC, same distro, same amount of memory, etc.
The VM on Scale was almost unusable on the VM created on Scale.
The equivalent VM worked much faster on Core than on Scale.
This is the reason why I did not move to Scale. I assume Scale environment requires more resources.
I hope the log output above helps to find a solution.
In the meantime, I can say that AlmaLinux works perfectly in a VM in Core.
So, if you need VNC and it is not difficult to migrate your services from one VM to another.
I have an AMD Ryzen 3600, 32GB (MB B450).
Best
 

dilacerated

Dabbler
Joined
Aug 30, 2011
Messages
21
Hello, I am experiencing the same problem on debian based linux distros. I tested 4 linux distros, 3 based on debian and one a non-debian. Ubuntu 22, Zorin and XFce. These 3 have the same issue, mouse no functioning (unable to enumerate USB device for USB-Port2). This is the screenshot:
View attachment 75117

I tested one more distro that is called AlmaLinux (I think it is based on Centos) and it works perfectly using the Truenas Core VNC. It works fine. Mouse, keyboard, etc.
I agree with Patrick that console is perfect for most of the tasks.
However, access to the VM using the VNC is too good to lose it. I have a couple of apps that are much easier to manage using the GUI.
I am extremely concerned about the fate of Truenas Core.
The message included in last update from iX says that "Jails, Plugins, VM, etc." are provided on an "as is" basis.
I understand it when they are referring to plugins but the fact, they are including the "jails" in the same list is worrisome.
I infer they will continue neglecting support to Core overtime pushing people to Scale.
BTW a couple of weeks ago I tested installing VMs on the Scale too.
I used the same PC, same distro, same amount of memory, etc.
The VM on Scale was almost unusable on the VM created on Scale.
The equivalent VM worked much faster on Core than on Scale.
This is the reason why I did not move to Scale. I assume Scale environment requires more resources.
I hope the log output above helps to find a solution.
In the meantime, I can say that AlmaLinux works perfectly in a VM in Core.
So, if you need VNC and it is not difficult to migrate your services from one VM to another.
I have an AMD Ryzen 3600, 32GB (MB B450).
Best
AlmaLinux for now works (it's not based off of CentOS -> it was intended to be a one-to-one RHEL clone). I'd expect it to stop working at some point, though. I'm not up on where things are with AL and IBM lately but the past six months has not been without drama:


Anyhow the same output has been posted in this thread. This is a problem that is not in iX's immediate control. The fix has been made in the bhyve hypervisor (https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=275760) and will likely come in the next Core update/release so for now workarounds like installing a VNC Server or TeamViewer in the VM's are the only solution.
 

lmcore

Cadet
Joined
Sep 5, 2023
Messages
9
AlmaLinux for now works (it's not based off of CentOS -> it was intended to be a one-to-one RHEL clone). I'd expect it to stop working at some point, though. I'm not up on where things are with AL and IBM lately but the past six months has not been without drama:


Anyhow the same output has been posted in this thread. This is a problem that is not in iX's immediate control. The fix has been made in the bhyve hypervisor (https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=275760) and will likely come in the next Core update/release so for now workarounds like installing a VNC Server or TeamViewer in the VM's are the only solution.
Thanks a lot for the information. These are excellent news.
 

treestump

Cadet
Joined
Jan 29, 2024
Messages
1
I am running Debian 12 inside TrueNAS CORE (for the purpose of converting it to DietPi via script and running pihole).

At first I struggled with the EFI boot process which I resolved thusly:

> FS0:
> mkdir EFI\BOOT
> cp EFI\Debian\grubx64.efi EFI\BOOT\boot64.efi
> reset

... and then immediately slammed into this no-mouse issue.

As advised earlier in the thread I worked around this issue by pressing ESC at the bootloader and booting with the previous Linux kernel.
The mouse instantly started working.

Thank you.
 
Joined
Aug 22, 2019
Messages
6
I found a workaround that worked for Pop!/OS 22.04. It's ugly, but it works (sorry if this approach was suggested earlier in the thread and I was too obtuse to figure it out).

Launch the VM from TrueNAS using noVNC in the web browser.
Log in using the keyboard.
Get to a Terminal . For Pop/OS it's the super (windows) key + T.

Type in:
sudo apt-get update

sudo apt-get install x11vnc

x11vnc -storepasswd

Now makeup a password for the VNC, verify it, answer Yes to store it.

If you don't already know the IP address of the VM:

ip a

Now start the service.

x11vnc -usepw

A new VNC server should be running that allows the mouse to work. The port # should be 5900, but it also should be shown on screen in the terminal.

Now install a VNC client app on a machine you want to access the VM from (if you don't already have one). I used VNCViewer by RealVNC.

For VNC Viewer, I just entered the ip address of the VM followed by :5900

I then acknowledged the warning about the unencrypted connection and entered the password I made up above and now I'm connected and can use my mouse.

Minimize the terminal window that is still open in the VM (if you close it, it will kill the connection).

Now there should be a way to get this to run as a service that runs at start-up but I couldn't get that to work (perhaps an Ubuntu VM can do this better than the luck I was having with Pop!_OS). What I do is start the VM, launch the VNC from TrueNAS, log in, get to the terminal window, and then run this:

x11vnc -usepw

You can also just use the arrow up key to pull up the command from the bash history.

Now I can access the VM with a mouse using VNCviewer. I close the noVNC tab in my browser and go about my way. I fully acknowledge there has got to be a better way to do this, but this will get me by (I mainly use this VM for experimentation), until we get a fix.

For reference, here are the sites I used to cobble this together:

 

TN68

Dabbler
Joined
Sep 24, 2022
Messages
31
I just updated TrueNAS and tried a new Ubuntu download but it seems the missing-mouse bug remains. Are there expected timeframes or official updates regarding this?

Off topic... but I'm hitting road blocks on every VM approach I'm testing.
- Debian: VNC screen doesn't function so I can't get pass initial boot.
- Ubuntu: Missing mouse
- Win10: Rebooting from within the VM (eg. Updates) fails (I do have the "wait until VNC connects" option checked.
 

ere109

Contributor
Joined
Aug 22, 2017
Messages
190
Just ran into the same issue after updating to 13.0-U5.2 - searching for "usb_mouse.c" to implement fix. Found it at:
Code:
/iocage/releases/13.2-RELEASE/root/usr/src/usr.sbin/bhyve

Manually updating .bMaxPacketSize to 9.
Code:
diff --git a/usr.sbin/bhyve/usb_mouse.c b/usr.sbin/bhyve/usb_mouse.c
index 80f79980a98e..ffc744c9119f 100644
--- a/usr.sbin/bhyve/usb_mouse.c
+++ b/usr.sbin/bhyve/usb_mouse.c
@@ -154,7 +154,7 @@ static struct usb_device_descriptor umouse_dev_desc = {
     .bLength = sizeof(umouse_dev_desc),
     .bDescriptorType = UDESC_DEVICE,
     MSETW(.bcdUSB, UD_USB_3_0),
-    .bMaxPacketSize = 8,            /* max packet size */
+    .bMaxPacketSize = 9,            /* max packet size, 2^9 = 512 */
     MSETW(.idVendor, 0xFB5D),        /* vendor */
     MSETW(.idProduct, 0x0001),        /* product */
     MSETW(.bcdDevice, 0),            /* device version */
 
Last edited:

TN68

Dabbler
Joined
Sep 24, 2022
Messages
31
@ere109 ,
I'm on 13.0-U6.1. When I get to /src/ (on both releases in the system), the directory is blank. I should be showing hidden files if that matters. Am I going down the wrong file path? I do see a bhyve file under /root/usr/sbin/ but that file doesn't seem to have the packet size setting you modified.

1709078808133.png
 

ere109

Contributor
Joined
Aug 22, 2017
Messages
190
@ere109 ,
I'm on 13.0-U6.1. When I get to /src/ (on both releases in the system), the directory is blank. I should be showing hidden files if that matters. Am I going down the wrong file path? I do see a bhyve file under /root/usr/sbin/ but that file doesn't seem to have the packet size setting you modified.

View attachment 76093

I found it in the Iocage directory - not the main root - where your jails install (although I should check if it's also in the VM directory). Note that there's a RELEASE folder that contains every version of BSD your system has used. You'll have to go in and manually edit every version since release 13, if I'm reading things correctly.
Also note, of the two I've updated, so far, it hasn't solved my mouse issue. Running a "find" command tonight to look for other instances of usb_mouse.c
 
Last edited:

sfintel

Cadet
Joined
Oct 2, 2019
Messages
1
It's in the Iocage directory - not the main root - where your jails install (although I should check if it's also in the VM directory). Note that there's a RELEASE folder that contains every version of BSD your system has used. You'll have to go in and manually edit every version since release 13, if I'm reading things correctly.
Pardon my ignorance, but isn't Iocage for jails? The issue I'm seeing is in VNC of a Linux VM, not a FreeBSD jail.
 

TN68

Dabbler
Joined
Sep 24, 2022
Messages
31
@ere109
I searched the entire file system for the usb_mouse.c file using winSCP and came up short, and not finding a bhyve directory either. Thanks for the extra note that it hadn't resolved the issue, I was assuming it had fixed it for you.

I know this was stated above, so I wasn't expecting to be able to fix it.
"This is a change that needs to happen in the source code of the bhyve hypervisor."
 
Last edited:

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
"This is a change that needs to happen in the source code of the bhyve hypervisor."
The source code is not on your TrueNAS system. The source code to TrueNAS CORE starts here and the source code to FreeBSD and bhyve here.
 

TN68

Dabbler
Joined
Sep 24, 2022
Messages
31
The source code is not on your TrueNAS system. The source code to TrueNAS CORE starts here and the source code to FreeBSD and bhyve here.

I see line 157 at the URL below has the packet size fixed to 9 here... is there a way to get this onto my machine or a timeline that it will make it into a Stable Core update? It seems painful for an "easy" fix to feel so far out of reach.

 
Last edited:

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
TrueNAS CORE 13.1 (exact version number might still change) due in April will be based on FreeBSD 13.3 and have these changes.

if you are bold you might want to try a TrueNAS CORE nightly release from here.
 

ere109

Contributor
Joined
Aug 22, 2017
Messages
190
Circling back around, I did read about the "patch" command, which appears to be able to apply a diff file. Above my paygrade, but interesting reading:
 
Top