NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
16.5k stars 12.99k forks source link

Freshly installed system takes too long to shutdown on virtualbox #253630

Open anakimluke opened 10 months ago

anakimluke commented 10 months ago

Describe the bug

An installation of nixos with a desktop manager on virtualbox has an unexpected delay when shutting down/rebooting.

Steps To Reproduce

  1. Create a virtualbox machine and follow installation instruction manual normally.
  2. When the time comes to edit the configuration.nix file, uncomment the line boot.loader.grub.device = "/dev/sda"; and the line services.xserver.enable = true;.
  3. Add the line services.xserver.desktopManager.xfce.enable = true;
  4. Continue the installation process.
  5. When it is finished, remove the nixos iso from the machine and reboot.
  6. When lightdm pops up, login as root.
  7. Reboot.
  8. Notice the message A stop job is running for Session 2 of User root (10s / 1min 29s), and how the system will only continue to showdown after the timer has finished.

Expected behavior

Expected for the system to shutdown immediately, without waiting 1min and 30s.

nix-env --version output

nix-env (Nix) 2.13.5

Metadata

 - system: `"x86_64-linux"`
 - host os: `Linux 6.1.50, NixOS, 23.05 (Stoat), 23.05.3165.9075cba53e86`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.13.5`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos

Notify maintainers

@kamadorueda

Additional context

Inspecting the log with journalctl -p5 I was able to find that the stop job was related to the VBoxClient process. This problem is not present using pkill -9 VBoxClient before rebooting.

This problem is not present when rebooting from lightdm without loging in into xfce. The problem is still present when using gdm with plasma5.

diego898 commented 6 months ago

I experienced this with just a fresh install of nixos 23.11 on vritualbox with kde plasta and systemd+efi options selected - with and without the virtualisation.virtualbox.guest.enable=true; line present.