Issue detecting logged on user properly on a vm

I have an install that works on regular hardware but does not seem to detect the logged on user properly on a vm. The install runs and closes down the apps but on the vm it will not show the UI. I noticed one line that was different in the logs from the two machines.

non working UI,
[Initialization] :: There is no console user logged in (user with control of physical monitor, keyboard, and mouse). PSAppDeployToolkit 8/2/2021 12:48:00 PM 2260 (0x08D4)
although a few lines before it says this.
[Initialization] :: The following users are logged on to the system: [AZUREAD\username]. PSAppDeployToolkit 8/2/2021 12:48:00 PM 2260 (0x08D4)

working UI
[Initialization] :: The following user is the console user [AZUREAD\username] (user with control of physical monitor, keyboard, and mouse). PSAppDeployToolkit 8/2/2021 11:56:00 AM 18340 (0x47A4)

What VM SW are you using? Hyper-V?

Are you launching the install the same way on both? (e.g. Manual, SCCM, etc)

If SCCM, is the deployment [Available] or [Required]

Also, I’m assuming:
non working UI = VM
working UI = Physical PC

Sorry should have been more specific.

Hyper-V VM. OS Win 10- 21H1
Physical Machine Win 10 1903

I am using Intune to deploy on both machines, and it is required.

Only of the virtual machine does not pop up the dialog boxes but both will complete successfully.