Changes since v2: - Disable virgl for virtio-gpu devices - Ensure wayland-proxy-virtwl isn't started before card0 appears - Build everything with musl - Support testing netvm with crosvm in addition to appvms v1: https://spectrum-os.org/lists/archives/spectrum-devel/20220928170128.1583791-1-alyssa.ross@unikie.com v2: https://spectrum-os.org/lists/archives/spectrum-devel/20220930213533.1710618-1-alyssa.ross@unikie.com This series adds the Spectrum-side support for running VMs that can display Wayland windows on the host compositor, using virtio-gpu. There are various small things still to be resolved, but it's ready for other people to try out and test. The easiest way to test this out is to run "vm-start hello-wayland" on the Spectrum host. If everything goes well, a small window with a picture of a cat (hello-wayland) should appear. This window is running in a VM. Currently, Wayland clients more complex than hello-wayland are unlikely to work, due to a couple of upstream bugs: - https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4584252 - https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4684048 With those two fixes applied, I've been able to run much more complex applications, e.g. Krita. But I don't want to keep this waiting any longer, so let's get the basics in, and not block on fixing the remaining upstream problems. This has felt so close for so long, so I'm not going to miss this opportunity. As for what took this so long, mostly it's been stuff that isn't part of this series. Fixing crosvm, refining my cloud-hypervisor vhost-user-gpu implementation, etc. The previous submissions of this series were marked as RFC because there were bits I just wasn't quite happy enough with to merge them at the time — having to use Glibc for certain components, having virgl always enabled, etc. Those things have all been resolved. Alyssa Ross (6): img/app: allow waiting for GPU to appear vm-lib: add mesa drivers to VM img/app: add support for testing virtio-gpu vm: add support for testing in crosvm host: add support for Wayland in VMs vm/app: add hello-wayland demo VM .../using-spectrum/creating-vms.adoc | 5 ++++ host/initramfs/extfs.nix | 4 ++- host/rootfs/Makefile | 4 +++ host/rootfs/default.nix | 6 ++-- host/rootfs/etc/s6-rc/ext-rc-init/up | 7 +++++ host/rootfs/etc/template/gpu/data/check | 5 ++++ host/rootfs/etc/template/gpu/notification-fd | 1 + .../etc/template/gpu/notification-fd.license | 2 ++ host/rootfs/etc/template/gpu/run | 9 ++++++ host/rootfs/etc/template/gpu/type | 1 + host/rootfs/etc/template/gpu/type.license | 2 ++ host/start-vm/lib.rs | 10 +++++++ img/app/Makefile | 25 +++++++++++++++- img/app/etc/mdev.conf | 3 +- img/app/shell.nix | 2 +- lib/common.mk | 3 ++ vm-lib/make-vm.nix | 12 ++++++-- vm/app/hello-wayland.nix | 29 +++++++++++++++++++ vm/sys/net/Makefile | 11 +++++++ vm/sys/net/shell.nix | 2 +- 20 files changed, 133 insertions(+), 10 deletions(-) create mode 100755 host/rootfs/etc/template/gpu/data/check create mode 100644 host/rootfs/etc/template/gpu/notification-fd create mode 100644 host/rootfs/etc/template/gpu/notification-fd.license create mode 100755 host/rootfs/etc/template/gpu/run create mode 100644 host/rootfs/etc/template/gpu/type create mode 100644 host/rootfs/etc/template/gpu/type.license create mode 100644 vm/app/hello-wayland.nix base-commit: 13bb6394205346d161fa6f1467b7c6ba81196fb0 -- 2.40.1