[GH-ISSUE #321] [Windows client + Linux Server] lan-mouse doesn't work at all #171

Open
opened 2026-05-05 22:12:28 -06:00 by gitea-mirror · 2 comments
Owner

Originally created by @daniel-pg on GitHub (Oct 1, 2025).
Original GitHub issue: https://github.com/feschber/lan-mouse/issues/321

I have a Linux desktop (server) where my primary mouse+keyboard are attached to, and a Windows laptop (client) that I want to control remotely. Both are connected to the same router on the same LAN. I then perform these steps:

  1. Open lan-mouse on both computers
  2. (client) Create firewall rule for lan-mouse.exe
  3. (client) Get local IP address with ipconfig /all
  4. (server) In the Connections section, click the Add button, type the IP address of the client in the hostname field, and enable the connection.
  5. (server) A popup appears asking for Input Capture permission. I clicked "Allow".
  6. (client) NO "Incoming connections" section appears. I try to move the mouse from the server to the client anyways, and a warning appears in the client's log window: WARN lan_mouse::server::emulation_task] ignoring events from client <server_lan_ip>:4242.

What puzzles me is why the log said it is ignoring inputs from the client when it should be the server that sends the inputs (unless in lan-mouse it is the opposite of Deskflow and Input-Leap)

Note: If I try to type the computer name in the hostname field literally (i.e. my-laptop) instead of the IP, nothing happens and a yellow icon appears saying "No ip addresses associated with this client".

Linux system info:

Operating System: Artix Linux 
KDE Plasma Version: 6.4.5
KDE Frameworks Version: 6.18.0
Qt Version: 6.9.2
Kernel Version: 6.16.7-artix1-1 (64-bit)
Graphics Platform: Wayland
Processors: 24 × AMD Ryzen 9 9900X 12-Core Processor
Memory: 32 GiB of RAM (30.4 GiB usable)
Graphics Processor 1: NVIDIA GeForce GTX 1060 6GB
Graphics Processor 2: AMD Radeon Graphics
Manufacturer: Micro-Star International Co., Ltd.
Product Name: MS-7E62
System Version: 2.0
Originally created by @daniel-pg on GitHub (Oct 1, 2025). Original GitHub issue: https://github.com/feschber/lan-mouse/issues/321 I have a Linux desktop (server) where my primary mouse+keyboard are attached to, and a Windows laptop (client) that I want to control remotely. Both are connected to the same router on the same LAN. I then perform these steps: 1. Open lan-mouse on both computers 2. (client) Create firewall rule for lan-mouse.exe 3. (client) Get local IP address with `ipconfig /all` 4. (server) In the **Connections** section, click the **Add** button, type the IP address of the client in the `hostname` field, and enable the connection. 5. (server) A popup appears asking for Input Capture permission. I clicked "Allow". 6. (client) **NO "Incoming connections" section appears**. I try to move the mouse from the server to the client anyways, and a warning appears in the client's log window: `WARN lan_mouse::server::emulation_task] ignoring events from client <server_lan_ip>:4242`. What puzzles me is why the log said it is ignoring inputs from the **client** when it should be the **server** that sends the inputs (unless in lan-mouse it is the opposite of Deskflow and Input-Leap) Note: If I try to type the computer name in the hostname field literally (i.e. `my-laptop`) instead of the IP, nothing happens and a yellow icon appears saying "No ip addresses associated with this client". Linux system info: ``` Operating System: Artix Linux KDE Plasma Version: 6.4.5 KDE Frameworks Version: 6.18.0 Qt Version: 6.9.2 Kernel Version: 6.16.7-artix1-1 (64-bit) Graphics Platform: Wayland Processors: 24 × AMD Ryzen 9 9900X 12-Core Processor Memory: 32 GiB of RAM (30.4 GiB usable) Graphics Processor 1: NVIDIA GeForce GTX 1060 6GB Graphics Processor 2: AMD Radeon Graphics Manufacturer: Micro-Star International Co., Ltd. Product Name: MS-7E62 System Version: 2.0 ```
Author
Owner

@F1st3K commented on GitHub (Oct 7, 2025):

I was this problem, workaround for me:

create powershell script, its run daemon windows client, and rerun it by error:

# =============================
# LAN-Mouse Watchdog (clean)
# =============================

$LanMousePath = "C:\Users\kostinnik\Documents\lan\lan-mouse.exe"
$ErrorPattern = "not responding|network error|connection reset|os error 10040"

function Log { param($msg) ; Write-Host $msg }

$Global:LMProcess = $null
$Global:RestartNeeded = $false

function Start-LanMouse {
    if ($Global:LMProcess) {
        try { $Global:LMProcess.Kill() } catch {}
        $Global:LMProcess.Dispose()
        $Global:LMProcess = $null
    }

    # remove prev event subcription
    Get-EventSubscriber | Where-Object {$_.SourceIdentifier -in @("LMOut","LMErr")} | Unregister-Event

    $startInfo = New-Object System.Diagnostics.ProcessStartInfo
    $startInfo.FileName = $LanMousePath
    $startInfo.Arguments = "daemon"
    $startInfo.RedirectStandardOutput = $true
    $startInfo.RedirectStandardError  = $true
    $startInfo.UseShellExecute = $false
    $startInfo.CreateNoWindow = $true

    $proc = New-Object System.Diagnostics.Process
    $proc.StartInfo = $startInfo
    $proc.Start() | Out-Null
    $proc.BeginOutputReadLine()
    $proc.BeginErrorReadLine()
    $Global:LMProcess = $proc

    # stdout event
    Register-ObjectEvent -InputObject $proc -EventName OutputDataReceived -SourceIdentifier LMOut -Action {
        if ($EventArgs.Data) {
            Log "$($EventArgs.Data)"
            if ($EventArgs.Data -match $ErrorPattern) {
                Log "[!] Error detected -> scheduling restart"
                $Global:RestartNeeded = $true
            }
        }
    }

    # stderr event
    Register-ObjectEvent -InputObject $proc -EventName ErrorDataReceived -SourceIdentifier LMErr -Action {
        if ($EventArgs.Data) {
            Log "$($EventArgs.Data)"
            if ($EventArgs.Data -match $ErrorPattern) {
                Log "[!] Error detected -> scheduling restart"
                $Global:RestartNeeded = $true
            }
        }
    }

    Log "✅ lan-mouse started."
}


try {
    # основной код Watchdog
    Start-LanMouse
    Log "Watchdog started. Press Ctrl+C to stop."
    while ($true) {
        Start-Sleep -Milliseconds 500
        if ($Global:RestartNeeded) {
            Log "[!] Restarting lan-mouse..."
            Start-LanMouse
            $Global:RestartNeeded = $false
        }

        if ($Global:LMProcess -and $Global:LMProcess.HasExited) {
            Log "[!] lan-mouse crashed. Restarting..."
            Start-LanMouse
        }
    }
}
finally {
    # cleanup при выходе скрипта
    Log "🛑 Watchdog stopping. Killing lan-mouse..."
    if ($Global:LMProcess) {
        try { $Global:LMProcess.Kill() } catch {}
    }
}
<!-- gh-comment-id:3377828808 --> @F1st3K commented on GitHub (Oct 7, 2025): I was this problem, workaround for me: create powershell script, its run daemon windows client, and rerun it by error: ```ps1 # ============================= # LAN-Mouse Watchdog (clean) # ============================= $LanMousePath = "C:\Users\kostinnik\Documents\lan\lan-mouse.exe" $ErrorPattern = "not responding|network error|connection reset|os error 10040" function Log { param($msg) ; Write-Host $msg } $Global:LMProcess = $null $Global:RestartNeeded = $false function Start-LanMouse { if ($Global:LMProcess) { try { $Global:LMProcess.Kill() } catch {} $Global:LMProcess.Dispose() $Global:LMProcess = $null } # remove prev event subcription Get-EventSubscriber | Where-Object {$_.SourceIdentifier -in @("LMOut","LMErr")} | Unregister-Event $startInfo = New-Object System.Diagnostics.ProcessStartInfo $startInfo.FileName = $LanMousePath $startInfo.Arguments = "daemon" $startInfo.RedirectStandardOutput = $true $startInfo.RedirectStandardError = $true $startInfo.UseShellExecute = $false $startInfo.CreateNoWindow = $true $proc = New-Object System.Diagnostics.Process $proc.StartInfo = $startInfo $proc.Start() | Out-Null $proc.BeginOutputReadLine() $proc.BeginErrorReadLine() $Global:LMProcess = $proc # stdout event Register-ObjectEvent -InputObject $proc -EventName OutputDataReceived -SourceIdentifier LMOut -Action { if ($EventArgs.Data) { Log "$($EventArgs.Data)" if ($EventArgs.Data -match $ErrorPattern) { Log "[!] Error detected -> scheduling restart" $Global:RestartNeeded = $true } } } # stderr event Register-ObjectEvent -InputObject $proc -EventName ErrorDataReceived -SourceIdentifier LMErr -Action { if ($EventArgs.Data) { Log "$($EventArgs.Data)" if ($EventArgs.Data -match $ErrorPattern) { Log "[!] Error detected -> scheduling restart" $Global:RestartNeeded = $true } } } Log "✅ lan-mouse started." } try { # основной код Watchdog Start-LanMouse Log "Watchdog started. Press Ctrl+C to stop." while ($true) { Start-Sleep -Milliseconds 500 if ($Global:RestartNeeded) { Log "[!] Restarting lan-mouse..." Start-LanMouse $Global:RestartNeeded = $false } if ($Global:LMProcess -and $Global:LMProcess.HasExited) { Log "[!] lan-mouse crashed. Restarting..." Start-LanMouse } } } finally { # cleanup при выходе скрипта Log "🛑 Watchdog stopping. Killing lan-mouse..." if ($Global:LMProcess) { try { $Global:LMProcess.Kill() } catch {} } } ```
Author
Owner

@feschber commented on GitHub (Oct 7, 2025):

For encryption and the "incoming connections" section, you will need to use the pre-release version (which I recommend!).
Otherwise, it won't work.

And yes, your assumption is correct that the server is the device, to which mouse and keyboard are attached to (the one controlling other devices), opposite to deskflow / input-leap.

Technically every device is a server by default with lan-mouse, where the server is the device receiving inputs.

<!-- gh-comment-id:3378699786 --> @feschber commented on GitHub (Oct 7, 2025): For encryption and the "incoming connections" section, you will need to use the pre-release version (which I recommend!). Otherwise, it won't work. And yes, your assumption is correct that the server is the device, to which mouse and keyboard are attached to (the one controlling other devices), opposite to deskflow / input-leap. Technically every device is a server by default with lan-mouse, where the server is the device _receiving_ inputs.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/lan-mouse#171
No description provided.