Enabling forwarding Wayland from appVM to host with waypipe
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
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. :)
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
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. :)
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?
On Wed, Nov 30, 2022 at 12:24 PM Alyssa Ross
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.
On Wed, Nov 30, 2022 at 12:32:28PM +0200, Vadim Likholetov wrote:
On Wed, Nov 30, 2022 at 12:24 PM Alyssa Ross
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?
On 30 Nov 2022, at 13:29, Alyssa Ross
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
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.
On Wed, Nov 30, 2022 at 03:12:31PM +0200, Vadim Likholetov wrote:
On 30 Nov 2022, at 13:29, Alyssa Ross
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
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.
participants (2)
-
Alyssa Ross
-
Vadim Likholetov