microsoft / microsoft/PowerToys

Mouse Without Borders service mode fails to start and pair (Cannot open MWB.Service, UseService resets, socket errors)

Open
#49,094 2 comments 0 reactions 0 assignees View on GitHub
Product-Mouse Without Borders
Dominant language
C
Stars
139k
Forks
8.6k
PR merge metrics
PR metrics pending

Description

### Microsoft PowerToys version

0.100.2.0 (per-user install)

### Installation method

GitHub / WinGet (per-user)

### Area(s) with issue?

Mouse Without Borders

### Steps to reproduce

1. Install PowerToys on two Windows 11 machines (PAYTON-LEGION2 and PAYTON-DESKTOP) on the same subnet.
2. Enable Mouse Without Borders.
3. Set matching SecurityKey and MachineMatrixString in settings.json on both.
4. Set UseService to true in settings.json.
5. Use elevated commands (via gsudo batch scripts to avoid repeated UAC) to:
- Create the service: sc.exe create "PowerToys.MWB.Service" binPath=... start=demand
- Add firewall rules for the exes and TCP 15100.
6. Restart PowerToys runner and MWB processes.
7. Observe service and connection state.

### ✔️ Expected Behavior

- PowerToys.MWB.Service starts and stays running (as LocalSystem).
- UseService remains true.
- Machines pair successfully and mouse/keyboard/clipboard sharing works (including elevated scenarios via service).

### ❌ Actual Behavior

- Service registers successfully but immediately stops (START_PENDING → Stopped).
- On local machine, MWB module logs:
`
Couldn't start the service. Will try to continue as not a service.
!Exception!: System.InvalidOperationException: Cannot open 'PowerToys.MWB.Service' service on computer '.'.
`
(from ServiceController.Start)
- UseService is reset to false on local after restarts (remote stays true).
- Connection attempts fail with:
- "Unable to connect after a timeout"
- "An operation was attempted on something that is not a socket."
- Socket cancellations, "clipboard socket could have been closed. Not listening."
- Remote side repeatedly logs: "Couldn't determine PowerToys.exe pid"
- No successful handshake despite correct key and matrix in settings.
- Listeners restart but no stable connection.

### Logs

See excerpts from %LOCALAPPDATA%\Microsoft\PowerToys\MouseWithoutBorders\Logs\0.100.2.0\Log_*.log

Key local errors:
- Multiple tcpClient.Connect timeouts with "not a socket" to remote (192.168.1.77 and IPv6).
- ServiceController exceptions on every restart attempt.
- Repeated "TCP listening on port: 15100/15101" followed by cancellations.

No specific crashes for MouseWithoutBordersService.exe in Application log (other PowerToys WinUI crashes with 0xc000027b seen).

System log only shows service *install* events.

### Additional Information

- Both machines Windows 11, same subnet.
- Service created as LocalSystem / demand start with correct per-user binPath.
- Tried multiple clean restarts, forcing settings while stopped, batching all elevated ops into single gsudo temp .ps1 scripts.
- The only documented way (run PowerToys as admin + UI toggle for "Use Service") appears necessary for stable behavior.
- Related issues: similar service/UseService problems reported in the past.

### Other Software

Per-user PowerToys install. No legacy Mouse Without Borders installed.

Contributor guide

Open the contributing guide

Research direction

Start with the Mouse Without Borders logs under %LOCALAPPDATA%\Microsoft\PowerToys\MouseWithoutBorders\Logs\0.100.2.0 and trace the service startup around PowerToys.MWB.Service, UseService, and TCP ports 15100/15101. Compare the local and remote logs while reproducing the failure. Done means the service stays running, UseService remains true, and the two machines pair reliably.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
desktop, networking, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.