Skip to content

Cowork VM daemon fails to auto-launch — "VM is not running. Start a conversation first." #236

@Echo9k

Description

@Echo9k

Hi there,
First off, thanks for this project — really appreciate the work that makes Claude Desktop possible on Linux.

Description

Cowork mode (both "Code" and "Tasks" sidebar tabs) fails on launch with repeated errors:

Error: VM is not running. Start a conversation first.

The cowork-vm-service.js daemon is not being auto-launched by the Electron app, so the Unix domain socket at $XDG_RUNTIME_DIR/cowork-vm-service.sock never gets created. The Cowork UI loads but cannot communicate with the backend.

Analysis

The auto-launch code in the patched index.js (from PR #234) uses child_process.fork() inside the Ma() retry loop:

process.platform==="linux"&&!Ma._svcLaunched&&(Ma._svcLaunched=true,(()=>{
  try{
    const _d=require("path").join(process.resourcesPath,"app.asar.unpacked","cowork-vm-service.js");
    if(require("fs").existsSync(_d)){
      const _c=require("child_process").fork(_d,[],{detached:true,stdio:"ignore",
        env:{...process.env,ELECTRON_RUN_AS_NODE:"1"}});
      _c.unref()
    }
  } catch(e){}
})())

This fork only triggers when Ma() gets an ENOENT on socket connect. However, the CustomPlugins_listAvailablePlugins handler calls b_t() which checks VM status via a different path — it throws "VM is not running" before Ma() ever gets a chance to auto-launch the daemon. The catch(e){} also silently swallows any fork errors.

Starting the daemon manually works perfectly:

node /usr/lib/claude-desktop/node_modules/electron/dist/resources/app.asar.unpacked/cowork-vm-service.js
# [cowork-vm-service] Service started on /run/user/1000/cowork-vm-service.sock

Once the socket exists, both "Code" and "Tasks" tabs function correctly.

Workaround

A systemd user service reliably solves the problem:

# ~/.config/systemd/user/cowork-vm-service.service
[Unit]
Description=Claude Desktop Cowork VM Service Daemon
Documentation=https://github.com/aaddrick/claude-desktop-debian

[Service]
Type=simple
ExecStart=/usr/bin/node /usr/lib/claude-desktop/node_modules/electron/dist/resources/app.asar.unpacked/cowork-vm-service.js
Restart=on-failure
RestartSec=3
Environment=COWORK_VM_DEBUG=1

[Install]
WantedBy=default.target
systemctl --user daemon-reload
systemctl --user enable --now cowork-vm-service.service

Environment

  • Claude Desktop: 1.1.3189-1.3.11 (.deb, amd64)
  • Linux: Ubuntu x86_64, kernel 6.17.0
  • Claude Code CLI: 2.1.45
  • Node.js: system /usr/bin/node

Steps to Reproduce

  1. Install latest claude-desktop .deb from this repo
  2. Open Claude Desktop
  3. Click "Code" or "Tasks" in the sidebar
  4. Observe: UI loads but sessions fail with "VM is not running"

Verification

# Confirm the daemon is NOT running
ss -lx | grep cowork
# -> (empty)

# Check logs for the error
grep "VM is not running" ~/.cache/claude-desktop-debian/launcher.log
# -> Error occurred in handler for '..._CustomPlugins_$_listAvailablePlugins': Error: VM is not running. Start a conversation first.

# Start daemon manually — Cowork immediately works
node /usr/lib/claude-desktop/node_modules/electron/dist/resources/app.asar.unpacked/cowork-vm-service.js &
ls $XDG_RUNTIME_DIR/cowork-vm-service.sock
# -> /run/user/1000/cowork-vm-service.sock

Suggested Fix

Ship a systemd user service with the .deb package. This is more reliable than the in-app fork approach because:

  • The daemon starts before Claude Desktop, so the socket is ready immediately
  • Survives app restarts without race conditions
  • Auto-restarts on failure
  • Standard Linux service management (systemctl --user status/restart/stop)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcoworkRelated to Cowork mode

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions