launching MSB through VSCODE + MCP server
As discussed in #1426 :
- i also encountered that bug (0.6.12 not working, not even from CLI, 0.6.9 fully working in CLI)
- at the same time, i've not been able to use from VSCODE the MSB MCP server, even (see the JSON configuration below) when reconfiguring everything with 0.6.9 version
- downgrade of the MSB_PATH
- downgrade of the NPX MCP version
- for now i'll pause these investigations and await for 0.6.14
- creating this issue for reference / in case it would help, as requested in #1426
AI summary of the investigations below.
Microsandbox + MCP on Windows: Investigation Summary
Context
The objective was to configure GitHub Copilot Agent Mode in VS Code to execute commands inside Microsandbox (MSB) microVMs instead of running commands directly on the Windows host.
Environment
- Windows 11
- VS Code with Copilot Agent Mode (
Ask / Plan / Agent) - Microsandbox CLI (
msb) v0.6.9 - Microsandbox MCP Server v0.6.9
- Node.js v26.7.0
- MCP configured through VS Code
MCP Configuration
{
"servers": {
"MSB": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"[email protected]"
],
"env": {
"MSB_PATH": "C:\\Users\\<REDACTED>\\scoop\\apps\\microsandbox\\0.6.9\\msb.exe"
}
}
}
}Initial Observation
VS Code successfully connects to the MCP server:
Starting server MSB
Connection state: Running
Discovered 69 toolsThis confirms:
- ✅ MCP server starts successfully
- ✅ VS Code communicates correctly with MCP
- ✅ Copilot Agent discovers Microsandbox tools
Runtime Validation
The MCP runtime check returned:
{
"ok": true,
"data": {
"installed": true,
"serverVersion": "0.6.9",
"nodeVersion": "v26.7.0",
"platform": "win32",
"arch": "x64",
"msbPath": "C:\\Users\\<REDACTED>\\scoop\\apps\\microsandbox\\0.6.9\\msb.exe",
"libkrunfwPath": null,
"hostPathPolicy": "allowlist",
"hostPaths": [
"C:\\Users\\<REDACTED>"
],
"dangerousEnabled": false
}
}This confirms:
- ✅ MCP detects the expected
msb.exe - ✅ Runtime installation is considered healthy
- ✅ MCP and runtime versions match (0.6.9)
However:
- ⚠️
libkrunfwPathremainsnull
MSB Runtime Works Correctly
Direct CLI execution succeeds repeatedly:
msb run ubuntu -- uname -aOutput:
Linux msb-xxxxxxxx 6.12.99 ...This validates:
- ✅ Windows Hypervisor Platform
- ✅ MSB runtime
- ✅ Ubuntu image
- ✅ Agent runtime inside the VM
- ✅ Command execution
MCP Failure Symptoms
Ephemeral Sandbox Execution
Copilot uses:
mcp_microsandbox_sandbox_runwith parameters:
{
"image": "ubuntu:24.04",
"command": "uname -a"
}Failure:
The first sandbox boot failed before command execution.Sandbox Creation
Copilot then attempted:
mcp_microsandbox_sandbox_createFailure:
sandbox process exited (exit code: 0)
before agent relay became availableSandbox Execution
Copilot subsequently attempted:
mcp_microsandbox_sandbox_execFailure:
runtime error:
sandbox startup timeout:
no JSON received within 30 secondsContradictory Behaviour
Despite MCP reporting failures, the supposedly failed sandboxes still exist.
Example:
msb listreturned:
mcp-run-xxxxxxxxxxxx ubuntu:24.04 runningInspection:
msb inspect mcp-run-xxxxxxxxxxxxreturned:
Status: running
Image: ubuntu:24.04
CPUs: 1
Memory: 512 MiBAnd direct command execution succeeds:
msb exec mcp-run-xxxxxxxxxxxx -- uname -aOutput:
Linux mcp-run-xxxxxxxxxxxx ...Key Finding
The Microsandbox MCP layer reports:
Sandbox failed to startwhile the underlying runtime proves:
Sandbox exists
Sandbox is running
Sandbox accepts commands
Sandbox returns outputThe actual microVM is healthy.
The failure appears to occur in the MCP bootstrap / relay detection process rather than in the VM itself.
Available MCP Tools
Copilot exposes dedicated Microsandbox tools, including:
mcp_microsandbox_sandbox_run
mcp_microsandbox_sandbox_create
mcp_microsandbox_sandbox_exec
mcp_microsandbox_sandbox_shell
mcp_microsandbox_runtime_check
mcp_microsandbox_runtime_installNeither:
sandbox_runnor:
sandbox_create + sandbox_execsucceeded from Copilot, despite the resulting sandboxes being operational from the CLI.
Most Significant Error
The most informative error observed was:
sandbox process exited (exit code: 0)
before agent relay became availablefollowed by:
sandbox startup timeout:
no JSON received within 30 secondsThis strongly suggests a failure in:
Microsandbox MCP
↕
Agent relay
↕
JSON RPC/bootstrap protocolrather than a failure of:
Hyper-V
MSB runtime
Ubuntu image
VM startup
Command executionValidation of Runtime Components
Runtime files are present and correctly installed:
C:\Users\<REDACTED>\scoop\apps\microsandbox\0.6.9\msb.exe
C:\Users\<REDACTED>\scoop\apps\microsandbox\0.6.9\libkrunfw.dllDirectory contents:
libkrunfw.dll
msb.exe
install.json
manifest.jsonThe CLI successfully uses these components.
Conclusions
Confirmed Working
- ✅ VS Code MCP integration
- ✅ GitHub Copilot Agent Mode
- ✅ Microsandbox CLI
- ✅ MSB runtime v0.6.9
- ✅ Ubuntu images
- ✅ MicroVM creation
- ✅ Command execution from CLI
- ✅ Existing sandbox lifecycle
- ✅ Execution inside MCP-created sandboxes via CLI
- ✅ Explicit MCP runtime detection (
msbPathresolved correctly)
Confirmed Failing
- ❌ MCP bootstrap readiness detection
- ❌ Agent relay availability detection
- ❌ MCP command execution path
- ❌ MCP sandbox startup validation
- ❌ MCP JSON bootstrap initialization
Final Assessment
All evidence points to a bug in the Microsandbox MCP / SDK Windows integration layer, specifically around:
agent relay startup
bootstrap readiness detection
JSON protocol initializationThe microVMs themselves are functioning correctly.
The issue is reproducible because:
- MCP reports sandbox startup failures.
- The same sandbox remains running.
- Direct
msb execagainst that sandbox succeeds.
This indicates a discrepancy between the MCP bootstrap validation mechanism and the actual operational state of the sandbox.
Current Status
Investigation paused pending resolution of upstream issue #1426.
The recommended path forward is to wait for an upstream fix and then retest with aligned versions of:
msb
microsandbox-mcp
Microsandbox SDKsince the underlying runtime has already been validated successfully.
Source: superradcompany/microsandbox