DuoStream / Duo

An HDR-compatible multiseat streaming solution based around RdpWrap, Sunshine, Moonlight, and a variety of custom driver and library patches
442 stars 1 forks source link

Duo is unable to start instances if Virtual Machine Platform is enabled #94

Open Reyznn opened 7 months ago

Reyznn commented 7 months ago

If the computer has Windows' "Virtual Machine Platform" feature turned on and virtualization is available, Duo will be unable to create a working instance. Instead, it will create a Windows session, fail to properly start everything, and try again, over and over.

The event viewer will sometime log the following two issues : Source : DriverFrameworks-UserMode EventId : 10110 A problem has occurred with one or more user-mode drivers and the hosting process has been terminated. This may temporarily interrupt your ability to access the devices.

Source : DriverFrameworks-UserMode EventId : 10111 The device Microsoft Remote Display Adapter (location (unknown)) is offline due to a user-mode driver crash. Windows will attempt to restart the device 5 more times. Please contact the device manufacturer for more information about this problem.

Tested on Windows 10, and Windows 11 inside a virtual machine (with nested virtualization enabled).

Disabling the feature fixes the issue.

To reproduce it :

If the issue was properly reproduced, it should :

image

Black-Seraph commented 7 months ago

I will look into the matter but can confirm this to not necessarily be linked to virtualization, as one of my machines is set up in an identical way with me making extensive use of Hyper-V.

My guess is that this is linked to memory integrity instead, and that you toggling virtualization on might have also toggled memory integrity on as a side-effect.

EDIT: I'll be setting up a new test machine to debug exactly this issue coming Thursday given how none of my existing machines exhibits this behavior.

I will keep you posted @Reyznn.

Black-Seraph commented 7 months ago

@Reyznn I'm a little late but I finished setting up a brand new machine, installing the Hyper-V & Virtual Machine Platform feature and putting your claim to the test.

I couldn't reproduce your issue though, which tells me that we're looking in the wrong place.

I'd appreciate it if you could double-check your Memory Integrity setting and report back on my initial hunch.

Reyznn commented 7 months ago

Hello, I can still reproduce the issue. Memory Integrity is indeed disabled. I even tried enabling it then disabling it while rebooting in between (in case it was marked as disabled but was somehow enabled) but this didn't change anything. image

I'm running an Intel 13700K if that changes anything.

By the way, I don't have Hyper-V enabled, since WSL doesn't require it. Maybe it's an issue with both WSL and Virtual Machine Platform?

I might try to reproduce it on another computer if I find the time to.

Black-Seraph commented 7 months ago

@Reyznn Can't be WSL2 related as I use WSL2 daily as part of my workflow.

I can guarantee you that this isn't directly related to Virtual Machine Platform, WSL2 or Hyper-V, as I have all 3 enabled on my system alongside Duo.

I do see that your user's password is only 4 characters long though, which makes me think you might be running into the minimum password requirement restriction enforced by Network Level Authentication.

Try setting a more complex password for the user and report back if that solves your issue.

It's a long shot, I know, but I've seen this being an issue before so I want to rule it out just in case.

Reyznn commented 7 months ago

I went ahead and changed the password, but the result is the same. As mentioned in the first message, it seems to be Virtual Machine Platform or one of its components, since disabling it fixes the issue for me.

Here is the app running on my machine with VMP enabled : 1

And here it is with VMP disabled : 2

If VMP is disabled, I get the expected behavior (instance launch properly, web interface is accessible and connecting through moonlight works fine). But, if it is enabled, I get the behavior explained in the first post.

Benz0X commented 7 months ago

Hello

I run in the same kind of issues but on my side, enabling or disabling VMP (or Windows Subsystem for Linux) does not change anything.

Duo works fine on my laptop with the same configuration (account created with commandline, same user/password) but no way to make it work on my desktop.

Memory Integrity is off, and I don't remember toying around group policies.

In the event log, I get those message when starting Duo Service:

Log Name:      Microsoft-Windows-DeviceSetupManager/Admin
Source:        Microsoft-Windows-DeviceSetupManager
Date:          29/04/2024 17:32:24
Event ID:      131
Task Category: None
Level:         Error
Keywords:      
User:          Système
Computer:      DESKTOP-H0GK9E8
Description:
Metadata staging failed, result=0x80070490 for container '{00000000-0000-0000-FFFF-FFFFFFFFFFFF}'
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Microsoft-Windows-DeviceSetupManager" Guid="{fcbb06bb-6a2a-46e3-abaa-246cb4e508b2}" />
    <EventID>131</EventID>
    <Version>0</Version>
    <Level>2</Level>
    <Task>0</Task>
    <Opcode>0</Opcode>
    <Keywords>0x4000000000000000</Keywords>
    <TimeCreated SystemTime="2024-04-29T15:32:24.0928497Z" />
    <EventRecordID>43303</EventRecordID>
    <Correlation />
    <Execution ProcessID="1488" ThreadID="1556" />
    <Channel>Microsoft-Windows-DeviceSetupManager/Admin</Channel>
    <Computer>DESKTOP-H0GK9E8</Computer>
    <Security UserID="S-1-5-18" />
  </System>
  <EventData>
    <Data Name="Prop_ContainerId">{00000000-0000-0000-FFFF-FFFFFFFFFFFF}</Data>
    <Data Name="HRESULT">2147943568</Data>
  </EventData>
</Event>

Log Name:      Microsoft-Windows-DeviceSetupManager/Admin
Source:        Microsoft-Windows-DeviceSetupManager
Date:          29/04/2024 17:32:22
Event ID:      131
Task Category: None
Level:         Error
Keywords:      
User:          Système
Computer:      DESKTOP-H0GK9E8
Description:
Metadata staging failed, result=0x80070490 for container '{00000000-0000-0000-FFFF-FFFFFFFFFFFF}'
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Microsoft-Windows-DeviceSetupManager" Guid="{fcbb06bb-6a2a-46e3-abaa-246cb4e508b2}" />
    <EventID>131</EventID>
    <Version>0</Version>
    <Level>2</Level>
    <Task>0</Task>
    <Opcode>0</Opcode>
    <Keywords>0x4000000000000000</Keywords>
    <TimeCreated SystemTime="2024-04-29T15:32:22.1749231Z" />
    <EventRecordID>43301</EventRecordID>
    <Correlation />
    <Execution ProcessID="1488" ThreadID="7036" />
    <Channel>Microsoft-Windows-DeviceSetupManager/Admin</Channel>
    <Computer>DESKTOP-H0GK9E8</Computer>
    <Security UserID="S-1-5-18" />
  </System>
  <EventData>
    <Data Name="Prop_ContainerId">{00000000-0000-0000-FFFF-FFFFFFFFFFFF}</Data>
    <Data Name="HRESULT">2147943568</Data>
  </EventData>
</Event>

And those when starting the session from the Web interface:

Log Name:      Application
Source:        Duo
Date:          29/04/2024 17:34:44
Event ID:      1
Task Category: None
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      DESKTOP-H0GK9E8
Description:
Failed to determine the session ID for Test
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Duo" />
    <EventID Qualifiers="0">1</EventID>
    <Version>0</Version>
    <Level>2</Level>
    <Task>0</Task>
    <Opcode>0</Opcode>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2024-04-29T15:34:44.5332824Z" />
    <EventRecordID>67539</EventRecordID>
    <Correlation />
    <Execution ProcessID="0" ThreadID="0" />
    <Channel>Application</Channel>
    <Computer>DESKTOP-H0GK9E8</Computer>
    <Security />
  </System>
  <EventData>
    <Data>Failed to determine the session ID for Test</Data>
  </EventData>
</Event>
Log Name:      Application
Source:        Duo
Date:          29/04/2024 17:34:44
Event ID:      1
Task Category: None
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      DESKTOP-H0GK9E8
Description:
Failed to determine the session ID for Test
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Duo" />
    <EventID Qualifiers="0">1</EventID>
    <Version>0</Version>
    <Level>2</Level>
    <Task>0</Task>
    <Opcode>0</Opcode>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2024-04-29T15:34:44.5332824Z" />
    <EventRecordID>67539</EventRecordID>
    <Correlation />
    <Execution ProcessID="0" ThreadID="0" />
    <Channel>Application</Channel>
    <Computer>DESKTOP-H0GK9E8</Computer>
    <Security />
  </System>
  <EventData>
    <Data>Failed to determine the session ID for Test</Data>
  </EventData>
</Event>

Log Name:      Microsoft-Windows-User Device Registration/Admin
Source:        Microsoft-Windows-User Device Registration
Date:          29/04/2024 17:34:30
Event ID:      360
Task Category: None
Level:         Warning
Keywords:      
User:          DESKTOP-H0GK9E8\username
Computer:      DESKTOP-H0GK9E8
Description:
L’approvisionnement de Windows Hello Entreprise ne va pas être lancé. 
Device is AAD joined ( AADJ or DJ++ ): Not Tested 
User has logged on with AAD credentials: Not Tested 
Windows Hello for Business policy is enabled: Not Tested 
Windows Hello for Business post-logon provisioning is enabled: Not Tested 
Local computer meets Windows hello for business hardware requirements: Not Tested 
User is not connected to the machine via Remote Desktop: No 
User certificate for on premise auth policy is enabled: Not Tested 
Machine is governed by none policy. 
Cloud trust for on premise auth policy is enabled: Not Tested 
User account has Cloud TGT: Not Tested 
See https://go.microsoft.com/fwlink/?linkid=832647 for more details.
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Microsoft-Windows-User Device Registration" Guid="{23b8d46b-67dd-40a3-b636-d43e50552c6d}" />
    <EventID>360</EventID>
    <Version>0</Version>
    <Level>3</Level>
    <Task>0</Task>
    <Opcode>0</Opcode>
    <Keywords>0x8000000000000000</Keywords>
    <TimeCreated SystemTime="2024-04-29T15:34:30.7367589Z" />
    <EventRecordID>1019</EventRecordID>
    <Correlation />
    <Execution ProcessID="12580" ThreadID="9852" />
    <Channel>Microsoft-Windows-User Device Registration/Admin</Channel>
    <Computer>DESKTOP-H0GK9E8</Computer>
    <Security UserID="S-1-5-21-3160365654-1432699754-3980475786-1005" />
  </System>
  <EventData>
    <Data Name="Message">L’approvisionnement de Windows Hello Entreprise ne va pas être lancé.</Data>
    <Data Name="DeviceIsJoined">Not Tested</Data>
    <Data Name="AADPrt">Not Tested</Data>
    <Data Name="NgcPolicyEnabled">Not Tested</Data>
    <Data Name="NgcPostLogonProvisioningEnabled">Not Tested</Data>
    <Data Name="NgcHardwarePolicyMet">Not Tested</Data>
    <Data Name="UserIsRemote">No</Data>
    <Data Name="LogonCertRequired">Not Tested</Data>
    <Data Name="MachinePolicySource">none</Data>
    <Data Name="UseCloudTrust">Not Tested</Data>
    <Data Name="CloudTgt">Not Tested</Data>
  </EventData>
</Event>

Log Name:      Microsoft-Windows-DeviceSetupManager/Admin
Source:        Microsoft-Windows-DeviceSetupManager
Date:          29/04/2024 17:34:29
Event ID:      131
Task Category: None
Level:         Error
Keywords:      
User:          Système
Computer:      DESKTOP-H0GK9E8
Description:
Metadata staging failed, result=0x80070490 for container '{00000000-0000-0000-FFFF-FFFFFFFFFFFF}'
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Microsoft-Windows-DeviceSetupManager" Guid="{fcbb06bb-6a2a-46e3-abaa-246cb4e508b2}" />
    <EventID>131</EventID>
    <Version>0</Version>
    <Level>2</Level>
    <Task>0</Task>
    <Opcode>0</Opcode>
    <Keywords>0x4000000000000000</Keywords>
    <TimeCreated SystemTime="2024-04-29T15:34:29.8498427Z" />
    <EventRecordID>43309</EventRecordID>
    <Correlation />
    <Execution ProcessID="1488" ThreadID="2416" />
    <Channel>Microsoft-Windows-DeviceSetupManager/Admin</Channel>
    <Computer>DESKTOP-H0GK9E8</Computer>
    <Security UserID="S-1-5-18" />
  </System>
  <EventData>
    <Data Name="Prop_ContainerId">{00000000-0000-0000-FFFF-FFFFFFFFFFFF}</Data>
    <Data Name="HRESULT">2147943568</Data>
  </EventData>
</Event>

Log Name:      Microsoft-Windows-DeviceSetupManager/Admin
Source:        Microsoft-Windows-DeviceSetupManager
Date:          29/04/2024 17:34:28
Event ID:      131
Task Category: None
Level:         Error
Keywords:      
User:          Système
Computer:      DESKTOP-H0GK9E8
Description:
Metadata staging failed, result=0x80070490 for container '{8599D844-24F5-46E5-A8DF-75747BB11291}'
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Microsoft-Windows-DeviceSetupManager" Guid="{fcbb06bb-6a2a-46e3-abaa-246cb4e508b2}" />
    <EventID>131</EventID>
    <Version>0</Version>
    <Level>2</Level>
    <Task>0</Task>
    <Opcode>0</Opcode>
    <Keywords>0x4000000000000000</Keywords>
    <TimeCreated SystemTime="2024-04-29T15:34:28.9347119Z" />
    <EventRecordID>43307</EventRecordID>
    <Correlation />
    <Execution ProcessID="1488" ThreadID="3084" />
    <Channel>Microsoft-Windows-DeviceSetupManager/Admin</Channel>
    <Computer>DESKTOP-H0GK9E8</Computer>
    <Security UserID="S-1-5-18" />
  </System>
  <EventData>
    <Data Name="Prop_ContainerId">{8599D844-24F5-46E5-A8DF-75747BB11291}</Data>
    <Data Name="HRESULT">2147943568</Data>
  </EventData>
</Event>

Log Name:      Application
Source:        Duo
Date:          29/04/2024 17:34:28
Event ID:      1
Task Category: None
Level:         Warning
Keywords:      Classic
User:          N/A
Computer:      DESKTOP-H0GK9E8
Description:
The HDR monitor driver installation is pending, please reboot to enable HDR support
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Duo" />
    <EventID Qualifiers="0">1</EventID>
    <Version>0</Version>
    <Level>3</Level>
    <Task>0</Task>
    <Opcode>0</Opcode>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2024-04-29T15:34:28.8863994Z" />
    <EventRecordID>67537</EventRecordID>
    <Correlation />
    <Execution ProcessID="0" ThreadID="0" />
    <Channel>Application</Channel>
    <Computer>DESKTOP-H0GK9E8</Computer>
    <Security />
  </System>
  <EventData>
    <Data>The HDR monitor driver installation is pending, please reboot to enable HDR support</Data>
  </EventData>
</Event>

Log Name:      Microsoft-Windows-TerminalServices-ServerUSBDevices/Admin
Source:        Microsoft-Windows-TerminalServices-ServerUSBDevices
Date:          29/04/2024 17:34:28
Event ID:      36
Task Category: None
Level:         Warning
Keywords:      
User:          Système
Computer:      DESKTOP-H0GK9E8
Description:
Redirection of additional supported devices is disabled by policy.
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Microsoft-Windows-TerminalServices-ServerUSBDevices" Guid="{dcbe5aaa-16e2-457c-9337-366950045f0a}" />
    <EventID>36</EventID>
    <Version>0</Version>
    <Level>3</Level>
    <Task>0</Task>
    <Opcode>0</Opcode>
    <Keywords>0x8000000000000000</Keywords>
    <TimeCreated SystemTime="2024-04-29T15:34:28.8748148Z" />
    <EventRecordID>10</EventRecordID>
    <Correlation />
    <Execution ProcessID="16076" ThreadID="9116" />
    <Channel>Microsoft-Windows-TerminalServices-ServerUSBDevices/Admin</Channel>
    <Computer>DESKTOP-H0GK9E8</Computer>
    <Security UserID="S-1-5-18" />
  </System>
  <EventData>
  </EventData>
</Event>

Log Name:      Microsoft-Windows-TerminalServices-PnPDevices/Admin
Source:        Microsoft-Windows-TerminalServices-PnPDevices
Date:          29/04/2024 17:34:28
Event ID:      36
Task Category: None
Level:         Warning
Keywords:      
User:          Système
Computer:      DESKTOP-H0GK9E8
Description:
Redirection of additional supported devices is disabled by policy.
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Microsoft-Windows-TerminalServices-PnPDevices" Guid="{27a8c1e2-eb19-463e-8424-b399df27a216}" />
    <EventID>36</EventID>
    <Version>0</Version>
    <Level>3</Level>
    <Task>0</Task>
    <Opcode>0</Opcode>
    <Keywords>0x8000000000000000</Keywords>
    <TimeCreated SystemTime="2024-04-29T15:34:28.8744782Z" />
    <EventRecordID>10</EventRecordID>
    <Correlation />
    <Execution ProcessID="16076" ThreadID="9116" />
    <Channel>Microsoft-Windows-TerminalServices-PnPDevices/Admin</Channel>
    <Computer>DESKTOP-H0GK9E8</Computer>
    <Security UserID="S-1-5-18" />
  </System>
  <EventData>
  </EventData>
</Event>

Log Name:      Microsoft-Windows-DeviceSetupManager/Admin
Source:        Microsoft-Windows-DeviceSetupManager
Date:          29/04/2024 17:34:28
Event ID:      131
Task Category: None
Level:         Error
Keywords:      
User:          Système
Computer:      DESKTOP-H0GK9E8
Description:
Metadata staging failed, result=0x80070490 for container '{C8B8F235-0630-11EF-B199-18C04D64ADB7}'
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Microsoft-Windows-DeviceSetupManager" Guid="{fcbb06bb-6a2a-46e3-abaa-246cb4e508b2}" />
    <EventID>131</EventID>
    <Version>0</Version>
    <Level>2</Level>
    <Task>0</Task>
    <Opcode>0</Opcode>
    <Keywords>0x4000000000000000</Keywords>
    <TimeCreated SystemTime="2024-04-29T15:34:28.7205932Z" />
    <EventRecordID>43305</EventRecordID>
    <Correlation />
    <Execution ProcessID="1488" ThreadID="2416" />
    <Channel>Microsoft-Windows-DeviceSetupManager/Admin</Channel>
    <Computer>DESKTOP-H0GK9E8</Computer>
    <Security UserID="S-1-5-18" />
  </System>
  <EventData>
    <Data Name="Prop_ContainerId">{C8B8F235-0630-11EF-B199-18C04D64ADB7}</Data>
    <Data Name="HRESULT">2147943568</Data>
  </EventData>
</Event>

On previous trials, I also saw events ID 10110 and 10111 but not in this particular run.

Regards,

Benz0X commented 7 months ago

Small updates, I tried on a fresh windows install on a spare drive (but same hardware for the rest), works without a hitch. I'll try to keep investigating. On the failing machine, I did use Ibik Aster (a multiseat software) for a while, maybe it messed up something but it seems to be properly removed (no services running).

ersan commented 7 months ago

Anecdotal, but I was also having issues with instances randomly not starting or starting and then stopping a few moments later and removing Virtual Machine Platform seems to have fixed it. I don't have virtualization enabled at all in BIOS, though - so no memory integrity.

EDIT: Never mind, Duo still has problems any time I try to run more than 4 instances. I get "Failed to apply the display driver patch for Bedroom" errors in the event log over and over again.

Black-Seraph commented 5 months ago

4 instances might be stretching what is physically possible with your graphic card.

Even a RTX4090's hardware encoder starts to struggle when juggling 4+ instances.

ersan commented 5 months ago

4 instances might be stretching what is physically possible with your graphic card.

Even a RTX4090's hardware encoder starts to struggle when juggling 4+ instances.

I'm not trying to run games on all of them at once, just make them available for the various rooms to connect to without having to juggle which one is in use at any given time. In any case, v1.4.6 seems to have fixed the problem.

Obihoernchen commented 5 months ago

Mhh I also get similar errors and the instance just does not start at all.

Metadata staging failed, result=0x80070490 for container '{00000000-0000-0000-FFFF-FFFFFFFFFFFF}'
Failed to apply the display driver patch for XXXXX

The setup guide says:

After the setup finished, wait a minute for Windows' feature installer to catch up, then reboot your computer.

Which windows feature is enabled/disabled during installation?

Any other logs / details I could share to help debugging this?

Black-Seraph commented 4 months ago

@Obihoernchen The feature in question is the HDR compatible RdpIdd driver and is not visible in the Windows feature dialog.

This feature is enabled by default on Windows 11 23H2+ on the latest patch state anyway, but the code is kept in place for older 23H2 builds out there.

This feature install will silently fail on any older Windows version, limiting you to SDR content.

If you're willing I can try and take a look at your computer to see what's wrong.

Just drop me a friend request on discord. My handle is black5eraph.