Add support to devel/libhyve-remote. (VNC Server)
Needs RevisionPublic

Authored by araujo on Jul 28 2017, 4:14 AM.


Group Reviewers

The libhyve-remote aims to abstract functionalities from other third party libraries such like libvncserver, freerdp and spice to be used in hypervisor implementation. With a basic data structure it is easy to implement any remote desktop protocol without dig into the protocol specification or third part libraries, you can check some of our examples.

We don't static link any third party library, instead we use dynamic linker and we load only functionalities that we believe is necessary to launch the service.

Our target is to abstract functionalities from libvncserver, freerdp and spice. Right now libhyve-remote only supports libvncserver. It is possible to launch a vnc server with different screen resolution as well as with authentication.

With this patch we implement support to bhyve use libhyve-remote that basically abstract some functionalities from libvncserver.
We can:

  • Enable wait state.
  • Enable authentication.
  • Enable different resolutions.
  • Have a better compression.

Also we add a new flag to be called with -s that is vncserver, if the libhyve-remote library is not present in the system we fallback to bhyve RFB implementation, ex.:
-s 2,fbuf,tcp=,w=800,h=600,password=1234567,vncserver,wait

Test Plan

Tested with (guests):

  • Windows10.
  • Fedora Workstation.
  • FreeBSD12.

Tested with VNC (clients):

  • RealVNC.
  • net/tigervnc.
  • net/tightvnc.

Diff Detail

rS FreeBSD src repository
Lint OK
No Unit Test Coverage
Build Status
Buildable 10737
Build 11134: arc lint + arc unit
araujo created this revision.Jul 28 2017, 4:14 AM
araujo edited the summary of this revision. (Show Details)Jul 28 2017, 4:21 AM
araujo edited the test plan for this revision. (Show Details)
araujo added reviewers: grehan, tychon, jhb.
araujo updated this revision to Diff 31296.Jul 28 2017, 4:35 AM
araujo edited the test plan for this revision. (Show Details)

Update manpage.

araujo retitled this revision from Add support to devel/libhyve-remote. to Add support to devel/libhyve-remote. (VNC Server).Jul 28 2017, 4:36 AM
gnn accepted this revision.Jul 28 2017, 8:38 AM
This revision is now accepted and ready to land.Jul 28 2017, 8:38 AM
bcr added a subscriber: bcr.Jul 28 2017, 8:58 AM

Small comment on the man page change.


... provides a VNC server.
... provides the VNC server.

araujo updated this revision to Diff 31330.Jul 29 2017, 3:26 AM
araujo edited edge metadata.

Address @bcr change request.

This revision now requires review to proceed.Jul 29 2017, 3:26 AM
bcr accepted this revision.Jul 29 2017, 10:12 AM

OK from manpages. Thanks!

This revision is now accepted and ready to land.Jul 29 2017, 10:12 AM
grehan requested changes to this revision.Jul 29 2017, 6:29 PM

I'm looking at this now. I think there will need to be some changes in the mechanics for this, and also the abstraction. I'll write up something longer with more detail.

On naming - the term "vnc" was explicitly avoided in bhyve since much of the display code could be used with any remote protocol.

This revision now requires changes to proceed.Jul 29 2017, 6:29 PM

Some high-level comments:

  • the shared library interface is a bit fragile, since it searches for only symbol names and seems to imply a copy of an internal data structure (the vncserver_softc struct). A better approach would be something like bhyveload, where there is a single struct that contains a version and function pointers. That should be exported to a header file (along with any other structs used in the api) and go somewhere like <bhyve/extvnc.h> or similar.
  • the 'enable_http' function isn't used and maybe should be removed.
  • the frame-buffer differencing engine has been copy-pasted into vncserver.c. A better approach might be to make the existing rfb code an implementation of the function pointers, and allow an override to an external shared library on the command line (perhaps named to allow alternate ones). The differencing engine would then just call a function pointer, allowing a single copy of the code to be used.
  • the hard-coded path to the ports shared library should at the minimum be a #define, and better, extracted from the command line.

There are some unnecessary style changes that create additional extraneous diffs - these should be removed.