[BUG] [Local Fix and Code Suggestion] [Co-work RCP -1]
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Summary
The Cowork VM experiences recurring RPC error -1: failed to ensure virtiofs mount: Plan9 mount failed: bad address errors on session startup. These failures are caused by stale HCS (Host Compute Service) state left behind from unclean VM shutdowns. The root cause appears to be a malformed JSON document sent by cowork-svc during VM shutdown, which prevents HCS from cleanly releasing VirtioFS mount state.
The failure is recoverable by restarting the vmcompute service, but Claude Desktop does not attempt this — instead it cycles through retry/reinstall, which often triggers secondary "VM is already running" race conditions.
What Should Happen?
Co-work should write the proper JSON to close the stale sessions.
Error Messages/Logs
Steps to Reproduce
Failure Sequence (Typical)
The following sequence repeats on approximately 80% of Cowork session startups:
- User starts a new Cowork session
- cowork-svc attempts to spawn VM process
- VirtioFS mount fails due to stale state from prior session:
"RPC error -1: failed to ensure virtiofs mount: Plan9 mount failed: bad address"
- Claude Desktop retries spawn (same failure)
- On retry, a second startup call fires before the first is cleaned up:
"VM is already running"
- Auto-reinstall triggers (deletes workspace, preserves sessiondata)
- Eventually succeeds after 1-3 more attempts (30-60 second delay)
Impact: Every Cowork session start is delayed 30-60 seconds. Workspace files (installed tools, custom configurations) are periodically destroyed by unnecessary auto-reinstall cycles.
Also occurs after long task sessions directly after starting up for a new prompt.
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
1.1.5368.0
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
<html>
<body>
<!--StartFragment--><h2 class="text-text-100 mt-3 -mb-1 text-[1.125rem] font-bold">Root Cause Analysis</h2>
<h3 class="text-text-100 mt-2 -mb-1 text-base font-bold">1. Malformed HCS Shutdown (Primary Cause)</h3>
<p class="font-claude-response-body break-words whitespace-normal leading-[1.7]">The Windows Event Log (<code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">Microsoft-Windows-Hyper-V-Compute-Admin</code>, EventID 11001) records the following error on <strong>every VM shutdown</strong>:</p>
<div class="relative group/copy bg-bg-000/50 border-0.5 border-border-400 rounded-lg"><div class="sticky opacity-0 group-hover/copy:opacity-100 top-2 py-2 h-12 w-0 float-right"><div class="absolute right-0 h-8 px-2 items-center inline-flex z-10"><button class="inline-flex
items-center
justify-center
relative
shrink-0
can-focus
select-none
disabled:pointer-events-none
disabled:opacity-50
disabled:shadow-none
disabled:drop-shadow-none border-transparent
transition
font-base
duration-300
ease-[cubic-bezier(0.165,0.85,0.45,1)] h-8 w-8 rounded-md active:scale-95 backdrop-blur-md Button_ghost__BUAoh" type="button" aria-label="Copy to clipboard" data-state="closed"><div class="relative"><div class="transition-all opacity-100 scale-100" style="width: 20px; height: 20px; display: flex; align-items: center; justify-content: center;"><svg width="20" height="20" viewBox="0 0 20 20" fill="currentColor" xmlns="http://www.w3.org/2000/svg" class="transition-all opacity-100 scale-100" aria-hidden="true" style="flex-shrink: 0;"><path d="M12.5 3C13.3284 3 14 3.67157 14 4.5V6H15.5C16.3284 6 17 6.67157 17 7.5V15.5C17 16.3284 16.3284 17 15.5 17H7.5C6.67157 17 6 16.3284 6 15.5V14H4.5C3.67157 14 3 13.3284 3 12.5V4.5C3 3.67157 3.67157 3 4.5 3H12.5ZM14 12.5C14 13.3284 13.3284 14 12.5 14H7V15.5C7 15.7761 7.22386 16 7.5 16H15.5C15.7761 16 16 15.7761 16 15.5V7.5C16 7.22386 15.7761 7 15.5 7H14V12.5ZM4.5 4C4.22386 4 4 4.22386 4 4.5V12.5C4 12.7761 4.22386 13 4.5 13H12.5C12.7761 13 13 12.7761 13 12.5V4.5C13 4.22386 12.7761 4 12.5 4H4.5Z"></path></svg></div><div class="absolute inset-0 flex items-center justify-center"><div class="transition-all opacity-0 scale-50" style="width: 20px; height: 20px; display: flex; align-items: center; justify-content: center;"><svg width="20" height="20" viewBox="0 0 20 20" fill="currentColor" xmlns="http://www.w3.org/2000/svg" class="transition-all opacity-0 scale-50" aria-hidden="true" style="flex-shrink: 0;"><path d="M15.1883 5.10908C15.3699 4.96398 15.6346 4.96153 15.8202 5.11592C16.0056 5.27067 16.0504 5.53125 15.9403 5.73605L15.8836 5.82003L8.38354 14.8202C8.29361 14.9279 8.16242 14.9925 8.02221 14.9989C7.88203 15.0051 7.74545 14.9526 7.64622 14.8534L4.14617 11.3533L4.08172 11.2752C3.95384 11.0811 3.97542 10.817 4.14617 10.6463C4.31693 10.4755 4.58105 10.4539 4.77509 10.5818L4.85321 10.6463L7.96556 13.7586L15.1161 5.1794L15.1883 5.10908Z"></path></svg></div></div></div></button></div></div><div class="overflow-x-auto"><pre class="code-block__code !my-0 !rounded-lg !text-sm !leading-relaxed p-3.5" style="color: rgb(20, 24, 31); background: transparent; font-family: var(--font-mono);"><code style="color: rgb(20, 24, 31); background: transparent; font-family: var(--font-mono); white-space: pre-wrap;"><span><span>The specified property query is invalid: The virtual machine or container
</span></span><span>JSON document is invalid. (0xC037010D, 'Invalid JSON document '$'').</span></code></pre></div></div>
<p class="font-claude-response-body break-words whitespace-normal leading-[1.7]">This indicates <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">cowork-svc</code> is sending a bare <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">$</code> character as a JSON property query to HCS during the VM's shutdown/cleanup sequence. HCS fails to parse this, and the cleanup does not complete fully — leaving stale VirtioFS mount references in the vmcompute service's internal state.</p>
<p class="font-claude-response-body break-words whitespace-normal leading-[1.7]">See: <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">hcs_admin_errors.txt</code> — every Event 11001 shows the same <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">Invalid JSON document '$'</code> pattern.</p>
<h3 class="text-text-100 mt-2 -mb-1 text-base font-bold">2. Stale State Persists Across Sessions</h3>
<p class="font-claude-response-body break-words whitespace-normal leading-[1.7]">Because the shutdown cleanup fails, the next session's VirtioFS mount attempt encounters corrupt state in vmcompute's internal mount table. The mount call returns <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">HRESULT 0xC0370103</code> (bad address), which surfaces as the <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">RPC error -1: Plan9 mount failed: bad address</code> error in Claude's logs.</p>
<h3 class="text-text-100 mt-2 -mb-1 text-base font-bold">3. Retry Logic Creates Race Condition</h3>
<p class="font-claude-response-body break-words whitespace-normal leading-[1.7]">When the initial spawn fails, Claude Desktop's retry logic can fire a second <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">create</code> call before the first failed attempt's cleanup completes, producing the <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">VM is already running</code> error. This cascade sometimes triggers 3-5 retries before succeeding.</p>
<h3 class="text-text-100 mt-2 -mb-1 text-base font-bold">4. Recovery Is Simple But Not Attempted</h3>
<p class="font-claude-response-body break-words whitespace-normal leading-[1.7]">Restarting the <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">vmcompute</code> service clears the stale VirtioFS state entirely:</p>
<div class="relative group/copy bg-bg-000/50 border-0.5 border-border-400 rounded-lg"><div class="sticky opacity-0 group-hover/copy:opacity-100 top-2 py-2 h-12 w-0 float-right"><div class="absolute right-0 h-8 px-2 items-center inline-flex z-10"><button class="inline-flex
items-center
justify-center
relative
shrink-0
can-focus
select-none
disabled:pointer-events-none
disabled:opacity-50
disabled:shadow-none
disabled:drop-shadow-none border-transparent
transition
font-base
duration-300
ease-[cubic-bezier(0.165,0.85,0.45,1)] h-8 w-8 rounded-md active:scale-95 backdrop-blur-md Button_ghost__BUAoh" type="button" aria-label="Copy to clipboard" data-state="closed"><div class="relative"><div class="transition-all opacity-100 scale-100" style="width: 20px; height: 20px; display: flex; align-items: center; justify-content: center;"><svg width="20" height="20" viewBox="0 0 20 20" fill="currentColor" xmlns="http://www.w3.org/2000/svg" class="transition-all opacity-100 scale-100" aria-hidden="true" style="flex-shrink: 0;"><path d="M12.5 3C13.3284 3 14 3.67157 14 4.5V6H15.5C16.3284 6 17 6.67157 17 7.5V15.5C17 16.3284 16.3284 17 15.5 17H7.5C6.67157 17 6 16.3284 6 15.5V14H4.5C3.67157 14 3 13.3284 3 12.5V4.5C3 3.67157 3.67157 3 4.5 3H12.5ZM14 12.5C14 13.3284 13.3284 14 12.5 14H7V15.5C7 15.7761 7.22386 16 7.5 16H15.5C15.7761 16 16 15.7761 16 15.5V7.5C16 7.22386 15.7761 7 15.5 7H14V12.5ZM4.5 4C4.22386 4 4 4.22386 4 4.5V12.5C4 12.7761 4.22386 13 4.5 13H12.5C12.7761 13 13 12.7761 13 12.5V4.5C13 4.22386 12.7761 4 12.5 4H4.5Z"></path></svg></div><div class="absolute inset-0 flex items-center justify-center"><div class="transition-all opacity-0 scale-50" style="width: 20px; height: 20px; display: flex; align-items: center; justify-content: center;"><svg width="20" height="20" viewBox="0 0 20 20" fill="currentColor" xmlns="http://www.w3.org/2000/svg" class="transition-all opacity-0 scale-50" aria-hidden="true" style="flex-shrink: 0;"><path d="M15.1883 5.10908C15.3699 4.96398 15.6346 4.96153 15.8202 5.11592C16.0056 5.27067 16.0504 5.53125 15.9403 5.73605L15.8836 5.82003L8.38354 14.8202C8.29361 14.9279 8.16242 14.9925 8.02221 14.9989C7.88203 15.0051 7.74545 14.9526 7.64622 14.8534L4.14617 11.3533L4.08172 11.2752C3.95384 11.0811 3.97542 10.817 4.14617 10.6463C4.31693 10.4755 4.58105 10.4539 4.77509 10.5818L4.85321 10.6463L7.96556 13.7586L15.1161 5.1794L15.1883 5.10908Z"></path></svg></div></div></div></button></div></div><div class="text-text-500 font-small p-3.5 pb-0">powershell</div><div class="overflow-x-auto"><pre class="code-block__code !my-0 !rounded-lg !text-sm !leading-relaxed p-3.5" style="color: rgb(20, 24, 31); background: transparent; font-family: var(--font-mono);"><code class="language-powershell" style="color: rgb(20, 24, 31); background: transparent; font-family: var(--font-mono); white-space: pre;"><span><span class="token token" style="color: rgb(0, 81, 194);">Stop-Service</span><span> vmcompute </span><span class="token token" style="color: rgb(20, 24, 31);">-</span><span>Force
</span></span><span><span></span><span class="token token" style="color: rgb(0, 81, 194);">Start-Sleep</span><span> </span><span class="token token" style="color: rgb(20, 24, 31);">-</span><span>Seconds 3
</span></span><span><span></span><span class="token token" style="color: rgb(0, 81, 194);">Start-Service</span><span> vmcompute
</span></span><span><span></span><span class="token token" style="color: rgb(110, 118, 135);"># Next spawn succeeds immediately</span></span></code></pre></div></div>
<p class="font-claude-response-body break-words whitespace-normal leading-[1.7]">This takes ~5 seconds and preserves all workspace data. Claude Desktop does not attempt this before falling back to workspace reinstallation.</p>
<hr class="border-border-200 border-t-0.5 my-3 mx-1.5">
<h2 class="text-text-100 mt-3 -mb-1 text-[1.125rem] font-bold">Error Statistics (from logs)</h2>
<div class="overflow-x-auto w-full px-2 mb-6">
Metric | Count
-- | --
Days with Plan9 failures | 18 (consecutive, 2026-02-16 to 2026-03-06)
Total "Plan9 mount failed" errors | 104
Total "RPC error -1" errors | 696
Total "VM is already running" errors | 36
HCS shutdown JSON errors (Event 11001) | Every single shutdown
</div>
<hr class="border-border-200 border-t-0.5 my-3 mx-1.5">
<h2 class="text-text-100 mt-3 -mb-1 text-[1.125rem] font-bold">Workaround</h2>
<p class="font-claude-response-body break-words whitespace-normal leading-[1.7]">We have deployed a two-layer workaround on this system:</p>
<ol class="[li_&]:mb-0 [li_&]:mt-1 [li_&]:gap-1 [&:not(:last-child)_ul]:pb-1 [&:not(:last-child)_ol]:pb-1 list-decimal flex flex-col gap-1 pl-8 mb-3">
<li class="whitespace-normal break-words pl-2"><strong>Proactive cleanup</strong> (scheduled task at login): Checks for stale HCS containers and restarts vmcompute if needed, before Claude Desktop starts.</li>
<li class="whitespace-normal break-words pl-2"><strong>Reactive watchdog</strong> (background process): Monitors <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">cowork_vm_node.log</code> for Plan9 failures and auto-triggers vmcompute recovery.</li>
</ol>
<p class="font-claude-response-body break-words whitespace-normal leading-[1.7]">These workarounds prevent the startup failures but don't address the root cause (malformed JSON in shutdown sequence).</p><!--EndFragment-->
</body>
</html>
claude_desktop_plan9_errors.txt
hcs_admin_errors.txt
hcs_admin_full_timeline.txt
system_info.txt
vm_node_plan9_incidents.txt
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗