Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plasma6 on Hyper-V is broken by switch to Wayland #372703

Open
me-and opened this issue Jan 10, 2025 · 3 comments · May be fixed by #372743
Open

Plasma6 on Hyper-V is broken by switch to Wayland #372703

me-and opened this issue Jan 10, 2025 · 3 comments · May be fixed by #372743
Labels
0.kind: bug Something is broken

Comments

@me-and
Copy link
Contributor

me-and commented Jan 10, 2025

Describe the bug

In #368074 and #368084, NixOS swapped to using Wayland by default for Plasma6 systems, in unstable and 24.11 respectively. On Hyper-V, this prevents the window manager from ever loading; instead all you get is the systemd startup log as far as [ OK ] Reached Target Graphical Interface.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Get a checkout of nixpkgs and install nixos-generators.

  2. I've been testing with the following configuration.nix (most of which is just personal preference for a minimal image):

    {
      config,
      lib,
      pkgs,
      ...
    }: {
      users.users.root.password = "";
      services.getty.autologinUser = lib.mkDefault "root";
    
      boot.loader.systemd-boot.enable = true;
      boot.loader.efi.canTouchEfiVariables = true;
      boot.tmp.cleanOnBoot = true;
    
      virtualisation.diskSize = 1024 * 20;
      virtualisation.hypervGuest.videoMode = "1920x1080";
    
      nix.settings = {
        trusted-users = ["@wheel"];
        sandbox = "relaxed";
        experimental-features = ["nix-command"];
      };
    
      services.xserver.enable = true;
      services.displayManager.sddm.enable = true;
      services.desktopManager.plasma6.enable = true;
      services.xserver.excludePackages = [pkgs.xterm];
    
      time.timeZone = "Europe/London";
      i18n.defaultLocale = "en_GB.UTF-8";
      services.xserver.xkb.layout = "gb";
      services.xserver.xkb.variant = "dvorak";
      console.useXkbConfig = true;
    
      programs.vim.enable = true;
      programs.vim.defaultEditor = true;
    
      system.stateVersion = "24.05";
    }
  3. Go to your nixpkgs repository and check out a relevant commit:

    • To demonstrate the breakage: git switch --detach f3160e4c2f38
    • To get the parent of that commit to demonstrate it was working before the change: git switch --detach f3160e4c2f38^
  4. Build a VHDX file to use in Hyper-V:

    nixos-generate -c configuration.nix -f hyperv -I nixos=$PWD -I nixpkgs=$PWD
    
  5. Copy the .vhdx file out of the store and onto your Hyper-V host, and set up a Hyper-V VM using the defaults except for (a) using a Generation 2 VM, (b) selecting the generated .vhdx as the hard disk, and (c) disabling Secure Boot.

  6. Boot the VM.

Expected behavior

The system boots to the SDDM greeter.

Screenshots

{1B149A47-2045-4B16-92C6-747636ABA2C4}

Additional context

This change was introduced to fix #363797.

Short term, I suspect we should do one or both of:

  • Back out this change from 24.11, since it's clearly a regression in some circumstances even if it fixes others
  • Change services.displayManager.sddm.wayland.enable from mkDefault true to mkDefault (!config.virtualisation.hypervGuest.enable)

Longer-term we should probably work out why Hyper-V and Plasma+Wayland aren't playing nicely together. I'd guess that's an upstream problem, but I've not tried investigating and wouldn't be sure where to start.

Metadata

  • system: "x86_64-linux"
  • host os: Linux 6.6.67, NixOS, 24.11 (Vicuna), 24.11pre-git
  • multi-user?: no
  • sandbox: yes
  • version: nix-env (Nix) 2.24.10
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos

Notify maintainers

Not sure who's entirely appropriate here, but making a few hopefully-reasonable guesses:


Note for maintainers: Please tag this issue in your PR.


Add a 👍 reaction to issues you find important.

@me-and me-and added the 0.kind: bug Something is broken label Jan 10, 2025
@K900
Copy link
Contributor

K900 commented Jan 10, 2025

Do you have logs or anything? Is hyperv_drm loaded?

@K900
Copy link
Contributor

K900 commented Jan 10, 2025

Actually, can you just try this:

diff --git a/nixos/modules/virtualisation/hyperv-guest.nix b/nixos/modules/virtualisation/hyperv-guest.nix
index af7ef02bdcff..bcfbee0149cf 100644
--- a/nixos/modules/virtualisation/hyperv-guest.nix
+++ b/nixos/modules/virtualisation/hyperv-guest.nix
@@ -34,7 +34,7 @@ in {
       initrd.availableKernelModules = [ "hyperv_keyboard" ];

       kernelParams = [
-        "video=hyperv_fb:${cfg.videoMode}" "elevator=noop"
+        "elevator=noop"
       ];
     };

@K900 K900 linked a pull request Jan 10, 2025 that will close this issue
13 tasks
@K900
Copy link
Contributor

K900 commented Jan 10, 2025

OK it was a little more involved, but #372743 should be the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants