Skip to content

armgit / WSM

Public Imported from GitHub
0

Run macOS applications on your Windows desktop, with a background runtime and integrated app windows.

C++

Check Windows Hypervisor Platform before setup

mxhm11cr4f4936c8e383
diff --git a/README.md b/README.md
index 614e92f..ce62225 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
<p align="center"><img src="assets/branding/wsm-icon.png" width="128" alt="WSM icon"></p>
<h1 align="center">WSM</h1>
<p align="center"><strong>Windows Subsystem for macOS</strong><br>Like WSL — but for macOS apps.</p>
-<p align="center"><img src="assets/branding/release-badge.svg" alt="Release 0.2.0"> <img src="assets/branding/platform-badge.svg" alt="Windows x64"> <img src="assets/branding/runtime-badge.svg" alt="macOS Tahoe"></p>
+<p align="center"><img src="assets/branding/release-badge.svg" alt="Release 0.2.1"> <img src="assets/branding/platform-badge.svg" alt="Windows x64"> <img src="assets/branding/runtime-badge.svg" alt="macOS Tahoe"></p>
WSM brings macOS applications to your Windows desktop. Inspired by the convenience of WSL, it manages a virtualized macOS runtime in the background and presents supported apps in their own windows alongside your Windows applications.
@@ -9,7 +9,7 @@ After setup, add an app through the WSM library or open a supported Mac installe
> **Compatibility:** Application support and functionality vary; some integrations are still being improved.
-[Download](https://github.com/mxhm11cr/WSM/releases/download/v0.2.0/WSM-Setup-0.2.0.exe) · [Getting started](#getting-started) · [Features](#features) · [Screenshots](#screenshots) · [Performance](#performance) · [How it works](#how-it-works) · [FAQ](#faq)
+[Download](https://github.com/mxhm11cr/WSM/releases/download/v0.2.1/WSM-Setup-0.2.1.exe) · [Getting started](#getting-started) · [Features](#features) · [Screenshots](#screenshots) · [Performance](#performance) · [How it works](#how-it-works) · [FAQ](#faq)
## See it running
@@ -47,7 +47,7 @@ https://github.com/user-attachments/assets/dc418428-faef-4d71-acfd-998a7267f0c0
### Installation
-1. Download [WSM-Setup-0.2.0.exe](https://github.com/mxhm11cr/WSM/releases/download/v0.2.0/WSM-Setup-0.2.0.exe).
+1. Download [WSM-Setup-0.2.1.exe](https://github.com/mxhm11cr/WSM/releases/download/v0.2.1/WSM-Setup-0.2.1.exe).
2. Run the installer and choose where to install WSM.
3. Open WSM and follow the setup wizard to prepare the macOS runtime.
4. Add a supported app or choose a built-in app from the library, then launch it from WSM or its shortcut.
diff --git a/assets/branding/release-badge.svg b/assets/branding/release-badge.svg
index a87989f..4a8d61f 100644
--- a/assets/branding/release-badge.svg
+++ b/assets/branding/release-badge.svg
@@ -1 +1 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="132" height="24" role="img" aria-label="Release 0.2.0"><rect width="132" height="24" rx="5" fill="#1e293b"/><path d="M64 0h63a5 5 0 0 1 5 5v14a5 5 0 0 1-5 5H64z" fill="#2563eb"/><g fill="#fff" font-family="Verdana,Arial,sans-serif" font-size="11" text-anchor="middle"><text x="32" y="16">Release</text><text x="98" y="16">0.2.0</text></g></svg>
+<svg xmlns="http://www.w3.org/2000/svg" width="132" height="24" role="img" aria-label="Release 0.2.1"><rect width="132" height="24" rx="5" fill="#1e293b"/><path d="M64 0h63a5 5 0 0 1 5 5v14a5 5 0 0 1-5 5H64z" fill="#2563eb"/><g fill="#fff" font-family="Verdana,Arial,sans-serif" font-size="11" text-anchor="middle"><text x="32" y="16">Release</text><text x="98" y="16">0.2.1</text></g></svg>
diff --git a/src/wsm-manager/setup.js b/src/wsm-manager/setup.js
index 7282f58..c171649 100644
--- a/src/wsm-manager/setup.js
+++ b/src/wsm-manager/setup.js
@@ -94,6 +94,7 @@ const VIEWS = {
const e = S.env || {};
const reuse = e.reuse_installer;
const lowSpace = !!(e.free_bytes && e.free_bytes < (e.disk_needed_bytes || 40e9));
+ const whpxUnavailable = e.whpx_ready === false;
pane.innerHTML = `
<h2>Ready when you are</h2>
<p class="lede">${reuse
@@ -109,7 +110,14 @@ const VIEWS = {
<p class="fine">By selecting Install you agree to Apple's
<a href="https://www.apple.com/legal/sla/" target="_blank" rel="noopener">macOS Software License Agreement</a>.
WSM downloads macOS directly from Apple and never redistributes it.</p>`;
- foot(["Install", () => { S.accepted = true; startInstall(); }, true, lowSpace], ["Back", () => go("runtime")]);
+ if (whpxUnavailable) {
+ const warning = document.createElement("div"); warning.className = "err";
+ warning.textContent = "Windows Hypervisor Platform is not available. Turn it on in Windows Features and restart Windows. If it still does not work, check virtualization in BIOS/UEFI and ensure the Windows hypervisor can start.";
+ pane.appendChild(warning);
+ }
+ foot(["Install", () => { S.accepted = true; startInstall(); }, true, lowSpace || whpxUnavailable],
+ ...(whpxUnavailable ? [["Check again", async () => { S.env = null; await go("review"); }]] : []),
+ ["Back", () => go("runtime")]);
},
install() {
diff --git a/src/wsm-runtime/include/wsm/provisioner.hpp b/src/wsm-runtime/include/wsm/provisioner.hpp
index aa041f0..e732250 100644
--- a/src/wsm-runtime/include/wsm/provisioner.hpp
+++ b/src/wsm-runtime/include/wsm/provisioner.hpp
@@ -33,6 +33,7 @@ struct ProvSnapshot {
struct ProvPlan {
bool reuse_installer = false;
+ bool whpx_ready = false;
std::string installer_path, macos_name = "macOS Tahoe";
uint64_t download_bytes = 0, disk_needed_bytes = 0, free_bytes = 0;
std::string drive;
diff --git a/src/wsm-runtime/src/provisioner.cpp b/src/wsm-runtime/src/provisioner.cpp
index 52021e5..28d481e 100644
--- a/src/wsm-runtime/src/provisioner.cpp
+++ b/src/wsm-runtime/src/provisioner.cpp
@@ -1,4 +1,5 @@
#include "wsm/provisioner.hpp"
+#include "wsm/host_probe.hpp"
#include "wsm/qmp_unix.hpp"
#include <windows.h>
@@ -105,6 +106,8 @@ std::string Provisioner::to_json() const {
ProvPlan Provisioner::plan() const {
ProvPlan p;
+ const auto whpx = wsm::core::probe_whpx(true);
+ p.whpx_ready = whpx.hypervisor_present && whpx.partition_create_verified;
std::error_code ec;
fs::path inst = fs::path(root_) / "runtime" / "reims-ctl" / "installers";
for (auto& e : fs::directory_iterator(inst, ec)) {
@@ -728,6 +731,12 @@ bool Provisioner::begin(bool license_accepted, std::string& err) {
void Provisioner::run() {
set(ProvState::Preparing, 1, "Checking this PC");
if (!fs::exists(reims_ctl_)) { fail("WSM's runtime components are missing. Reinstall WSM."); return; }
+ const auto whpx = wsm::core::probe_whpx(true);
+ if (!whpx.hypervisor_present || !whpx.partition_create_verified) {
+ log("WHPX preflight failed: " + whpx.error_detail);
+ fail("Windows Hypervisor Platform is not available. Turn it on in Windows Features and restart Windows. If the problem remains, check that hardware virtualization is enabled in BIOS/UEFI and the Windows hypervisor can start.");
+ return;
+ }
if (!step_create_runtime()) return;
if (!step_boot_recovery()) return;
if (!step_install()) return;
diff --git a/src/wsm-runtime/src/wsmd.cpp b/src/wsm-runtime/src/wsmd.cpp
index bce7fdd..594636e 100644
--- a/src/wsm-runtime/src/wsmd.cpp
+++ b/src/wsm-runtime/src/wsmd.cpp
@@ -836,6 +836,7 @@ int main() {
auto p = provisioner.plan();
std::ostringstream o;
o << "{\"reuse_installer\":" << (p.reuse_installer ? "true" : "false")
+ << ",\"whpx_ready\":" << (p.whpx_ready ? "true" : "false")
<< ",\"macos_name\":\"" << json_escape_str(p.macos_name) << "\""
<< ",\"download_bytes\":" << p.download_bytes
<< ",\"disk_needed_bytes\":" << p.disk_needed_bytes