Hyper-V Fehler

heli100

Level-2
Beiträge
88
Reaktionspunkte
1
Zuviel Werbung?
-> Hier kostenlos registrieren
Hallo;
ich habe von Beckhoff ein virtuelles Schulungsrack; als Zielsystem wird "Lokal" angegeben, allerdings tauchen die Fehlermeldungen im Anhang auf; hat jemand einen Tipp?
Hyper-V ist in den Systemeinstellungen überall deaktiviert, ich arbeite auch nicht mit einer virtuellen Maschine, Fehler bleiben bestehen. Danke
 

Anhänge

Was ist ein "virtuelles Schulungsrack"? Meinst Du die TE170X TC3 Usermode Runtime?

Die musst Du zuerst über "TC-Symbol->System->UmRT_Default (UM)-> Start" starten und dann wählst Du auch nicht "local", sondern "UmRT_Default" aus.

Ist es das, was Du suchst?
 
Zuviel Werbung?
-> Hier kostenlos registrieren
Wenn Du allerdings die echte lokal Runtime starten willst, muss Du im BIOS die Kernvirtualisierung ( Intel® Virtualisierungstechnik (VT-x) ) aktivieren. Die braucht die Runtime. Das mag verwirrend klingen, aber TC braucht die und vermutet, dass die Kernvirtualisierung von Hyper-V oder einer anderen VM belegt ist.
 
Ich habe nun auf einem Stand-PC getestet, mit "Lokal" als Zielsystem, hat sofort geklappt.
Auf Notebooks hingegen bekomme ich die oben beschriebene Fehlermeldung, egal ob im BIOS "Virtualization Technology" aktiviert ist oder nicht.
Vielleicht hat doch noch jemand einen Tipp, danke.
 
Zuviel Werbung?
-> Hier kostenlos registrieren
Ich habe nun auf einem Stand-PC getestet, mit "Lokal" als Zielsystem, hat sofort geklappt.
Auf Notebooks hingegen bekomme ich die oben beschriebene Fehlermeldung, egal ob im BIOS "Virtualization Technology" aktiviert ist oder nicht.
Vielleicht hat doch noch jemand einen Tipp, danke.
Ist auf den Notebooks VirtualBox installiert? Das macht gerne mal Probleme.
In diesem Fall muss der Kern auf dem das PLC Programm läuft isoliert werden, sodass Windows diesen nicht mehr zur Verfügung hat.


-Stirni
 
Da ich mit Hyper-V und Beckhoff auch schon öfters zu kämpfen hatte, habe ich bei uns für die Kollegen einen kleinen Wiki Artikel verfasst, welchen ich hier einfach mal herein kopieren möchte.

Fehlercode 0x1024 deactivate Hyper-V​




Nach der Installation von Virtualisierungslösungen beschwert sich TwinCAT, dass Hyper-V aktiviert sei.

Diese Funktionalität beißt sich mit der Echtzeit von Beckhoff.


Zu beachten:

  • Im Projekt unter Real-Time → Read from Target → den untersten Kern in der Spalte "RT-CPU" anwählen → Set on Target
  • Darauf achten, dass Windows Sub Linux nicht aktiviert ist ( unter "Programme und Features" → "Windows-Features aktivieren oder deaktivieren
  • Darauf achten, dass Hyper-V nicht aktiviert ist ( wie im Schritt oben )
    • Es kann vorkommen, dass dort Hyper-V schon deaktiviert ist, aber es trotzdem nicht funktioniert. Dann folgendes unternehmen:
    • cmd mit Adminrechten öffnen

    • Code:
      bcdedit /set hypervisorlaunchtype off
    • reboot
  • Unter "C:\TwinCAT\3.1\System" die Datei "win8settick.bat" als Administrator ausführen und rebooten

Referenz SPS-Forum.de: [1]

Wenn weiterhin Probleme:

  • Registrierungsschlüssel: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios\CredentialGuard -> Enabled auf 0 einstellen
  • Registrierungsschlüssel: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios\HyperVisorEnforcedCodeIntegrity -> Enabled auf 0 einstellen
 
Ich füge hier ein mir zugespieltes Powershell-Skript ein das die virtualbased Security ausschaltet/ausschalten soll und ein Windows-System für TwinCAT ertüchtigen soll.
Die Original-Quelle ist Beckhoff, der Status definitiv "nicht supported".
Somit "as is" und ohne Gewähr.


Code:
param(
    [switch] $Force = $false
)

function Find-FreeDriveLetter(){
    $reserved="ABCZ".ToCharArray()
    $drvlist=(Get-PSDrive -PSProvider filesystem).Name
    foreach ($drvletter in [char[]](65..90)) {
        if ($drvletter -notin $reserved -and $drvlist -notcontains $drvletter) {
            return "${drvletter}:"
        }
    }
    throw "no free, unreserved drive letters"
}

function DisableFeature($FeatureName) {
    $Feature = Get-WindowsOptionalFeature -FeatureName $FeatureName -Online
    if ($Feature.State -eq 'Disabled') {
        Write-Host "$FeatureName is already disabled"
        return $true;
    }
    if ($Feature) {
        Disable-WindowsOptionalFeature -FeatureName $FeatureName -Online -NoRestart
    }
    return $true;
}


function DisableVBS() {
    $DeviceGuard = Get-CimInstance -ClassName Win32_DeviceGuard -Namespace root\Microsoft\Windows\DeviceGuard

    Write-Host "VirtualizationBasedSecurityStatus $($DeviceGuard.VirtualizationBasedSecurityStatus)"
    if ($DeviceGuard.VirtualizationBasedSecurityStatus -eq 0) {
        Write-Host "VirtualizationBasedSecurityStatus already disabled";
        exit 0
    }

    if (!$Force) {
        do {
            Write-Host 'Configuration of Windows for TwinCAT - especially Deactivation of Virtualization Based Security (VBS) as part of the DeviceGuard

PLEASE NOTE:
The TwinCAT runtime environment cannot be started within a Hyper-V environment. As soon as a component of the computer uses Hyper-V, only the engineering environment (XAE) can be used on this computer, but not the runtime environment (XAR).
In addition to software solutions for virtual machines, Hyper-V can also be used by operating system tools (Device Guard, Credential Guard, VBS,...) or other Hyper-V programs.
Further Information about TwinCAT requirements: https://infosys.beckhoff.com/english.php?content=../content/1033/tc3_overview/6162419083.html

WARNING:
This script helps to configure the system accordingly and will disable VBS, which are critical for protecting your system against advanced threats.
Consultation required: Please consult with your IT department or the end customer before proceeding to ensure this action
aligns with security policies.

PROCEED WITH CAUTION:
Understand the risks and seek guidance if necessary. By continuing, you accept responsibility for these changes.'

            $Confirm = Read-Host -Prompt "Do you want to disable Virtualization Based Security [y/n]"
            if ($Confirm -eq 'n') {
                exit 1
            }
        } while($Confirm -ne 'y')
    }

    # Feature which require a disable
    foreach ($Feature in @('Containers-DisposableClientVM', 'Microsoft-Hyper-V', 'VirtualMachinePlatform', 'Windows-Defender-ApplicationGuard')) {
        if (!(DisableFeature $Feature)) {
            Write-Host "Abort the process"
            exit 1
        }
    }

    # Disable VBS via registry
    New-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Control\DeviceGuard" -Force | Out-Null
    New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\DeviceGuard" `
        -Name "EnableVirtualizationBasedSecurity" `
        -PropertyType DWORD `
        -Value 0 `
        -Force | Out-Null

    # Disable VBS when UEFI lock might be set
    $FreeDrive = Find-FreeDriveLetter
    & mountvol $FreeDrive /s
    try {
        Copy-Item 'C:\Windows\System32\SecConfig.efi' "$FreeDrive\EFI\Microsoft\Boot\SecConfig.efi" -Force
        & bcdedit /create { 0cb3b571-2f2e-4343-a879-d86a476d7215 } /d "DisableVBS" /application osloader
        & bcdedit /set { 0cb3b571-2f2e-4343-a879-d86a476d7215 } path '\EFI\Microsoft\Boot\SecConfig.efi'
        & bcdedit /set { bootmgr } bootsequence { 0cb3b571-2f2e-4343-a879-d86a476d7215 }
        & bcdedit /set {0cb3b571-2f2e-4343-a879-d86a476d7215} loadoptions DISABLE-LSA-ISO,DISABLE-VBS
        & bcdedit /set vsmlaunchtype off
        & bcdedit /set { 0cb3b571-2f2e-4343-a879-d86a476d7215 } device partition=$FreeDrive
    }
    finally {
        & mountvol $FreeDrive /d
    }

    # Disable Core Isolation
    New-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios\HypervisorEnforcedCodeIntegrity" -Force | Out-Null
    New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios\HypervisorEnforcedCodeIntegrity" `
        -Name "Enabled" `
        -PropertyType DWORD `
        -Value 0 `
        -Force | Out-Null
}

DisableVBS
Write-Host "Please restart your PC"
 
Zuviel Werbung?
-> Hier kostenlos registrieren
Hast du die Registry Einträge ebenfalls editiert und es damit versucht?
Die Tage wurde durch ein Windows-Update wundersamerweise wieder der Fehler 0x1024 ausgespuckt. Bin dann meine Liste nach und nach durch und erst beim Schauen in die Registry wurde klar, dass die beiden Werte wieder zurückgesetzt wurden. Beide abgenullt und siehe da, lief wieder.
 
Steht doch oben in meinem Block.

  • Code:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios\CredentialGuard
    -> Enabled auf 0 einstellen
  • Code:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios\HyperVisorEnforcedCodeIntegrity
    -> BlockAutoenablement auf 0 einstellen
 
Zurück
Oben