5

I'd like to try Wayfire—a 3D Wayland compositor—inside a virtual machine.

What are the options and requirements to make a virtual machine that can display a Wayland compositor with 3D acceleration?

I think VirtualBox is supposed to display 3D with Wayland using the VMSVGA but 3D was disabled in 5.2.22 and it is unclear if it was re-enabled ever since. My environment failed to start the DRM session with VirtualBox 6.0.18 but this might be due to other issues.

I also stumbled upon the Virgil 3D project for 3D inside QEMU guests. I am unfamiliar with QEMU and did not try it yet. Is it also suited for 3D Wayland?

Finally, what are the requirements for the host platform (kernel, driver...)? I am currently using an Ubuntu 18.04 system with the i915 driver.

DurandA
  • 191
  • 2
  • 9

3 Answers3

2

Virgil 3D will expose a virtual OpenGL capable GPU to the guest, you should be able to get 3D working with Wayland.

Another thing you may want to try is VMware Player. It, too, supports guest 3D acceleration (VirtualBox 3D acceleration uses the VMware driver intended for VMware hypervisors). VMware's accelerated 3D support was always far ahead of competition. It was good enough to run Crysis (Windows XP virtual machine with VMSVGA driver on a CentOS host with an Nvidia GPU) a decade ago.

Gordan Bobić
  • 3,330
  • 1
  • 18
  • 23
1

I grabbed a fresh FreeBSD 12.1 image from here: https://www.osboxes.org/freebsd/#freebsd-12-1-vmware. Login credentials for root and user are listed on the info tab there. I'm testing with the 64-bit VMDK and running on VirtualBox 6.0.18.

I also have the FreeBSD 12.1 guest VM configured with 2 Processors, 4 GB RAM, 128MB VRAM, VBoxSVGA Graphics Controller w/ 3D Accel on, 2 Virtual Displays. All of this is fairly standard with the exception of the VBoxSVGA controller, which by default for linux-based VMs is VMSVGA.

Did a pkg install wayfire && pkg install emulators/virtualbox-ose-additions, the latter of which is not likely necessary.

Now follow the config directions from the wiki: https://github.com/WayfireWM/wayfire/wiki/General. This is likely where you hit the drm error.

Do a startx. An XTerm or several should now be visible. Now export XDG_RUNTIME_DIR=/tmp, and after that wayfire should run. Please note that I get a libEGL warning, in which glamor and dri3 are disabled in favor of the fallback sw and a solid black window.

EDIT

Hi, @DurandA! I managed to build painlessly on Manjaro.

Walkthrough:

Host: AMD Ryzen 7 2700X, Windows 10 1909, 16GB RAM

Guest: VirtualBox 6.0.18, 2 CPU, 4 GB RAM, 128MB VRAM, VBoxSVGA Graphics Controller w/ 3D Accel on, 2 Virtual Displays.

Guest OS: https://manjaro.org/downloads/official/xfce/

  • Mounted a blank dynamically-sized VMDK set to 100GB as the hard drive, and the Manjaro ISO as an optical disk.
  • Boot the machine, it will default to the ISO since there is no GRUB on the VMDK, and install Manjaro COMPLETELY DEFAULT.
  • Shut down the VM, un-mount the ISO.
  • Start VM, should now boot into the Manjaro xfce desktop environment.
  • Here, I let Manjaro do ALL the updates it wanted to automatically through the Pamac GUI (the default Manjaro Package Manager)
  • Through Pamac, install meson, gcc, pkgconf, glm, and gobject-introspection.
  • Grab & run the Wayfire install script git clone https://github.com/WayfireWM/wf-install && cd wf-install && ./install.sh
  • Run Wayfire with /opt/wayfire/bin/startwayfire

And that's currently where I'm at. Here's a screener: enter image description here

  • Awesome! Are you able to resize the display or are you stuck at 800x600? – DurandA Mar 27 '20 at 02:29
  • Just tested, I can resize. It does leave a black artifact in the resized area until I click the Wayfire icon in the top left corner, at which point it fills the black. – Wyatt McGehee Mar 27 '20 at 04:15
1

Here is my experience so far with virtualization software when trying a preconfigured spin with Wayfire based on Manjaro (version /Wayfire/19-12/minimal/Wayfire-Linux-Rolling-minimal-191203-linux54.iso) from an Ubuntu 18.04 host with i915 Intel GPU driver. Note that it might not reflect the general quality of Wayland 3D support. I know that so many things could go wrong and this is just what happened with my setup.

VirtualBox 6.0.18: Wayfire starts and is displayed with VMSVGA driver. The machine is stuck in 800x600 even with Guest Additions (virtualbox-guest-utils). There is no mouse cursor so this is difficult to use. Strangely, there is no difference if 3D acceleration is enabled or not.

VMware Player 15.5.2: Cannot start Wayfire with 3D enabled. The system is stuck in Plymouth.

QEMU/KVM: not yet tested

DurandA
  • 191
  • 2
  • 9
  • Hi, DurandA. I've been doing more reading on this. By chance, is your host GPU an nVidia card? – Wyatt McGehee Mar 24 '20 at 05:18
  • 1
    I am currently using using the `i915` Intel driver. My laptop has a NVIDIA GPU (with Optimus) but it is not in use. – DurandA Mar 24 '20 at 05:52
  • 1
    Apologies, I glazed over the `i915` parts of your comments twice. I was very tired. I'm testing on the `nvidia-driver-340` driver. I also originally glazed over the sentence right below the "Installation" header on GitHub, which links to here: https://github.com/WayfireWM/wf-install. First go-around, I definitely did not do this. I'll give it a shot and report back. – Wyatt McGehee Mar 24 '20 at 14:52
  • Thanks @WyattMcGehee. I will also try QEMU/KVM with the Virgil 3D driver but I am not sure where to get started. – DurandA Mar 24 '20 at 15:48
  • I took a look at the install script I mentioned. It is a brand new project by that author, and is incomplete. No go there. For now, I'm attempting to build from the latest FreeBSD 12.1 port of WF https://www.freshports.org/x11-wm/wayfire/. I had to do a `portsnap fetch extract`. During build I ran into make `error 127` for `perl5.30.2` so did a `make deinstall && make reinstall` of https://www.freshports.org/lang/perl5.30/. Will report back again soon. – Wyatt McGehee Mar 24 '20 at 23:22
  • Everything I've tried has failed so far, @DurandA. I looked closer at sources officially available to each *nix distro. As Arch Linux was the first on the list, it turns out the repo on the [AUR](https://aur.archlinux.org/packages/wayfire/) are very up to date, so I'm trying an Arch Linux VM now. Is requiring a little bit of config, but nothing too hard to reproduce. Updating all packages now, will give Wayfire, WCM, and wf-shell a shot here shortly. – Wyatt McGehee Mar 25 '20 at 23:52
  • Thanks @WyattMcGehee for all your research. I stumbled upon a [Snap version of QEMU with Virgil 3D](https://snapcraft.io/qemu-virgil). I will report back soon. – DurandA Mar 26 '20 at 01:43
  • No worries @DurandA, I have shared interest! I managed to build Wayfire and WCM on Arch, but could not get wf-shell to compile, due to a meson build error relating to a missing gtkmm-3.0 lib that definitely was NOT missing. Since Manjaro is based on Arch, I'm going to try to do my own build on it, and see if it parallels what happens with the preconfigured spin you originally linked. Coronavirus lockdown has my work on hold, so I'm just killing hours :). – Wyatt McGehee Mar 26 '20 at 18:41
  • 1
    Wow, @DurandA, on Manjaro, I have SUCCESS! – Wyatt McGehee Mar 26 '20 at 19:06