canonical / multipass

Multipass orchestrates virtual Ubuntu instances
https://multipass.run
GNU General Public License v3.0
7.7k stars 638 forks source link

Multipass fails to detect hyper-v capability when screen reader is enabled #1632

Open ricab opened 4 years ago

ricab commented 4 years ago

You get this warning from PowerShell if you are running a screen reader (which I am) upon startup: "Warning: PowerShell detected that you might be using a screen reader and has disabled PSReadLine for compatibility purposes. If you want to re-enable it, run 'Import-Module PSReadLine'." See below [2020-07-03T21:53:14.577] [debug] [Hyper-V Health Check] powershell arguments '-NoExit, -Command, -' [2020-07-03T21:53:14.577] [debug] [Hyper-V Health Check] powershell working dir '' [2020-07-03T21:53:14.577] [debug] [Hyper-V Health Check] powershell program 'powershell.exe' [2020-07-03T21:53:14.577] [debug] [Hyper-V Health Check] powershell state changed to Starting [2020-07-03T21:53:14.579] [debug] [Hyper-V Health Check] powershell state changed to Running [2020-07-03T21:53:14.580] [debug] [Hyper-V Health Check] powershell started [2020-07-03T21:53:14.580] [trace] [Hyper-V Health Check] cmdlet: 'Get-ItemProperty -Path 'HKLM:\Software\Microsoft\Windows NT\CurrentVersion' | Select-Object -ExpandProperty CurrentMajorVersionNumber' [2020-07-03T21:53:15.041] [trace] [Hyper-V Health Check] Warning: PowerShell detected that you might be using a screen reader and has disabled PSReadLine for compatibility purposes. If you want to re-enable it, run 'Import-Module PSReadLine'. 10 [2020-07-03T21:53:15.042] [trace] [Hyper-V Health Check] cmdlet exit status is 'true' [2020-07-03T21:53:15.065] [debug] [Hyper-V Health Check] powershell state changed to NotRunning [2020-07-03T21:53:15.065] [debug] [Hyper-V Health Check] powershell finished with exit code 0 launch failed: Multipass support for Hyper-V requires Windows 10 [2020-07-03T21:53:15.118] [warning] [winterm] Could not find Windows Terminal's settings; location: ""; reason: File not found.

Originally posted by @zuhairmahd in https://github.com/canonical/multipass/issues/1341#issuecomment-653707676

ricab commented 4 years ago

We should probably add -WarningAction:SilentlyContinue.

ricab commented 3 years ago

Except that we could be hiding important info...

I believe the right thing would be to read PS's stdout and stderr separately (stop using QProcess::MergedChannels), then log stderr but return stdout when commands complete successfully (include stderr in exceptions otherwise).

AndisGrossteins commented 3 weeks ago

Is there any progress on this issue? There are multiple issue reports marked as duplicates of this one and @ricab seems to have devised a possible fix. Yet four years later I'm frustrated by this silly issue of multipass unable to handle unexpected output from an external command.

I worked around the issue by setting PowerShell execution policy to Bypass but I'm still baffled where the error messages about PSReadline comes from and couldn't reproduce same output by executing powershell.exe with same parameters in terminal.

ricab commented 3 weeks ago

Hi @AndisGrossteins, sorry that this is affecting you. We are a small team, we need to prioritize things, and we've been unable to allocate more attention here, but we'll try to give this new consideration for the next feature release.