4

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.

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

  • 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 5: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 5: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: 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
  • 1
    Wow, @DurandA, on Manjaro, I have SUCCESS! – Wyatt McGehee Mar 26 '20 at 19:06
1
+50

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 2: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 4:15
1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.