patches and low-level development discussion
 help / color / mirror / code / Atom feed
* Enabling forwarding Wayland from appVM to host with waypipe
@ 2022-11-30  7:12 Vadim Likholetov
  2022-11-30  8:51 ` Alyssa Ross
  0 siblings, 1 reply; 8+ messages in thread
From: Vadim Likholetov @ 2022-11-30  7:12 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 818 bytes --]

This patchset enables forwarding Wayland connections from appVM to the host
with the help of waypipe tool.

It doesn't reqire major changes in Spectrum and tries to utilise existing
packages and solutions.
Main idea is to create VSOCK virtual device on the start of appVM and use
this virtual socket to connect host and guest.

On the host side I implement vm-start-way tool that is based on vm-start,
but does necessary preparations for wayland forwarfing.

The guest VM is appvm-hello-waypipe and described in  hello-waypipe.nix
file.

To test it boot the Spectrum and do 'vm-start-way appvm-hello-waypipe'.
Be patient and in couple of seconds will appear a terminal window from
appVM.

This patches are for test the concept, so possibly redisign is needed for
production use.

ps sorry for mess in the mailing list

[-- Attachment #2: Type: text/html, Size: 1019 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Enabling forwarding Wayland from appVM to host with waypipe
  2022-11-30  7:12 Enabling forwarding Wayland from appVM to host with waypipe Vadim Likholetov
@ 2022-11-30  8:51 ` Alyssa Ross
  2022-11-30 10:14   ` Vadim Likholetov
  0 siblings, 1 reply; 8+ messages in thread
From: Alyssa Ross @ 2022-11-30  8:51 UTC (permalink / raw)
  To: Vadim Likholetov; +Cc: devel

[-- Attachment #1: Type: text/plain, Size: 1556 bytes --]

On Wed, Nov 30, 2022 at 09:12:50AM +0200, Vadim Likholetov wrote:
> This patchset enables forwarding Wayland connections from appVM to the host
> with the help of waypipe tool.
>
> It doesn't reqire major changes in Spectrum and tries to utilise existing
> packages and solutions.
> Main idea is to create VSOCK virtual device on the start of appVM and use
> this virtual socket to connect host and guest.
>
> On the host side I implement vm-start-way tool that is based on vm-start,
> but does necessary preparations for wayland forwarfing.
>
> The guest VM is appvm-hello-waypipe and described in  hello-waypipe.nix
> file.
>
> To test it boot the Spectrum and do 'vm-start-way appvm-hello-waypipe'.
> Be patient and in couple of seconds will appear a terminal window from
> appVM.
>
> This patches are for test the concept, so possibly redisign is needed for
> production use.

Thanks for sharing these!

You've done a great job fitting it into the Spectrum codebase.

Since you mentioned in your previous email that the same applications
are broken with Waypipe and virtio-gpu, I think that virtio-gpu still
looks like the way to go, since it would allow optimisations like shared
memory between guest and host that wouldn't be possible with a pure
socket-based approach like Waypipe.

But lots of people come to Spectrum looking for advice and inspiration for
their own custom Wayland-in-VM setups, and often they're more interested in
Waypipe, so it'll be great to be able to point them here.

> ps sorry for mess in the mailing list

No worries. :)

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Enabling forwarding Wayland from appVM to host with waypipe
  2022-11-30  8:51 ` Alyssa Ross
@ 2022-11-30 10:14   ` Vadim Likholetov
  2022-11-30 10:24     ` Alyssa Ross
  0 siblings, 1 reply; 8+ messages in thread
From: Vadim Likholetov @ 2022-11-30 10:14 UTC (permalink / raw)
  To: Alyssa Ross; +Cc: devel

[-- Attachment #1: Type: text/plain, Size: 2154 bytes --]

Thank you for the feedback!
I managed to make foot terminal working in my setup -- the issue was in
lack of compositor ( weston in my case) on the guest, looks like it's the
common issue for wayland programs, so now I have competitive advantage over
virtio-gpu setup :)
I also think that having socket-only approach in Spectrum is not a bad idea
cause it is   enabling remote access and networking  easy for virtual
machines and applications.

On Wed, Nov 30, 2022 at 10:51 AM Alyssa Ross <alyssa.ross@unikie.com> wrote:

> On Wed, Nov 30, 2022 at 09:12:50AM +0200, Vadim Likholetov wrote:
> > This patchset enables forwarding Wayland connections from appVM to the
> host
> > with the help of waypipe tool.
> >
> > It doesn't reqire major changes in Spectrum and tries to utilise existing
> > packages and solutions.
> > Main idea is to create VSOCK virtual device on the start of appVM and use
> > this virtual socket to connect host and guest.
> >
> > On the host side I implement vm-start-way tool that is based on vm-start,
> > but does necessary preparations for wayland forwarfing.
> >
> > The guest VM is appvm-hello-waypipe and described in  hello-waypipe.nix
> > file.
> >
> > To test it boot the Spectrum and do 'vm-start-way appvm-hello-waypipe'.
> > Be patient and in couple of seconds will appear a terminal window from
> > appVM.
> >
> > This patches are for test the concept, so possibly redisign is needed for
> > production use.
>
> Thanks for sharing these!
>
> You've done a great job fitting it into the Spectrum codebase.
>
> Since you mentioned in your previous email that the same applications
> are broken with Waypipe and virtio-gpu, I think that virtio-gpu still
> looks like the way to go, since it would allow optimisations like shared
> memory between guest and host that wouldn't be possible with a pure
> socket-based approach like Waypipe.
>
> But lots of people come to Spectrum looking for advice and inspiration for
> their own custom Wayland-in-VM setups, and often they're more interested in
> Waypipe, so it'll be great to be able to point them here.
>
> > ps sorry for mess in the mailing list
>
> No worries. :)
>

[-- Attachment #2: Type: text/html, Size: 2696 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Enabling forwarding Wayland from appVM to host with waypipe
  2022-11-30 10:14   ` Vadim Likholetov
@ 2022-11-30 10:24     ` Alyssa Ross
  2022-11-30 10:32       ` Vadim Likholetov
  0 siblings, 1 reply; 8+ messages in thread
From: Alyssa Ross @ 2022-11-30 10:24 UTC (permalink / raw)
  To: Vadim Likholetov; +Cc: devel

[-- Attachment #1: Type: text/plain, Size: 694 bytes --]

On Wed, Nov 30, 2022 at 12:14:28PM +0200, Vadim Likholetov wrote:
> Thank you for the feedback!
> I managed to make foot terminal working in my setup -- the issue was in
> lack of compositor ( weston in my case) on the guest, looks like it's the
> common issue for wayland programs, so now I have competitive advantage over
> virtio-gpu setup :)

Interesting — why does it need there to be a compositor in the guest?
Doesn't Waypipe act as the compositor?

> I also think that having socket-only approach in Spectrum is not a bad idea
> cause it is   enabling remote access and networking  easy for virtual
> machines and applications.

You mean remote access to Spectrum VMs?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Enabling forwarding Wayland from appVM to host with waypipe
  2022-11-30 10:24     ` Alyssa Ross
@ 2022-11-30 10:32       ` Vadim Likholetov
  2022-11-30 11:29         ` Alyssa Ross
  0 siblings, 1 reply; 8+ messages in thread
From: Vadim Likholetov @ 2022-11-30 10:32 UTC (permalink / raw)
  To: Alyssa Ross; +Cc: devel

[-- Attachment #1: Type: text/plain, Size: 969 bytes --]

On Wed, Nov 30, 2022 at 12:24 PM Alyssa Ross <alyssa.ross@unikie.com> wrote:

> On Wed, Nov 30, 2022 at 12:14:28PM +0200, Vadim Likholetov wrote:
> > Thank you for the feedback!
> > I managed to make foot terminal working in my setup -- the issue was in
> > lack of compositor ( weston in my case) on the guest, looks like it's the
> > common issue for wayland programs, so now I have competitive advantage
> over
> > virtio-gpu setup :)
>
> Interesting — why does it need there to be a compositor in the guest?
> Doesn't Waypipe act as the compositor?
>
>   No, why should it?
  Also wayland-info shows the screen says the display has no compositor.



>
> > I also think that having socket-only approach in Spectrum is not a bad
> idea
> > cause it is   enabling remote access and networking  easy for virtual
> > machines and applications.
>
> You mean remote access to Spectrum VMs?
>
> Yes, and may be some distributed configurations.

[-- Attachment #2: Type: text/html, Size: 1533 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Enabling forwarding Wayland from appVM to host with waypipe
  2022-11-30 10:32       ` Vadim Likholetov
@ 2022-11-30 11:29         ` Alyssa Ross
  2022-11-30 13:12           ` Vadim Likholetov
  0 siblings, 1 reply; 8+ messages in thread
From: Alyssa Ross @ 2022-11-30 11:29 UTC (permalink / raw)
  To: Vadim Likholetov; +Cc: devel

[-- Attachment #1: Type: text/plain, Size: 1575 bytes --]

On Wed, Nov 30, 2022 at 12:32:28PM +0200, Vadim Likholetov wrote:
> On Wed, Nov 30, 2022 at 12:24 PM Alyssa Ross <alyssa.ross@unikie.com> wrote:
>
> > On Wed, Nov 30, 2022 at 12:14:28PM +0200, Vadim Likholetov wrote:
> > > Thank you for the feedback!
> > > I managed to make foot terminal working in my setup -- the issue was in
> > > lack of compositor ( weston in my case) on the guest, looks like it's the
> > > common issue for wayland programs, so now I have competitive advantage
> > over
> > > virtio-gpu setup :)
> >
> > Interesting — why does it need there to be a compositor in the guest?
> > Doesn't Waypipe act as the compositor?
> >
> >   No, why should it?
>   Also wayland-info shows the screen says the display has no compositor.

My understanding of how Waypipe, Sommelier, and wayland-proxy-virtwl
work is that they implement the compositor side of the Wayland protocol,
and then proxy it to the real compositor running outside of the VM.

Since hello-wayland appears on the host, it must be talking to the host
compositor over Waypipe.

It's weird that wayland-info doesn't find a compositor though.
I wonder why, when hello-wayland is able to find it.

> > > I also think that having socket-only approach in Spectrum is not a bad
> > idea
> > > cause it is   enabling remote access and networking  easy for virtual
> > > machines and applications.
> >
> > You mean remote access to Spectrum VMs?
> >
> > Yes, and may be some distributed configurations.

Those would need to use networking, rather than vsock, right?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Enabling forwarding Wayland from appVM to host with waypipe
  2022-11-30 11:29         ` Alyssa Ross
@ 2022-11-30 13:12           ` Vadim Likholetov
  2022-11-30 14:21             ` Alyssa Ross
  0 siblings, 1 reply; 8+ messages in thread
From: Vadim Likholetov @ 2022-11-30 13:12 UTC (permalink / raw)
  To: Alyssa Ross; +Cc: devel



> On 30 Nov 2022, at 13:29, Alyssa Ross <alyssa.ross@unikie.com> wrote:
> 
> On Wed, Nov 30, 2022 at 12:32:28PM +0200, Vadim Likholetov wrote:
>> On Wed, Nov 30, 2022 at 12:24 PM Alyssa Ross <alyssa.ross@unikie.com> wrote:
>> 
>>> On Wed, Nov 30, 2022 at 12:14:28PM +0200, Vadim Likholetov wrote:
>>>> Thank you for the feedback!
>>>> I managed to make foot terminal working in my setup -- the issue was in
>>>> lack of compositor ( weston in my case) on the guest, looks like it's the
>>>> common issue for wayland programs, so now I have competitive advantage
>>> over
>>>> virtio-gpu setup :)
>>> 
>>> Interesting — why does it need there to be a compositor in the guest?
>>> Doesn't Waypipe act as the compositor?
>>> 
>>>  No, why should it?
>>  Also wayland-info shows the screen says the display has no compositor.
> 
> My understanding of how Waypipe, Sommelier, and wayland-proxy-virtwl
> work is that they implement the compositor side of the Wayland protocol,
> and then proxy it to the real compositor running outside of the VM.
> 
> Since hello-wayland appears on the host, it must be talking to the host
> compositor over Waypipe.
> 
> It's weird that wayland-info doesn't find a compositor though.
> I wonder why, when hello-wayland is able to find it.

Stil not sure, even have  looked into the code, I think it works one level down, so it requires external compositor.
Should check by wayland-info on other ( not waypipe)  implementations. 


> 
>>>> I also think that having socket-only approach in Spectrum is not a bad
>>> idea
>>>> cause it is   enabling remote access and networking  easy for virtual
>>>> machines and applications.
>>> 
>>> You mean remote access to Spectrum VMs?
>>> 
>>> Yes, and may be some distributed configurations.
> 
> Those would need to use networking, rather than vsock, right?

Yes, but it will be cheap/easy  replacement.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Enabling forwarding Wayland from appVM to host with waypipe
  2022-11-30 13:12           ` Vadim Likholetov
@ 2022-11-30 14:21             ` Alyssa Ross
  0 siblings, 0 replies; 8+ messages in thread
From: Alyssa Ross @ 2022-11-30 14:21 UTC (permalink / raw)
  To: Vadim Likholetov; +Cc: devel

[-- Attachment #1: Type: text/plain, Size: 1853 bytes --]

On Wed, Nov 30, 2022 at 03:12:31PM +0200, Vadim Likholetov wrote:
>
>
> > On 30 Nov 2022, at 13:29, Alyssa Ross <alyssa.ross@unikie.com> wrote:
> >
> > On Wed, Nov 30, 2022 at 12:32:28PM +0200, Vadim Likholetov wrote:
> >> On Wed, Nov 30, 2022 at 12:24 PM Alyssa Ross <alyssa.ross@unikie.com> wrote:
> >>
> >>> On Wed, Nov 30, 2022 at 12:14:28PM +0200, Vadim Likholetov wrote:
> >>>> Thank you for the feedback!
> >>>> I managed to make foot terminal working in my setup -- the issue was in
> >>>> lack of compositor ( weston in my case) on the guest, looks like it's the
> >>>> common issue for wayland programs, so now I have competitive advantage
> >>> over
> >>>> virtio-gpu setup :)
> >>>
> >>> Interesting — why does it need there to be a compositor in the guest?
> >>> Doesn't Waypipe act as the compositor?
> >>>
> >>>  No, why should it?
> >>  Also wayland-info shows the screen says the display has no compositor.
> >
> > My understanding of how Waypipe, Sommelier, and wayland-proxy-virtwl
> > work is that they implement the compositor side of the Wayland protocol,
> > and then proxy it to the real compositor running outside of the VM.
> >
> > Since hello-wayland appears on the host, it must be talking to the host
> > compositor over Waypipe.
> >
> > It's weird that wayland-info doesn't find a compositor though.
> > I wonder why, when hello-wayland is able to find it.
>
> Stil not sure, even have  looked into the code, I think it works one level down, so it requires external compositor.
> Should check by wayland-info on other ( not waypipe)  implementations.

Yeah.  I'd also be interested to know if running Weston inside the guest
also fixes foot for you with virtio-gpu.  My instinct is that it will,
since it means Weston is the application running over virtio-gpu, rather
than foot.


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-11-30 14:21 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-30  7:12 Enabling forwarding Wayland from appVM to host with waypipe Vadim Likholetov
2022-11-30  8:51 ` Alyssa Ross
2022-11-30 10:14   ` Vadim Likholetov
2022-11-30 10:24     ` Alyssa Ross
2022-11-30 10:32       ` Vadim Likholetov
2022-11-30 11:29         ` Alyssa Ross
2022-11-30 13:12           ` Vadim Likholetov
2022-11-30 14:21             ` Alyssa Ross

Code repositories for project(s) associated with this public inbox

	https://spectrum-os.org/git/crosvm
	https://spectrum-os.org/git/doc
	https://spectrum-os.org/git/mktuntap
	https://spectrum-os.org/git/nixpkgs
	https://spectrum-os.org/git/spectrum
	https://spectrum-os.org/git/ucspi-vsock
	https://spectrum-os.org/git/www

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).