I do still have an issue with the custom build, though, in that the camera is locked pointing downwards independent of mouse movement.
Have you tried adding 'no-grab=1' to your openmw.cfg?
I kinda doubt that building on Linux alone will reproduce those things, because I'm on Linux and I couldn't reproduce them either. Can we ask the reporter(s) what version of OSG they are using?
Setting no-grab fixed the 'camera always points straight downwards issue, but now it jumps all over the place and sticks in weird positions. It feels a bit like it's running at single-digit or below-one framerates, but the framerate is reported to range between 30 and a few hundred by F3 and I think it looked like animation was running at that framerate. The cursor moves around the UI properly, too, so it can't even be that the VM is screwing with the mouse.
This is probably not the issue, but what VM are you using? If it's Virtualbox, have you enabled 3d acceleration passthrough? I can't find any documentation on it but should be in the display settings for the VM.
While I don't know the solution to that issue, I would think that a VM is probably a poor testing environment either way. Have you considered running from a Live USB stick with persistance enabled?
It's a bit of a massive nuisance to do that as I'm using the computer with my normal OS on it, and I can't do that at the same time as having another OS running natively. If I were to run it on a laptop I'd have further issues as NVidia Optimus tends to make things break.
So long as it is Nvidia, you should be good to go. Normal setup is that everything runs on the Intel integrated GPU. You then install the bumblebee package and it will pull in deps such as the Nvidia binary blob. You then use optirun or primusrun and the program name: `primusrun openmw` and then openmw will use the nvidia binary blob driver. It has worked liked that for about 6 years now. Super simple to install: `sudo apt install bumblebee` and then run from Ubuntu since 14.04 (Trusty).
I have a Lenovo 430s laptop with Optimus, no problems.
AMD on the other hand, I heard is a no go however. I also do not bother with Nvidia's optimus support in their binary blob. I only use bumblebee and it just works.