VMware Workstation and Device/Credential Guard are not compatible

前端 未结 13 1623
别跟我提以往
别跟我提以往 2020-12-22 15:10

I have been running VMware for the last year no problems, today I opened it up to start one of my VM and get an error message, see screen shot.

I did follow

13条回答
  •  北荒
    北荒 (楼主)
    2020-12-22 15:28

    For those who might be encountering this issue with recent changes to your computer involving Hyper-V, you'll need to disable it while using VMWare or VirtualBox. They don't work together. Windows Sandbox and WSL 2 need the Hyper-V Hypervisor on, which currently breaks VMWare. Basically, you'll need to run the following commands to enable/disable Hyper-V services on next reboot.

    To disable Hyper-V and get VMWare working, in PowerShell as Admin:

    bcdedit /set hypervisorlaunchtype off
    

    To re-enable Hyper-V and break VMWare for now, in PowerShell as Admin:

    bcdedit /set hypervisorlaunchtype auto
    

    You'll need to reboot after that. I've written a PowerShell script that will toggle this for you and confirm it with dialog boxes. It even self-elevates to Administrator using this technique so that you can just right click and run the script to quickly change your Hyper-V mode. It could easily be modified to reboot for you as well, but I personally didn't want that to happen. Save this as hypervisor.ps1 and make sure you've run Set-ExecutionPolicy RemoteSigned so that you can run PowerShell scripts.

    # Get the ID and security principal of the current user account
    $myWindowsID = [System.Security.Principal.WindowsIdentity]::GetCurrent();
    $myWindowsPrincipal = New-Object System.Security.Principal.WindowsPrincipal($myWindowsID);
    
    # Get the security principal for the administrator role
    $adminRole = [System.Security.Principal.WindowsBuiltInRole]::Administrator;
    
    # Check to see if we are currently running as an administrator
    if ($myWindowsPrincipal.IsInRole($adminRole))
    {
        # We are running as an administrator, so change the title and background colour to indicate this
        $Host.UI.RawUI.WindowTitle = $myInvocation.MyCommand.Definition + "(Elevated)";
        $Host.UI.RawUI.BackgroundColor = "DarkBlue";
        Clear-Host;
    }
    else {
        # We are not running as an administrator, so relaunch as administrator
    
        # Create a new process object that starts PowerShell
        $newProcess = New-Object System.Diagnostics.ProcessStartInfo "PowerShell";
    
        # Specify the current script path and name as a parameter with added scope and support for scripts with spaces in it's path
        $newProcess.Arguments = "-windowstyle hidden & '" + $script:MyInvocation.MyCommand.Path + "'"
    
        # Indicate that the process should be elevated
        $newProcess.Verb = "runas";
    
        # Start the new process
        [System.Diagnostics.Process]::Start($newProcess);
    
        # Exit from the current, unelevated, process
        Exit;
    }
    
    Add-Type -AssemblyName System.Windows.Forms
    
    
    $state = bcdedit /enum | Select-String -Pattern 'hypervisorlaunchtype\s*(\w+)\s*'
    
    
    if ($state.matches.groups[1].ToString() -eq "Off"){
    
        $UserResponse= [System.Windows.Forms.MessageBox]::Show("Enable Hyper-V?" , "Hypervisor" , 4)
    
        if ($UserResponse -eq "YES" ) 
        {
    
            bcdedit /set hypervisorlaunchtype auto
            [System.Windows.Forms.MessageBox]::Show("Enabled Hyper-V. Reboot to apply." , "Hypervisor")
    
        } 
    
        else 
    
        { 
    
            [System.Windows.Forms.MessageBox]::Show("No change was made." , "Hypervisor")
            exit
    
        }
    
    } else {
    
        $UserResponse= [System.Windows.Forms.MessageBox]::Show("Disable Hyper-V?" , "Hypervisor" , 4)
    
        if ($UserResponse -eq "YES" ) 
        {
    
            bcdedit /set hypervisorlaunchtype off
            [System.Windows.Forms.MessageBox]::Show("Disabled Hyper-V. Reboot to apply." , "Hypervisor")
    
        } 
    
        else 
    
        { 
    
            [System.Windows.Forms.MessageBox]::Show("No change was made." , "Hypervisor")
            exit
    
        }
    
    }
    

提交回复
热议问题