点击按钮可下载本仓库当前 main 分支的源代码 ZIP;压缩包不含 eNSP、VirtualBox、设备镜像、固件或第三方 DLL。
The buttons download the current main-branch source ZIP only; it does not contain eNSP, VirtualBox, device images, firmware, or third-party DLLs.
这个项目源自一次真实的课程排障:Windows 11 重置后,原本可用的 eNSP 无法再与老师提供的旧版 VirtualBox 5.2 正常协作;而安装 VirtualBox 7 后,eNSP 又会提示版本不受支持,或在启动设备时出现错误码 40。 一次初步配置曾让设备暂时可以运行,但电脑重启后 eNSP 闪退,说明“能启动一次”不足以证明配置可靠。
因此,本仓库把那次排障中可复现的部分整理为独立脚本:先检查环境,再部署兼容层,必要时修复基础 VM, 并始终保留回滚路径。重点不是绕过系统防护或打包受限软件,而是让已经合法安装的软件配置可验证、可维护, 并且能在重启后再次检查其状态。
This project began with a real course-work troubleshooting case. After a Windows 11 reset, an eNSP setup that had worked previously could no longer work with the legacy VirtualBox 5.2 package supplied for the course. Moving to VirtualBox 7 then caused eNSP to report an unsupported version or error code 40 while starting a device. An early configuration worked only temporarily: eNSP crashed on launch after a reboot. That showed that a one-time successful start was not enough.
The repository therefore turns the reproducible parts of that investigation into independent scripts: inspect the environment, deploy the compatibility layer, repair base VMs when needed, and preserve a rollback path. Its purpose is not to bypass Windows protections or redistribute restricted software. It is to make the configuration of legitimately installed software verifiable, maintainable, and checkable again after a restart.
eNSP VBox 7 Helper 是一个独立编写的 PowerShell 工具包,用于检查、部署、修复和回滚 eNSP
与 VirtualBox 7 的兼容层配置。
它不包含华为 eNSP、Oracle VirtualBox、设备镜像、固件、第三方 COM 垫片 DLL 或厂商插件二进制。 使用者应从有权分发的来源自行获取这些依赖项。
部分旧版 eNSP 组件按照 VirtualBox 5.2 的版本和 32 位 COM 接口编写。本项目围绕兼容层提供可重复、 可检查、可回滚的部署流程:
eNSP 32 位组件
-> 用户自行提供且有授权的兼容 DLL
-> Oracle VirtualBox 7.2.x(真实虚拟机引擎)
脚本会:
- 备份将被替换的 DLL 和注册表值;
- 将使用者提供的兼容 DLL 部署到已存在的 eNSP 加载位置;
- 写入 eNSP 所需的 5.2.44 兼容版本信息;
- 设置 32 位 VirtualBox COM CLSID 的兼容 DLL 路径;
- 检查 VirtualBox、基础 VM、
_Link快照和<inaccessible>残留; - 从备份回滚文件和注册表值。
VBoxManage --version 显示 7.2.x 属于正常现象:它报告真实引擎版本,而 eNSP 读取的是兼容版本信息。
环境要求:Windows 10/11、已安装且合法取得的 eNSP、Oracle 官方 VirtualBox 7.2.x,以及一份可合法
使用的 x86 VBox52.dll 兼容 DLL。
将 DLL 放到 payload\VBox52.dll 后,在管理员 PowerShell 中执行:
Set-ExecutionPolicy -Scope Process Bypass
.\scripts\Install-Compatibility.ps1 -Mode Check
.\scripts\Install-Compatibility.ps1 -Mode Install
.\scripts\Test-Compatibility.ps1若基础设备无法启动,先运行只读预览:
.\scripts\Repair-BaseVMs.ps1确认输出无误后才追加 -Apply。此操作只注销明确显示为 <inaccessible> 的旧登记项、重新登记当前
vboxserver 下的基础 VM;不会使用 --delete,不会删除虚拟磁盘。
.\scripts\Restore-Compatibility.ps1若需恢复 VirtualBox 原生 COM 注册,请使用 Oracle 官方安装器的“修复”功能。
本仓库的 PowerShell 源码以 MIT License 发布。项目仅提供原创的部署与诊断脚本;兼容 DLL 和其他 第三方依赖遵循其各自许可证。
eNSP VBox 7 Helper is an independently written PowerShell toolkit for checking, deploying, repairing, and rolling back
the compatibility-layer configuration used by eNSP with VirtualBox 7.
It does not include Huawei eNSP, Oracle VirtualBox, device images, firmware, third-party COM shim DLLs, or patched vendor plug-ins. Obtain every dependency from a source you are authorised to use.
Some legacy eNSP components expect the VirtualBox 5.2 version and 32-bit COM interface. This project supplies a repeatable, inspectable, and reversible workflow around a compatible shim:
32-bit eNSP components
-> a compatible DLL supplied and licensed by the user
-> Oracle VirtualBox 7.2.x (the real VM engine)
The scripts can:
- back up DLLs and registry values before changing them;
- deploy a user-supplied compatibility DLL to existing eNSP load locations;
- write the
5.2.44compatibility version expected by eNSP; - configure the 32-bit VirtualBox COM CLSID compatibility-DLL path;
- inspect VirtualBox, base VMs,
_Linksnapshots, and<inaccessible>leftovers; - restore files and registry values from the generated backup.
Seeing 7.2.x from VBoxManage --version is expected: it reports the real engine, while eNSP reads compatibility
metadata.
Requirements: Windows 10/11, a legitimately installed copy of eNSP, Oracle VirtualBox 7.2.x, and an x86 VBox52.dll
compatibility DLL that you are licensed to use.
Place the DLL at payload\VBox52.dll, then run the following from an elevated PowerShell session:
Set-ExecutionPolicy -Scope Process Bypass
.\scripts\Install-Compatibility.ps1 -Mode Check
.\scripts\Install-Compatibility.ps1 -Mode Install
.\scripts\Test-Compatibility.ps1If base devices fail to start, preview the repair first:
.\scripts\Repair-BaseVMs.ps1Review the output before adding -Apply. The repair only unregisters entries explicitly reported as <inaccessible> and
registers current base VMs below vboxserver; it never uses --delete and does not delete virtual disks.
.\scripts\Restore-Compatibility.ps1Use Oracle's official VirtualBox installer repair option if you also need to restore native COM registration.
The original PowerShell source in this repository is released under the MIT License. Compatibility DLLs and other third-party dependencies remain governed by their own licences.