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

Can't restart Windows from within Steam #448

Open
appsforartists opened this issue Nov 26, 2024 · 1 comment
Open

Can't restart Windows from within Steam #448

appsforartists opened this issue Nov 26, 2024 · 1 comment

Comments

@appsforartists
Copy link

Background

There's a trick that other SteamOS distributions use to support occasionally booting into Windows without adding a boot menu like rEFInd or Clover - adding this incantation as a Non-Steam Game:

efibootmgr -n $(efibootmgr | grep -Pom 1 "(?<=Boot)[[:xdigit:]]{4}(?=. Windows)"); systemctl restart;

I've tried to do so on Jovian (replacing efibootmgr with systemctl to circumvent the sudo requirement). It works from steam-run, but not from within Steam itself.

Steps to reproduce

  1. Add this derivation to your Nix build:
     let
       name = "restart-into-windows";
     in {
       config = {
         environment.systemPackages = with pkgs; [
           (stdenv.mkDerivation {
             name = name;
             unpackPhase = ''
               # source is inline, so skip downloading
             '';
             desktopItems = [
               (makeDesktopItem {
                 name = name;
                 desktopName = "Windows XP";
                 exec = ''
                   ${pkgs.systemd}/bin/systemctl reboot --boot-loader-entry=auto-windows
                 '';
               })
             ];
             nativeBuildInputs = [copyDesktopItems];
           })
         ];
    
         security.polkit.extraConfig = ''
           polkit.addRule(function(action, subject) {
             if (action.id == "org.freedesktop.login1.set-reboot-to-boot-loader-entry") {
               return polkit.Result.YES;
             }
           });
         '';
       };
     }
  2. Switch to Desktop Mode
  3. Add /run/current-system/sw/share/applications/restart-into-windows.desktop
  4. From either Desktop Mode or gamescope, select the Windows entry and click Play.

Results

Steam says "Launching…", briefly draws the Steam throbber, and then exits back to the game info page.

Logs

From journalctl -f:

Nov 26 00:42:27 brenton-go steam[13086]: chdir "/nix/store/f15mlcw0y5m14lb39qbh6n4bzjfr9sjc-restart-into-windows/share/applications/"
Nov 26 00:42:27 brenton-go steam[13086]: Game Recording - would start recording game 12606475036727967744, but recording for this game is disabled
Nov 26 00:42:27 brenton-go steam[13086]: Adding process 14296 for gameID 12606475036727967744
Nov 26 00:42:27 brenton-go steam[13086]: ERROR: ld.so: object '/home/brenton/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
Nov 26 00:42:28 brenton-go steam[13086]: ERROR: ld.so: object '/home/brenton/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
Nov 26 00:42:28 brenton-go steam[13086]: ERROR: ld.so: object '/home/brenton/.local/share/Steam/ubuntu12_64/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
Nov 26 00:42:28 brenton-go steam[13086]: pid 14297 != 14296, skipping destruction (fork without exec?)
Nov 26 00:42:28 brenton-go steam[13086]: Game Recording - game stopped [gameid=12606475036727967744]
Nov 26 00:42:28 brenton-go steam[13086]: Removing process 14296 for gameID 12606475036727967744

Let me know if there's a better way to debug this.

@appsforartists
Copy link
Author

I'd be happy to upstream this to Jovian if there's a way to make it work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant