noVNC and bhyve --> blues are orange & oranges are blue

204 views
Skip to first unread message

Justin England

unread,
Jul 20, 2023, 3:55:36 AM7/20/23
to noVNC
Sorry for the long post, but I have a strange issue that I can seem to figure out, and I don't know if it's noVNC related or bhyve related.

I have recently installed TrueNAS Core, FreeBSD-13.1 based, and using it's built in bhyve VM manager, I created a Windows 10 VM.  I clicked on its "VNC" button and realized that it was using a browser based VNC client and after a few minutes of poking around, I found it was using noVNC as it's VNC client.  Spending a short amount of time using the noVNC client, I liked how it just worked and immediately wanted to use it on my development VMs that are all running on native FreeBSD using vm-bhyve to manage them.

So I installed the novnc-1.4.0 and py39-websockify-0.10.0_1 packages on my FreeBSD dev machine and immediately setup websockify to listen @ 8900 and connect to localhost at 5900 where bhyve's VNC is listening for my windows VM where I would connect to http://freebsd:8900/vnc.html.

But here is my issue, when using this setup on my FreeBSD dev machine, the windows VM's colors are not accurate, hence, the title of this post.

Using websockify, I have tried every permutation between my FreeBSD machine and my TrueNAS machine and it seems that the only thing that works is when noVNC is connecting to TrueNAS' bhyve VMs.  I even copied bhyve binaries from TrueNAS to FreeBSD to no avail.  And looking through the TrueNAS xml config file, there doesn't seem to be any bhyve settings that would change how the VNC sever works.

Which brings me here... every other VNC client I use to connect to FreeBSD:5900 works perfectly w.r.t. the colors.  But there is nothing that I have found yet that will allow me to use websockify and novnc to connect to my bhyve VMs where the colors are properly displayed.

Again, I don't know if this is a noVNC / websockify issue or a bhyve issue and I don't know where to look next.

And to make sure it was OS neutral, I created Ubuntu VMs with the same results.. Locking at the attached image, the left image is the correct colors from TrueNAS , the right is from FreeBSD with incorrect colors.

Any pointers to where I should look next?

Thanks,
Justin

novnc.png

Pierre Ossman

unread,
Jul 21, 2023, 6:58:51 AM7/21/23
to no...@googlegroups.com, Justin England
On 7/20/23 09:55, Justin England wrote:
>
> Any pointers to where I should look next?
>

This is a fairly common bug and has to do with the order of colors in a
pixel. Some systems do RGB, some do BGR.

For some odd reason, browsers use a different order than most hardware.
And hence, noVNC uses a different order than most native VNC viewers
(which will interact more directly with the hardware).

So that would explain you only seeing it in noVNC.

However, I still think the bug is in your VNC server. noVNC always
requests the same color order, and it is the responsibility of the
server to respect that request.

I would guess that the server has a bug where the request gets ignored,
and it always uses a fixed order. An order that happens to work on most
clients, but not noVNC.

Do you know which VNC server they have integrated in that? You'll need
to file a bug report with them, and hopefully, they can take a look.

Regards
--
Pierre Ossman Software Development
Cendio AB https://cendio.com
Teknikringen 8 https://twitter.com/ThinLinc
583 30 Linköping https://facebook.com/ThinLinc
Phone: +46-13-214600

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

Justin England

unread,
Jul 21, 2023, 11:38:00 PM7/21/23
to noVNC
On Friday, July 21, 2023 at 3:58:51 AM UTC-7  wrote:

Do you know which VNC server they have integrated in that? You'll need
to file a bug report with them, and hopefully, they can take a look.
 

Well... here's my dilemma, TrueNAS (based off FreeBSD) and FreeBSD both use bhyve as the hypervisor, therefore it's going to be the same embedded VNC server.  I even went so far as copied the bhyve binary from TrueNAS (FreeBSD-13) to my FreeBSD-13 dev machine with the same results.  I then tar'd up the novnc install on TrueNAS and copied it over to my FreeBSD machine, again, with the same results.

I was hoping that there might have been a hidden config setting in noVNC, but that seems to not be the case.  I'll have to dig into the bhyve side of things and see what I am missing between the way TrueNAS launches bhyve vs how vm-bhyve launches bhyve.  I've looked at TrueNAS's xml config file that defines how the VM is launched and couldn't find anything that would make a difference, so I must be missing something somewhere in TrueNAS that makes it work.

Thanks for the input as it narrows the scope of where to look next.

Thanks,
Justin
Reply all
Reply to author
Forward
0 new messages