[Spice-devel] How to send a custom resolution message to windows/linux guest vdagent
Thiago Nascimento Araujo
taraujo at artit.com.br
Sat Mar 4 00:48:45 UTC 2017
>> ----- Mensagem original -----
>> De: "Pavel Grunt" <pgrunt at redhat.com>
>> Para: "Thiago Nascimento Araujo" <taraujo at artit.com.br>, "Jonathon Jongsma" <jjongsma at redhat.com>
>> Cc: spice-devel at lists.freedesktop.org
>> Enviadas: Sexta-feira, 3 de março de 2017 6:20:13
>> Assunto: Re: [Spice-devel] How to send a custom resolution message to windows/linux guest vdagent
>> On Thu, 2017-03-02 at 13:00 -0300, Thiago Nascimento Araujo wrote:
>> Hi,
>>
>> First of all, thank you all for the quick answers.
>>
>> The cut off message was my fault, sorry about that.
>>
>> I am trying to understand this:
>>
>> Lets say I am connected to a win/lnx guest though remote-viewer and
>> my remote-viewer is a window with the dimensions 1440x900, so:
>>
>> When I resize the window from 1440x900 to 1024x768 (manually resize
>> the remote-viewer window, not the screen resolution inside the
>> guest), what is the process involved from the remote-viewer to
>> communicate to the guest (with spice-guest-tools installed) to
>> peform the guest resize ?
>>
>> Is something like:
>> a) remote-viewer inform his new resolution sending a message ?
>yes
So, remote-viewer is connected to spice-server on port 5901 and send a message "hey my new resolution is WxH, please inform the QXL" ?
>> b) the agents capture this message ?
>no (not anymore) server takes this message and sends it to the QXL video card
Server sends to spice channel on port 5901 and vdservice grabs and inform QXL ?
>> c) the agents set the new resolution inside the client ?
>the window manager notices the change and adjusts the resolution
So, vdservice (if I am not wrong) receives a new WxH and inform the QXL to create an arbitrary resolution and scales the screen? I am totally lost, because I simply cannot force an arbitrary resolution using the program I created using win-api, it just returns -2 all the time, meaning "bad resolution".
>>
>> I want to understand how "arbitrary resolution" are possible.
>> I can't create an arbitrary resolution using the win-api, for
>> example, all I can do is search for the available modes starting the
>> devnode using enumdisplay from win-api. But using remote-viewer I
>> can force a 672x350 resolution for example.
>> So, why I need this?
>> I am trying to create a way to grab a window resolution (the windows
>> explorer at 700x500 window resolution, for example) and set the win
>> guest screen resolution to match the same resolution of the
>> explorer. Wrapping the remote-viewer window around the explorer and
>> adapt when is needed.
>> I am implementing a VDi solution that works like a "terminal service
>> app".
>> An user wants to use a notepad, for example, then I created a
>> program that resides inside the win guest, that receives the desired
>> app and hides everything else (desktop, taskbar, start menu, blocks
>> win-menu and other keys bindings) and only present the user with
>> notepad. (There's a similar solution for lnx as well in progress)
>> So far, everything is ok for win/lnx (most of it) guests - the only
>> thing I can't do, is set arbitrary resolutions, specially on windows
>> guests.
>> So I thought: I have to find a way to grab the notepad resolution
>> (that part is done) and send it to the spice-channel and create the
>> "wrapping effect around notepad".
>This sounds like the Seamless application project, please take a look at https://www.spice-space.org/seamless-applications.html
Actually, I am far away from trying a seamless. But you're correct, it sounds like a seamless.
In fact I am trying to do a simple aesthetic change, I already have a "run programs agent" inside the windows-guest plus win-api hooks that hides the remaining windows, start menu, task bar, key bindings, kill blacklisted programs and so on.
The aesthetic is about grab a window WxH, for example cmd.exe and shrink the screen to match the cmd.exe size.
The scenario would be:
1 - user wants to use cmd.exe
2 - "control agent" sends to my "run programs agent": hey, hide everything and open the cmd.exe for this person.
3 - "run programs agent" runs cmd.exe and grab the cmd.exe WxH
Now the aesthetic part (also the part I am lost and have no clue how to do that)
4 - "run programs agent" send a message to another agent in the hypervisor saying: "I need you to send a message to the spice channel and inform QXL to shrink the screen to W+10xH+10, where W and H is acquired by cmd.exe. And if the user "maximize" the cmd.exe all the message stuff you be repeated and adapted.
>Any comments are welcomed
So is this scenario possible? What do I need to study, codes to look into, anything to create a minimal injection linux (in the hypervisor) agent to play with messages to the spice channel and the QXL driver? Something like user at hypervisor:~$./spice_injector 5901 1024x768.
Thank you all and sorry about my crazy and stupid questions.
>> Thank you all in advance.
>> PS: sorry about my english - still learning.
>>> ----- Mensagem original -----
>>> De: "Jonathon Jongsma" <jjongsma at redhat.com>
>>> Para: "Thiago Nascimento Araujo" <taraujo at artit.com.br>, spice-devel
>>> @lists.freedesktop.org
>>> Enviadas: Quinta-feira, 2 de março de 2017 12:05:46
>>> Assunto: Re: [Spice-devel] How to send a custom resolution message
>>> to windows/linux guest vdagent
>>> On Thu, 2017-03-02 at 03:58 -0300, Thiago Nascimento Araujo wrote:
>> Hello,
>>> Is there a way to send a spice message, connect to pipe, or any
>>> other
>>> method to contact vdservice/vdagent to create/simulate a resize to
>>> an
>>> arbitrary resolution or full screen effect caused by remote-
>>> viewer?
>>> Any other ways I can connect to the named pipes (windows guests or
>>> linux guests) and watch/debug/learn. I cant find or connect to the
>>> windows guest named pipe and I got connection refused trying to
>>> socat
>>> to a port in linux guest.
>>> I really need some guidance to fully understand how arbitrary
>>> resolutions are created using win/lnx/spice api.
>>> Thanks in advance.
>>> ___________________
>> Hi Thiago,
>> Seems your message got cut off or something.
>>> My main question is: what is your end goal exactly? You say you're
>>> trying to simulate a resize and therefore you want to connect to a
>>> named pipe to do that. But there are probably better ways to do
>>> that,
>>> depending on your final goal. Also note that in recent linux guests,
>>> the vdagent executable is not really involved in the resolution
>>> changing process at all. Once we know what you're actually trying to
>>> do
>>> it will probably be easier to help you.
>>> Cheers,
>>> Jonathon
More information about the Spice-devel
mailing list