claude-code - 💡(How to fix) Fix [BUG] CoworkVMService stops silently on Windows — app crash-loops with no recovery path [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#47147Fetched 2026-04-13 05:40:12
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×4commented ×1

Error Message

19:16:47 [info] Successfully run onQuitCleanup: cowork-vm-shutdown ← last success 19:26:45 [error] Sentry caught (x5) ← crash-restart #1 19:36:09 [error] Sentry caught (x5) ← crash-restart #2 19:38:09 [error] Sentry caught (x4) ← crash-restart #3 19:41:09 [error] Sentry caught (x5) ← crash-restart #4 19:45:02 [error] Sentry caught (x5) ← crash-restart #5 19:51:12 [error] Failed to run onQuitCleanup(cowork-vm-shutdown): Error: VM service not running. The service failed to start. 20:02:20 [warn] [HostLoop] VM boot failed; bash proxy unavailable: VM service not running. 20:15:49 – 20:31:41 ← 11 more VM boot failures in succession 21:01:05 [error] Still failing at end of session

Fix Action

Workaround

Added to the existing scheduled task (ClearCoworkVMs) that runs hourly:

# Also restart the service if it's stopped
$svc = Get-Service -Name 'CoworkVMService' -ErrorAction SilentlyContinue
if ($svc -and $svc.Status -ne 'Running') {
    Start-Service -Name 'CoworkVMService' -ErrorAction SilentlyContinue
}

This mitigates but doesn't eliminate the issue (can still hit it between hourly checks).


Code Example

19:16:47 [info] Successfully run onQuitCleanup: cowork-vm-shutdown  ← last success
19:26:45 [error] Sentry caught (x5)  ← crash-restart #1
19:36:09 [error] Sentry caught (x5)  ← crash-restart #2
19:38:09 [error] Sentry caught (x4)  ← crash-restart #3
19:41:09 [error] Sentry caught (x5)  ← crash-restart #4
19:45:02 [error] Sentry caught (x5)  ← crash-restart #5
19:51:12 [error] Failed to run onQuitCleanup(cowork-vm-shutdown): Error: VM service not running. The service failed to start.
20:02:20 [warn] [HostLoop] VM boot failed; bash proxy unavailable: VM service not running.
20:15:4920:31:4111 more VM boot failures in succession
21:01:05 [error] Still failing at end of session

---

10:09:17 [error] Failed to run onQuitCleanup(cowork-vm-shutdown): VM service not running.
10:11:15 [error] Session initialization failed: VM service not running.
10:13:05 [error] Sentry caught (x7)

---

20:38:40 [error] Failed to run onQuitCleanup(cowork-vm-shutdown): VM service not running.
20:39:27 [error] Session initialization failed: VM service not running.
20:39:49 [error] Session initialization failed: VM service not running.
20:41:10 [error] Sentry caught (x5)

---

PS> Get-Service CoworkVMService
# Status: Stopped, StartType: Automatic

PS> Start-Service CoworkVMService
# Cowork immediately works

---

# Also restart the service if it's stopped
$svc = Get-Service -Name 'CoworkVMService' -ErrorAction SilentlyContinue
if ($svc -and $svc.Status -ne 'Running') {
    Start-Service -Name 'CoworkVMService' -ErrorAction SilentlyContinue
}
RAW_BUFFERClick to expand / collapse

Bug Description

The CoworkVMService Windows service stops on its own during normal use. When this happens, every attempt to open Cowork triggers a crash-restart cycle — the app fires cowork-vm-shutdown, which fails ("VM service not running"), then Sentry errors fire, and the app relaunches. This loops indefinitely with no recovery.

The service is set to StartType: Automatic but does not auto-restart after stopping. The only fix is manually running Start-Service CoworkVMService in an elevated PowerShell — but there is no UI indication that this is the problem.

Related

  • #43534 — same user, different failure mode (stale VM survives Windows Fast Startup)
  • #29941 — CoworkVMService fails to start due to signature verification
  • #27801 — "Failed to start Claude's workspace" — VM service not running

Log Evidence

Apr 9: First occurrence — 5 crash cycles + 30 min of continuous failures

The service died at ~19:26. The app crashed and restarted 5 times in 19 minutes, then spent 30 minutes continuously failing to boot the VM:

19:16:47 [info] Successfully run onQuitCleanup: cowork-vm-shutdown  ← last success
19:26:45 [error] Sentry caught (x5)  ← crash-restart #1
19:36:09 [error] Sentry caught (x5)  ← crash-restart #2
19:38:09 [error] Sentry caught (x4)  ← crash-restart #3
19:41:09 [error] Sentry caught (x5)  ← crash-restart #4
19:45:02 [error] Sentry caught (x5)  ← crash-restart #5
19:51:12 [error] Failed to run onQuitCleanup(cowork-vm-shutdown): Error: VM service not running. The service failed to start.
20:02:20 [warn] [HostLoop] VM boot failed; bash proxy unavailable: VM service not running.
20:15:49 – 20:31:41  ← 11 more VM boot failures in succession
21:01:05 [error] Still failing at end of session

Apr 12: Two separate incidents (morning + evening)

Morning:

10:09:17 [error] Failed to run onQuitCleanup(cowork-vm-shutdown): VM service not running.
10:11:15 [error] Session initialization failed: VM service not running.
10:13:05 [error] Sentry caught (x7)

Evening:

20:38:40 [error] Failed to run onQuitCleanup(cowork-vm-shutdown): VM service not running.
20:39:27 [error] Session initialization failed: VM service not running.
20:39:49 [error] Session initialization failed: VM service not running.
20:41:10 [error] Sentry caught (x5)

Fix: manually starting the service

PS> Get-Service CoworkVMService
# Status: Stopped, StartType: Automatic

PS> Start-Service CoworkVMService
# Cowork immediately works

Totals since Apr 4

MetricCount
Crash-restart cycles (Sentry batches)9
cowork-vm-shutdown failures10
VM boot failed warnings11
Session initialization failures4
Days affected3 of 8

Steps to Reproduce

This is intermittent and the trigger for the service stopping is unknown. Pattern observed:

  1. Use Cowork normally (service running)
  2. At some point the CoworkVMService stops silently (no log entry for why)
  3. Next Cowork interaction triggers crash-restart loop
  4. App never recovers on its own

Expected Behavior

  1. Auto-restart the service: If CoworkVMService is stopped when Cowork is needed, attempt Start-Service before giving up
  2. Don't crash-loop: After detecting "VM service not running" once, show an actionable error ("Cowork service stopped. Click to restart.") instead of crash-restarting the entire app
  3. Log why the service stopped: Currently there is no log entry indicating why the service dies — only downstream failures

Workaround

Added to the existing scheduled task (ClearCoworkVMs) that runs hourly:

# Also restart the service if it's stopped
$svc = Get-Service -Name 'CoworkVMService' -ErrorAction SilentlyContinue
if ($svc -and $svc.Status -ne 'Running') {
    Start-Service -Name 'CoworkVMService' -ErrorAction SilentlyContinue
}

This mitigates but doesn't eliminate the issue (can still hit it between hourly checks).


Environment

DetailValue
Claude DesktopMSIX (Windows Store)
Claude Code (embedded)2.1.90
OSWindows 11 Pro 10.0.26200
Hyper-VEnabled
CoworkVMService StartTypeAutomatic
RAM16 GB

Log Files

  • %APPDATA%\Claude\logs\main.log — crash cycles, shutdown failures, session init failures
  • %APPDATA%\Claude\logs\main1.log — rotated log with Apr 8–11 history

extent analysis

TL;DR

The CoworkVMService stopping intermittently can be mitigated by implementing an auto-restart mechanism for the service when it's detected as stopped.

Guidance

  • Modify the CoworkVMService to log why it stops to help diagnose the root cause.
  • Implement a check in the Cowork app to detect if the CoworkVMService is not running and attempt to start it before entering a crash-restart loop.
  • Consider enhancing the existing scheduled task (ClearCoworkVMs) to run more frequently to reduce the time the service is stopped.
  • Display an actionable error message to the user when the CoworkVMService is not running, allowing them to restart the service manually.

Example

# Example of how to check and start the service in PowerShell
$svc = Get-Service -Name 'CoworkVMService' -ErrorAction SilentlyContinue
if ($svc -and $svc.Status -ne 'Running') {
    Start-Service -Name 'CoworkVMService' -ErrorAction SilentlyContinue
}

Notes

The root cause of the CoworkVMService stopping is unknown, and the provided workaround only mitigates the issue. Further investigation is needed to determine why the service stops intermittently.

Recommendation

Apply the workaround by implementing an auto-restart mechanism for the CoworkVMService and display an actionable error message to the user when the service is not running. This will help mitigate the issue until the root cause can be determined and addressed.

FAIL-SAFE: If the issue persists after applying the workaround, consider increasing the frequency of the scheduled task or exploring alternative solutions to ensure the CoworkVMService remains running.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [BUG] CoworkVMService stops silently on Windows — app crash-loops with no recovery path [1 comments, 2 participants]