Hololens 2: Why does 'Connect' button on 'Platforms - Windows Mixed Reality' just print "Cannot Connect, see log for Errors"

Hi, so I’ve been trying to get my UE4 scene working on a newly-installed Hololens 2. I’ve got an Oculus Rift S also attached to my PC, which I’ve been using successfully. The project I created with UE4 used the Hololens pre-canned setup, with the gears appearing, and I’ve modified it from there.

I have the Hololens 2 itself running, and can use the apps on it. I’ve also successfully paired it with my PC via Wi-Fi, in that I can go to https://192.168.1.103/default.htm and my Hololens 2 returns a webpage saying “HoloLens status: Everything looks good”. So there don’t seem to be any obvious faults.

To try to connect with UE4, I run the Holographic Remoting Player (v2.7.0.0) on the Hololens, and it says, “Waiting for connection on 192.168.1.103”. I then go to the ‘Platforms - Windows Mixed Reality’ tab in UE4 in Project Settings. I’ve got the ‘Enable Remoting for Editor’ option ticked there (and the needed editor restart has been done).

I then type that IP address (192.168.1.103) into the ‘IP of HoloLens to remote to’, and click Connect. But all I get is some red text below the Disconnect button saying “Cannot Connect, see log for Errors”. And that’s it. I tried looking for logs, but all I could find recently changed in my AppData\Local\Temp was a file called ‘UnrealCrcMiniLogV2_14972.log’, which only contains some non ASCII characters, and:

CRC/Init:2021.10.04-18.03.57|CRC/Load|CRC/Config|Monitor/Start:14972|OpenProcess/Done

Any ideas why I can’t connect to the Hololens 2 from UE4? I tried creating a fresh Hololens project in a new directory, but it has the same result as well.

Update: Thanks to Process Monitor (a Windows debugging program purchased by Microsoft; recommended), I’ve now found that the log file I mentioned above is not the log file being referred to by the bare ‘see log for Errors’ message. The “CRC” mentioned in the log file above is a ‘Crash Report Client’, but the actual log I wanted is the Saved/Logs/my-project-name.log file of my UE4 project. It would have been better if the error message had mentioned that.

Looking through this new log that I’ve found, I get some actual debugging information:

[2021.10.05-08.36.58:153][185]LogTemp: Editor connecting to remote HoloLens2: 192.168.1.103
[2021.10.05-08.36.58:153][185]LogWmrHmd: Error: ConnectToRemoteHoloLens XRSystem SystemName is OpenXR, not WindowsMixedRealityHMD.  Cannot Connect.  Perhaps you want to disable other XR plugins, adjust the priorities of XR plugins, deactivate other XR hardware, or run with -hmd=WindowsMixedRealityHMD in your editor commandline?

Putting -hmd=WindowsMixedRealityHMD on the command line options of my C++ UE4 project allows the connection to happen successfully.