mirror of
https://github.com/debauchee/barrier.git
synced 2026-05-15 14:16:02 -06:00
[GH-ISSUE #185] onBoot #148
Labels
No labels
HiDPI
bounty
bsd/freebsd
bsd/openbsd
bug
bug
build-infra
cantfix
critical
doc
duplicate
enhancement
fix-available
from git
from release
good first issue
help wanted
installer/package
invalid
linux
macOS
meta
needs testing
pull-request
query
question
regression
regression
v2.4.0
windows
wontfix
work-in-progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/barrier#148
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @a7hybnj2 on GitHub (Nov 30, 2018).
Original GitHub issue: https://github.com/debauchee/barrier/issues/185
Operating Systems
Server: Arch from AUR
Client: Windows 10, Windows 8.1, and MacOS Mojave
I have tried looking at synergy help documents for a way to get barrier to boot before login windows so that, obviously, you can used a shared keyboard to login to multiple systems.
It seems that there are some versions of synergy that have a 'service' option at least for windows. I also tried some funny mac script that ultimately caused my OS to fail to boot and I had to recover-mode terminal delete the script to boot again.
It would be great to add a writeup to the wiki on how, if possible, to get the clients and server to start prior to login screens.
@a7hybnj2 commented on GitHub (Nov 30, 2018):
UPDATE: I don't know exactly I was doing previously but it seems that my windows machine does indeed start barrier on boot. I wasn't patient enough to wait for it to connect, takes about 10-15 seconds after login screen is visible.
I start my server with the
Arch(plasma) - System Settings - Startup and Shutdown - Autostart - "/bin/barriers -f --no-tray --debug INFO --name myPrivateName --enable-crypto -c /home/myPrivateUName/.barrier.conf --address :24800"and that starts the service just fine but only after login.
And mac...who knows
EDIT: I have
"/Applications/Barrier.app/Contents/MacOS/barrierc -f --no-tray --debug INFO --name myOtherPrivateName n --enable-drag-drop --enable-crypto [192.168.1.184]:24800"added to login items for my user
@AdrianKoshka commented on GitHub (Dec 1, 2018):
We don't really have an officially documented way of doing autostart as you said. I've been rather busy with other things in life, mostly having enough time to check issues daily and try to label them.
@a7hybnj2 commented on GitHub (Dec 3, 2018):
I will take a look and try to document how, if ever, I get it to work. I will leave my notes here.
Windows: Done. Seems to enable auto start automatically.
Linux: Should be easy but I did read about KDE locking the keyboard down until after login. So, that might be an issue running server on a KDE box. Now 100% sure yet.
MacOS: Seems like the 'old way' pre 10.10 was easy using plist. I am still looking for a 10.14 way that doesn't lock up my system.
Ref1
Ref2
Ref3
Ref4
@mgorbet commented on GitHub (Feb 8, 2019):
Any tips or links on how to get a raspberry pi to launch Barrier on startup would be very helpful. I tried cron @reboot but so far can't seem to get the syntax right ... or something.
What's the 'accepted wisdom' on this?
@AdrianKoshka commented on GitHub (Feb 8, 2019):
I know I used systemd user services.
@mgrant0 commented on GitHub (Jul 28, 2020):
To get Barrier to launch at startup on MacOS:
But it always comes up like this:
Is it possible to get it to start in client mode with a pre-configured IP address?
@shymega commented on GitHub (Jul 28, 2020):
Hm.. you might be able to use
barriercdirectly.@abudiar commented on GitHub (Nov 25, 2020):
I've been able to get it to launch with a preconfigured ip address by:
Then once I restart it launches with the ip address already saved.
@oppalla commented on GitHub (Jul 5, 2021):
I'm also trying to set Barrier to start as a service, like VNC server, in order to log in on macOS from my Windows host keyboard/mouse.
unfortunately even clicking on Options > Open at login, I can't use my Windows Keyboard and Mouse to put my login credentials when I turn my iMac on.
I'm running High Sierra 10.13.6.
any help will be appreciated!
@xrpdevs commented on GitHub (Jul 5, 2021):
I run MacOS in a Proxmox/KVM instance with it's own GPU. Barrier server is on Manjaro (also KVM guest with own GPU) which is where the USB ports are plugged in.
I'm wondering if it would be possible to run barrierc as root pre-login via SSH with a hook script at VM launch time..
@xrpdevs commented on GitHub (Jul 5, 2021):
Have you seen https://web.archive.org/web/20150511090759/http://synergy2.sourceforge.net/autostart.html ?
@xrpdevs commented on GitHub (Jul 5, 2021):
Thinking this could be used for running barrier pre-login, if we modify the "KeepAlive" part to the StartupItems script to check for the presence of a file in say /tmp then we can tell the script to kill barrier once we're running barrier as our logged-in user (so clipboard works) then, assuming there are "OnLogOut" scripts for MacOS then remove the /tmp file so the StartupItems script re-launches barrierc (as root again)
OR, in the KeepAlive, look for a second barrier PID that isn't root's copy, if found, terminate, not found, restart.. this seems like a more practical/elegant solution.
@xrpdevs commented on GitHub (Jul 5, 2021):
It is annoying having to do the USB swap on boot. Will try to write this up and chuck it on my github tomorrowe if I get time.
@oppalla commented on GitHub (Jul 6, 2021):
I'll be trying this right now! it's really annoying to have to use batteries on my keyboard and touchpad if I just use them to log in.
@oppalla commented on GitHub (Jul 6, 2021):
Unfortunately, I followed the steps below and didn't make any difference on how Barrier starts. It just opens up after logging my user in.
1 - Opened a terminal window and become root:
$ sudo su -2 - Created a folder like this:
# mkdir -p /Library/StartupItems/Barrier3 - Created a file without extension in this folder with this text:
4 - Made the script executable with this command:
# chmod 755 /Library/StartupItems/Barrier/Barrier5 - Created a file named StartupParameters.plist under the same folder containing:
6 - Executed the startup script from the terminal without any errors or advice with this command:
# /Library/StartupItems/Barrier/Barrier start7 - Turned off my iMac and my PC
8 - Turned on my iMac till it gets to log in screen, then turned on my PC
9 - Nothing happened at all, I must log through VNC or use the iMac native keyboard to log in.
Any idea on what I'm missing? Or this can't be used on High Sierra? Any help will be really appreciated!
Something I noted, is that if I open terminal and go to
/usr/local/bin/and give anlscommand, it don't show any barrierc folder.Maybe is this? Any idea on where should I point this path on macOS for it to work?
@xrpdevs commented on GitHub (Jul 6, 2021):
I'm running Big Sur. Had a late start today so have yet to take a look at it properly.
Would suggest checking your syslog to see if there is a "Starting Barrier" message recorded, and doing a "ps aux | grep barrierc" (as root) via ssh to see if it's running or not.
@xrpdevs commented on GitHub (Jul 6, 2021):
Oh and you want to replace /usr/local/bin/ with /Applications/Barrier.app/Contents/MacOS/ (or wherever your barrierc binary is stored)
@oppalla commented on GitHub (Jul 6, 2021):
@xrpdevs thanks for troubleshooting this with me, I really appreciate your efforts.
I have before going to sleep set the /usr/local/bin/ with /Applications/Barrier.app/Contents/MacOS/Barrierc, but unfortunately it's not working yet.
I'm taking a look at the macOS Console right now, but I'm not sure about what should I search for.
I've put Barrier on the search box, surfed between the folders on the left, there are a few logs, anything much explanatory.
can you keep with me on this? I'm using barrier for a year more or less, and since then, I'm using a second keyboard just to log in to my mac, every day by the morning. it will improve a lot the usability, and maybe help users in further times. thanks!
@xrpdevs commented on GitHub (Jul 6, 2021):
Yeah I'll have a go at getting it working later, I'm not really a Mac person per se, but extensive experience with *nix systems in general so hopefully be able to get to the bottom of this.
@xrpdevs commented on GitHub (Jul 6, 2021):
So got the switching between root and user version of barrierc working, only problem is, that (at least on Big Sur) A) /Library/StartupItems is deprecated, and B) To run GUI apps pre-login requires privelege (see https://apple.stackexchange.com/questions/372933/execute-a-script-with-gui-access-before-login )
Appears the way to start barrierc pre-login is to use launchd, going to look into how to do that in combination with B)
Gist of what I've done so far: https://gist.github.com/xrpdevs/b53c9962dd72ffce2cdd6bd9d4d87f28
@xrpdevs commented on GitHub (Jul 6, 2021):
The install instructions may or may not work for you as you are not using Big Sur. I have another VM running catalina but I expect it will behave much the same as BS. Got other stuff to do now but probably take another look tomorrow. I guess if I manage to get this working can always submit it as a PR.
@oppalla commented on GitHub (Jul 6, 2021):
I'm trying your instructions right now. Just have two questions:
1 - Is it necessary to CHMOD 755 the Barrier file?
2 - Am I supposed to create a launchd script? which will create the file /tmp/barrierc_user_running when logging in? how do I do it?
@oppalla commented on GitHub (Jul 18, 2021):
mate @xrpdevs, how do I create this launchd script?