Hyprland icon indicating copy to clipboard operation
Hyprland copied to clipboard

Hyprland on NixOS vm/QEMU

Open patrickaldis opened this issue 2 years ago • 5 comments

Currently trying to build my nixos configuration to a vm image via nixos-rebuild build-vm. However, when in the vm, all that is produced when running Hyprland is a black screen. I have the following qemu options enabled:

"-device virtio-vga-gl" "-display gtk,gl=on"

Are any more necessary? ( note - I've also included the flag mentioned in this thread )

Thanks for any help :)

patrickaldis avatar Nov 20 '22 11:11 patrickaldis

@fufexan

vaxerski avatar Nov 20 '22 11:11 vaxerski

I have no idea, I've never used NixOS in a VM.

fufexan avatar Nov 20 '22 11:11 fufexan

provide the log from WLR_RENDERER_ALLOW_SOFTWARE=1 HYPRLAND_LOG_WLR=1 Hyprland (/tmp/hypr/)

vaxerski avatar Nov 20 '22 11:11 vaxerski

@patrickaldis Are you using an Nvidia GPU? I think I had this issue on Nvidia but not on an Intel GPU although it's been a few months since I tried to run my config in a qemu vm

jocelynthode avatar Nov 21 '22 21:11 jocelynthode

Ran into a similar issue in VMware Fusion, ended up running with WLR_NO_HARDWARE_CURSORS=1 in addition to WLR_RENDERER_ALLOW_SOFTWARE=1 (and the exports in the quickstart guide) which made it work

Zoellner122 avatar Nov 22 '22 15:11 Zoellner122

@patrickaldis is this resolved for you ??

romanstingler avatar Jul 05 '23 17:07 romanstingler

I'm having the same experience of a blank black screen. hyprland config works on my native machine but not for nix build .#nixosConfiguration.nixos.config.system.build.vm generated VM.

I tested the recommendations in this issue + #797 without success.

My machine is a 11th Gen Framework laptop with Intel TigerLake-LP GT2 [Iris Xe Graphics] GPU.

In case this is helpful, my hyprland log file is https://gist.github.com/dantefromhell/98e57482ca87ff0a63cf41014f8a12a3

If required I can see if I can distill my nix configuration down to a flake that reproduces the error.

dantefromhell avatar Aug 09 '23 12:08 dantefromhell

Out of curiosity I've been testing @donovanglover config at https://github.com/donovanglover/nix-config/ and this one works.

I'm not sure how to proceed with dissecting/ diffing the changes between the 2 configurations, any suggestions?

dantefromhell avatar Aug 10 '23 01:08 dantefromhell

Hi, make sure you have -device virtio-vga-gl and -display sdl,gl=on,show-cursor=off in your QEMU options, as well as WLR_NO_HARDWARE_CURSORS = "1" in your environment.sessionVariables. Example.

donovanglover avatar Aug 10 '23 18:08 donovanglover

make sure you have -device virtio-vga-gl and -display sdl,gl=on,show-cursor=off in your QEMU options, as well as WLR_NO_HARDWARE_CURSORS = "1"

Yes I already copied that code (plus some of the virtualisation.vmVariant) directly from your flake. Thx for writing it 👍🏽

However the issue still persists.

The next step I could think of is testing the different version combinations. My system generally runs on nixos-23.05, but I was using the hyprland flake and the package it exports since nixos-23.05 is still on hyprland-0.25 and hyprland-0.28 promises improved performance.

dantefromhell avatar Aug 11 '23 20:08 dantefromhell

I was able to extract a minimal flake that (hopefully) reproduces the problem https://gist.github.com/dantefromhell/899f0f85f828c9486f3d725dff1f49ec Gist also contains the log-file.

It tries to run hyprland-v0.28.0 on nixos-23.05. Bare metal it works, in NixOS VM the screen stays blank.

I was able to verify behaviour on 2 different laptops building & running the VM. Can someone test if they can reproduce the behaviour?

dantefromhell avatar Aug 12 '23 23:08 dantefromhell

@dantefromhell I can reproduce the black screen issue with your flake.nix and greetd + auto-login as well. Don't know what the missing option is unfortunately.

donovanglover avatar Aug 13 '23 01:08 donovanglover

this is not an issue with hl but with the vm. Make sure to allow software rendering. Anything else, your issue.

vaxerski avatar Nov 05 '23 16:11 vaxerski

Turns out this was related to running weston in sddm under NixOS using this configuration:

    services.xserver.displayManager = {
      sddm = {
        enable = true;
        enableHidpi = true;
        settings = {
          General.DisplayServer = "wayland";
          Wayland.CompositorCommand = "${pkgs.westonLite}/bin/weston --shell=fullscreen-shell.so";
        };
      };

During a NixOS upgrade I had to disable the weston pieces in settings as they were producing a blank screen in SDDM. This also fixed my hyprland black screen in the VM.

Not sure if this is worth re-opening, but maybe this finding will be helpful for someone else someday.

dantefromhell avatar Apr 03 '24 22:04 dantefromhell