How does TigerVNC connects to Windows VM built-in virtual display?

61 views
Skip to first unread message

Philippe Noël

unread,
Jan 11, 2020, 3:59:11 PM1/11/20
to TigerVNC Developer Discussion
I'm reading through the TigerVNC code, trying to understand how it connects to the built-in virtual display of my AWS Windows Server VM. It calls a bunch of functions like OpenDesktop in and also has the file called Region.c, which makes think it "creates" a desktop imitating an X11 server on Linux.

I'm trying to understand really how the virtual display component works to understand the codebase and possibly contribute, but am confused about how this goes on. Could someone please give me a brief rundown? I'd really appreciate it! :)

Phil

Pierre Ossman

unread,
Jan 13, 2020, 1:47:28 AM1/13/20
to Philippe Noël, TigerVNC Developer Discussion
VNC/RFB has copied some smaller things from X11, but in general they
have very little to do with each other. So the Windows server is fairly
pass through and you shouldn't have to deal with any X11.

The low level stuff is in win/rfb_win32/ and you'll probably want to
look at DeviceFrameBuffer in there as well as the different SDisplay files.

In general there is rather poor support for Windows' desktop as most of
the code was written before that abstraction. I.e. when there could only
be a single desktop and it would be shown on the local monitor.

I'm afraid no one is currently familiar with the Windows server code
base, but we can try to help out with any questions you might have.

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

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

Philippe Noël

unread,
Jan 13, 2020, 12:46:34 PM1/13/20
to Pierre Ossman, TigerVNC Developer Discussion
VNC/RFB has copied some smaller things from X11, but in general they
have very little to do with each other. So the Windows server is fairly
pass through and you shouldn't have to deal with any X11.
The low level stuff is in win/rfb_win32/ and you'll probably want to
look at DeviceFrameBuffer in there as well as the different SDisplay files.
In general there is rather poor support for Windows' desktop as most of
the code was written before that abstraction. I.e. when there could only
be a single desktop and it would be shown on the local monitor.
I'm afraid no one is currently familiar with the Windows server code
base, but we can try to help out with any questions you might have.
Regards

I see. From my understanding, VNC runs as a service which then connects to the "console session" (also known as session 0) of the Windows computer when the VNC server receives a connection request. Is that correct? I found some file in the folder you mentioned that appear to handle that. I think for my purposes, this is what I need to do as this way the application has access to the registry (while RDP uses a virtual registry by connecting to console 1 or higher).

Cheers,

Philippe

Pierre Ossman

unread,
Jan 14, 2020, 1:48:20 AM1/14/20
to Philippe Noël, TigerVNC Developer Discussion
On 13/01/2020 18:45, Philippe Noël wrote:
>
> I see. From my understanding, VNC runs as a service which then connects to
> the "console session" (also known as session 0) of the Windows computer
> when the VNC server receives a connection request. Is that correct? I found
> some file in the folder you mentioned that appear to handle that. I think
> for my purposes, this is what I need to do as this way the application has
> access to the registry (while RDP uses a virtual registry by connecting to
> console 1 or higher).
>

Yeah, I think that sounds right. Note that there is a "user mode" as
well where it attaches to the current desktop rather than the console.

Philippe Noël

unread,
Jan 25, 2020, 11:08:09 AM1/25/20
to Pierre Ossman, TigerVNC Developer Discussion
Hello,

I am still working on this issue -- I'm trying to create a Windows service in C#, similar to the TigerVNC service code, which runs a VNC server when there is no user logged in and connects to the console. I've implemented a lot of the code from VNCServerService.cxx but it still doesn't work. If someone here is familiar with the sequence of execution of the functions in the TigerVNC service, I would really appreciate it if you could potentially point me in the right direction / outline the sequence of Win32 API functions that get called. I can compensate you for your time.

Cheers,

Philippe


--
You received this message because you are subscribed to the Google Groups "TigerVNC Developer Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tigervnc-deve...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tigervnc-devel/07195930-3676-947a-6dd4-758f139e8231%40cendio.se.
Reply all
Reply to author
Forward
0 new messages