blog icon indicating copy to clipboard operation
blog copied to clipboard

Synergy/Barrier: Share One Mouse and Keyboard Between Multiple Computers

Open hhstore opened this issue 3 years ago • 5 comments

hhstore avatar Aug 08 '20 18:08 hhstore

Barrier:

  • [x] 最近需要在几台 Mac 间切换, 着实麻烦. 就又想起来这个软件.
  • [x] 当前只需要使用 : barrier
    • https://github.com/debauchee/barrier
    • 本是 synergy 的 fork 分支. synergy 收费之后, 成为第一选择.
    • 开源+免费+更新, 支持最新的 Mac 系统. (截止当前2020)
    • Barrier 的设置和Synergy 几乎 100% 一致, 且更好. 还修了一些 bug.
    • Synergy 已经是过去时, 已完全没必要用. 下载最新试用版, 竟然在 mac 下屏幕分辨率糊了.
  • [x] 过去时: synergy
    • https://github.com/symless/synergy-core
    • 虽然开源, 但是要付费了.
    • 很多年前, 用过这个软件, 非常棒. 当初是在 Windows 平台下, 还是 win7 时代.
    • 算下来, 大概是2013年? 好久远了. 当年是免费软件, 现在要付费了.
    • https://symless.com/synergy

替代方案:

  • https://alternativeto.net/software/synergy/
  • https://www.v2ex.com/t/304052
  • https://www.sharemouse.com/

功能:

  • [x] 需求: 实现一套键盘+鼠标, 控制多台 Mac
  • [x] 单套外设(键盘+鼠标) - 多设备间共享: Synergy
  • [x] 跨平台: 支持 Mac / Windows / Linux

原理:

  • 利用局域网: 主机间网络通信. 多主机需要在同一个网络环境.
  • 软件本身是 C/S 架构. 一个做 Server, 其他作 Clients. 通过主设备, 控制其他设备.
  • 有点像飞鸽传书之类的文件共享工具.
  • 只不过是共享 键盘设备.
  • 使用设置:
    • 键盘物理连接的主机: 设置为 Server 角色.
    • 其他待共享的主机: 设置为Clients, 就可以了.

如何使用:

  • [x] 后面给了详细的图文教程. 设置上, 还是要注意的.
  • [x] 网上很多设置, 都过时了.
  • [x] 下图的教程. 同时适用: barrier 和 synergy.
  • https://www.cnblogs.com/zlslch/p/9451270.html
  • https://www.jianshu.com/p/9fd09bb9f694

下载:

  • Barrier 下载: https://github.com/debauchee/barrier/releases
  • Synergy 完全不推荐: https://snapshots.symless.com/public/1.11.1-rc2/

hhstore avatar Aug 08 '20 18:08 hhstore

Tutorial: How To Use Barrier And Synergy

environment:

  • [x] barrier version : 2.3.3
  • [x] Mac OSX: 10.15.5 and 10.14.6

quickstart:

  • [x] 1. Client Side: Mac B.
    • Get Client's Hostname(Screen name)
  • [x] 2. Server Side: Mac A.
    • Add Client's Hostname(Screen name).
    • Start the Server.
  • [x] 3. Client Side:
    • not select Auto Config.
    • Start the Client.

1. Server Side: Mac A

  • [x] Mac A: as the server side, used to control other clients(Mac B)

    • IP: 192.168.1.4.
    • Hostname(Screen name):hh-imac27.local.
    • physically connect the keyboard and mouse, as the server side(used to control other Mac/PC).
  • image

  • [x] select the Server option.

  • [x] click Configure Server...,

    • select Screens and links tab,
    • then drag the pc icon to the grid.
    • then double click the screen you add in to edit its settings.

image

  • [x] edit the client side hostname: here = Mac B hostname: henrydeMacBook-Pro.local

image

  • [x] then ok, then start the server.
  • [x] all done here.

2. Client Side: Mac B

  • [x] Mac B: as the client side.
    • IP: 192.168.2.199
    • Hostname(Screen name): henrydeMacBook-Pro.local
  • [x] just select the Client option.
  • [x] do not select the Auto Config,
  • [x] then click Start, start client barrier.
  • [x] all done here.

image

3. Done

  • when Mac A and Mac B are connected.
  • in the Mac A, drag your mouse out the right edge of screen, the cursor will enter the Mac B's screen. the keyboard also ok to type words in the Mac B.

hhstore avatar Aug 08 '20 20:08 hhstore

some error msg :

client Log:

  • 连接过程中, 正常连接过程中, 也会报501错误.
  • 如果一直连接失败.
  • 注意检查: 是不是开了 VPN 设置了 全局代理.
  • 正常 Surge 是不会干扰使用的.
[2020-08-09T20:35:08] INFO: stopping barrier desktop process
[2020-08-09T20:35:09] ERROR: process exited with error code: 11

[2020-08-09T20:35:14] INFO: starting client
[2020-08-09T20:35:14] INFO: config file: /private/var/folders/yg/7xxh885n2s5ffq5sjckdw_yh0000gn/T/Barrier.UFHrvV
[2020-08-09T20:35:14] INFO: log level: INFO
[2020-08-09T20:35:14] INFO: drag and drop enabled
[2020-08-09T20:35:14] NOTE: started client
[2020-08-09T20:35:14] NOTE: connecting to '192.168.1.4': 192.168.1.4:24800
[2020-08-09T20:35:14] INFO: OpenSSL 1.1.1g  21 Apr 2020
2020-08-09 20:35:14.795 barrierc[3926:100861] pid(3926)/euid(501) is calling TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!
2020-08-09 20:35:14.802 barrierc[3926:100848] starting cocoa loop
2020-08-09 20:35:14.805 barrierc[3926:100861] pid(3926)/euid(501) is calling TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!


2020-08-09 20:35:14.805 barrierc[3926:100861] pid(3926)/euid(501) is calling TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!

2020-08-09 20:35:14.806 barrierc[3926:100861] pid(3926)/euid(501) is calling TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!
2020-08-09 20:35:14.806 barrierc[3926:100861] pid(3926)/euid(501) is calling TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!
2020-08-09 20:35:14.806 barrierc[3926:100861] pid(3926)/euid(501) is calling TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!
2020-08-09 20:35:14.806 barrierc[3926:100861] pid(3926)/euid(501) is calling TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!
2020-08-09 20:35:14.806 barrierc[3926:100861] pid(3926)/euid(501) is calling TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!
[2020-08-09T20:35:14] NOTE: server fingerprint: AF:83:03:C7:27:F6:10:6E:9D:26:59:AB:30:B3:51:AE:DA:62:60:35
[2020-08-09T20:35:14] NOTE: trustedServersFilename: /Users/henry/Library/Application Support/barrier/SSL/Fingerprints/TrustedServers.txt
[2020-08-09T20:35:14] NOTE: Opened trustedServersFilename: /Users/henry/Library/Application Support/barrier/SSL/Fingerprints/TrustedServers.txt
[2020-08-09T20:35:14] NOTE: Fingerprint matches trusted fingerprint
[2020-08-09T20:35:14] INFO: connected to secure socket
[2020-08-09T20:35:14] INFO: server ssl certificate info: /CN=Barrier
[2020-08-09T20:35:14] INFO: TLS_AES_256_GCM_SHA384  TLSv1.3 Kx=any      Au=any  Enc=AESGCM(256) Mac=AEAD
2020-08-09 20:35:14.990 barrierc[3926:100861] pid(3926)/euid(501) is calling TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!

2020-08-09 20:35:14.993 barrierc[3926:100861] pid(3926)/euid(501) is calling TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!


2020-08-09 20:35:14.993 barrierc[3926:100861] pid(3926)/euid(501) is calling TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!
[2020-08-09T20:35:14] WARNING: cursor may not be visible
connected to server
[2020-08-09T20:35:20] INFO: entering screen
[2020-08-09T20:35:20] INFO: clipboard was updated
[2020-08-09T20:35:20] INFO: clipboard was updated
[2020-08-09T20:40:36] INFO: leaving screen
[2020-08-09T20:40:36] WARNING: cursor may not be visible


server log:

  • 服务侧连接成功, log 会有提示.
  • 鼠标切换到另一台设备, log 也会有提示.


[2020-08-09T20:34:16] INFO: zeroconf server detected: 192.168.1.4
[2020-08-09T20:34:16] INFO: stopping barrier desktop process
[2020-08-09T20:34:18] ERROR: process exited with error code: 11

[2020-08-09T20:34:18] INFO: starting client
[2020-08-09T20:34:18] INFO: config file: /private/var/folders/zg/mg0rq09x31bgtm6v4xv5cjtm0000gp/T/Barrier.JIhKKI
[2020-08-09T20:34:18] INFO: log level: INFO
[2020-08-09T20:34:18] INFO: zeroconf client detected: hh-imac27.local
[2020-08-09T20:34:18] INFO: drag and drop enabled
[2020-08-09T20:34:18] NOTE: started client
[2020-08-09T20:34:18] NOTE: connecting to '192.168.1.4': 192.168.1.4:24800
[2020-08-09T20:34:18] INFO: OpenSSL 1.1.1g  21 Apr 2020
2020-08-09 20:34:18.809 barrierc[16166:331996] starting cocoa loop




[2020-08-09T20:34:23] INFO: OpenSSL 1.1.1g  21 Apr 2020
[2020-08-09T20:34:23] WARNING: failed to connect to server: Connection refused
[2020-08-09T20:34:24] NOTE: connecting to '192.168.1.4': 192.168.1.4:24800
[2020-08-09T20:34:24] INFO: OpenSSL 1.1.1g  21 Apr 2020
[2020-08-09T20:34:24] WARNING: failed to connect to server: Connection refused
[2020-08-09T20:34:25] NOTE: connecting to '192.168.1.4': 192.168.1.4:24800
[2020-08-09T20:34:25] INFO: OpenSSL 1.1.1g  21 Apr 2020
[2020-08-09T20:34:25] WARNING: failed to connect to server: Connection refused
[2020-08-09T20:34:26] NOTE: connecting to '192.168.1.4': 192.168.1.4:24800
[2020-08-09T20:34:26] INFO: OpenSSL 1.1.1g  21 Apr 2020
[2020-08-09T20:34:26] WARNING: failed to connect to server: Connection refused
[2020-08-09T20:34:27] NOTE: connecting to '192.168.1.4': 192.168.1.4:24800
[2020-08-09T20:34:27] INFO: OpenSSL 1.1.1g  21 Apr 2020
[2020-08-09T20:34:27] WARNING: failed to connect to server: Connection refused
[2020-08-09T20:34:28] NOTE: connecting to '192.168.1.4': 192.168.1.4:24800
[2020-08-09T20:34:28] INFO: OpenSSL 1.1.1g  21 Apr 2020
[2020-08-09T20:34:28] WARNING: failed to connect to server: Connection refused
[2020-08-09T20:34:29] NOTE: connecting to '192.168.1.4': 192.168.1.4:24800
[2020-08-09T20:34:29] INFO: OpenSSL 1.1.1g  21 Apr 2020
[2020-08-09T20:34:29] WARNING: failed to connect to server: Connection refused
[2020-08-09T20:34:30] NOTE: connecting to '192.168.1.4': 192.168.1.4:24800
[2020-08-09T20:34:30] INFO: OpenSSL 1.1.1g  21 Apr 2020
[2020-08-09T20:34:30] WARNING: failed to connect to server: Connection refused
[2020-08-09T20:34:31] NOTE: connecting to '192.168.1.4': 192.168.1.4:24800
[2020-08-09T20:34:31] INFO: OpenSSL 1.1.1g  21 Apr 2020
[2020-08-09T20:34:31] WARNING: failed to connect to server: Connection refused
[2020-08-09T20:34:32] INFO: stopping barrier desktop process
[2020-08-09T20:34:32] NOTE: connecting to '192.168.1.4': 192.168.1.4:24800
[2020-08-09T20:34:32] INFO: OpenSSL 1.1.1g  21 Apr 2020
[2020-08-09T20:34:32] ERROR: process exited with error code: 11

[2020-08-09T20:34:32] INFO: starting server
[2020-08-09T20:34:32] INFO: config file: /private/var/folders/zg/mg0rq09x31bgtm6v4xv5cjtm0000gp/T/Barrier.QKYcdS
[2020-08-09T20:34:32] INFO: log level: INFO
[2020-08-09T20:34:32] INFO: drag and drop enabled
started server (IPv4/IPv6), waiting for clients
2020-08-09 20:34:32.942469+0800 barriers[16169:332488] starting cocoa loop
[2020-08-09T20:34:33] INFO: OpenSSL 1.1.1g  21 Apr 2020
[2020-08-09T20:34:33] INFO: accepted secure socket
[2020-08-09T20:34:33] INFO: TLS_AES_256_GCM_SHA384  TLSv1.3 Kx=any      Au=any  Enc=AESGCM(256) Mac=AEAD
[2020-08-09T20:34:33] NOTE: accepted client connection
[2020-08-09T20:34:33] NOTE: client "henrydeMacBook-Pro.local" has connected
[2020-08-09T20:34:36] INFO: switch from "hh-imac27.local" to "henrydeMacBook-Pro.local" at 0,462
[2020-08-09T20:34:36] INFO: leaving screen
[2020-08-09T20:34:36] INFO: screen "hh-imac27.local" updated clipboard 0
[2020-08-09T20:34:36] INFO: screen "hh-imac27.local" updated clipboard 1
[2020-08-09T20:34:40] ERROR: ssl error occurred (system call failure)
[2020-08-09T20:34:40] NOTE: client "henrydeMacBook-Pro.local" has disconnected
[2020-08-09T20:34:40] ERROR: process exited with error code: 13
[2020-08-09T20:34:40] INFO: detected process not running, auto restarting

[2020-08-09T20:34:41] INFO: starting server
[2020-08-09T20:34:41] INFO: config file: /private/var/folders/zg/mg0rq09x31bgtm6v4xv5cjtm0000gp/T/Barrier.PwdVEc
[2020-08-09T20:34:41] INFO: log level: INFO
[2020-08-09T20:34:41] INFO: drag and drop enabled
started server (IPv4/IPv6), waiting for clients
2020-08-09 20:34:41.999711+0800 barriers[16174:332990] starting cocoa loop
[2020-08-09T20:34:42] INFO: OpenSSL 1.1.1g  21 Apr 2020
[2020-08-09T20:34:42] INFO: accepted secure socket
[2020-08-09T20:34:42] INFO: TLS_AES_256_GCM_SHA384  TLSv1.3 Kx=any      Au=any  Enc=AESGCM(256) Mac=AEAD
[2020-08-09T20:34:42] NOTE: accepted client connection
[2020-08-09T20:34:42] NOTE: client "henrydeMacBook-Pro.local" has connected
[2020-08-09T20:34:44] INFO: switch from "hh-imac27.local" to "henrydeMacBook-Pro.local" at 0,388
[2020-08-09T20:34:44] INFO: leaving screen
[2020-08-09T20:34:44] INFO: screen "hh-imac27.local" updated clipboard 0
[2020-08-09T20:34:44] INFO: screen "hh-imac27.local" updated clipboard 1
[2020-08-09T20:35:09] ERROR: ssl error occurred (system call failure)
[2020-08-09T20:35:09] NOTE: client "henrydeMacBook-Pro.local" has disconnected
[2020-08-09T20:35:09] ERROR: process exited with error code: 13
[2020-08-09T20:35:09] INFO: detected process not running, auto restarting

[2020-08-09T20:35:10] INFO: starting server
[2020-08-09T20:35:10] INFO: config file: /private/var/folders/zg/mg0rq09x31bgtm6v4xv5cjtm0000gp/T/Barrier.MAWhOD
[2020-08-09T20:35:10] INFO: log level: INFO
[2020-08-09T20:35:11] INFO: drag and drop enabled
started server (IPv4/IPv6), waiting for clients
2020-08-09 20:35:11.077047+0800 barriers[16178:333175] starting cocoa loop
[2020-08-09T20:35:14] INFO: OpenSSL 1.1.1g  21 Apr 2020
[2020-08-09T20:35:14] INFO: accepted secure socket
[2020-08-09T20:35:14] INFO: TLS_AES_256_GCM_SHA384  TLSv1.3 Kx=any      Au=any  Enc=AESGCM(256) Mac=AEAD
[2020-08-09T20:35:14] NOTE: accepted client connection
[2020-08-09T20:35:14] NOTE: client "henrydeMacBook-Pro.local" has connected
[2020-08-09T20:35:20] INFO: switch from "hh-imac27.local" to "henrydeMacBook-Pro.local" at 0,391
[2020-08-09T20:35:20] INFO: leaving screen
[2020-08-09T20:35:20] INFO: screen "hh-imac27.local" updated clipboard 0
[2020-08-09T20:35:20] INFO: screen "hh-imac27.local" updated clipboard 1
[2020-08-09T20:37:57] INFO: screen "henrydeMacBook-Pro.local" grabbed clipboard 0 from "hh-imac27.local"
[2020-08-09T20:37:57] INFO: screen "henrydeMacBook-Pro.local" grabbed clipboard 1 from "hh-imac27.local"
[2020-08-09T20:40:36] INFO: switch from "henrydeMacBook-Pro.local" to "hh-imac27.local" at 2555,821
[2020-08-09T20:40:36] INFO: entering screen
[2020-08-09T20:40:57] INFO: screen "henrydeMacBook-Pro.local" updated clipboard 0
[2020-08-09T20:41:15] INFO: screen "henrydeMacBook-Pro.local" updated clipboard 1
[2020-08-09T20:43:19] INFO: screen "henrydeMacBook-Pro.local" grabbed clipboard 0 from "henrydeMacBook-Pro.local"
[2020-08-09T20:43:19] INFO: screen "henrydeMacBook-Pro.local" grabbed clipboard 1 from "henrydeMacBook-Pro.local"
[2020-08-09T20:43:19] INFO: screen "henrydeMacBook-Pro.local" updated clipboard 0
[2020-08-09T20:43:19] INFO: screen "henrydeMacBook-Pro.local" updated clipboard 1



hhstore avatar Aug 09 '20 12:08 hhstore

ssl certificate doesn't exist how to solve that

MohdTanzeel avatar Jul 06 '23 04:07 MohdTanzeel

ssl certificate doesn't exist how to solve that

  • Hi. It's been a long time since I wrote this blog, and I haven't used this software for a long time. I'm not sure if the tutorial I've written is still applicable to the latest version of this software.
  • However, you can check if the machine's VPN has global proxy mode enabled? This may result in the inability to switch devices.

hhstore avatar Jul 07 '23 18:07 hhstore