mirror of
https://github.com/debauchee/barrier.git
synced 2026-05-15 14:16:02 -06:00
[GH-ISSUE #508] Automatically start Barrier on boot in Raspbian Buster #395
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#395
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 @ElnuDev on GitHub (Nov 22, 2019).
Original GitHub issue: https://github.com/debauchee/barrier/issues/508
Operating Systems
Server: Windows 10
Client: Raspbian Buster
Barrier Version
Server: 2.3.2-snapshot-210c2b70
Client: 2.3.2-snapshot-36ed253e
Problem
I would like to make Barrier automatically start on boot on my Raspberry Pi 4 running Raspbian Buster. Currently, I have to connect a second mouse/keyboard pair to my Raspberry Pi in order to start up Barrier, which kind of defeats the purpose. 🙃 Is this possible? I tried adding
barrier &toetc/rc.localand rebooting the Pi, but that didn't work.@shymega commented on GitHub (Nov 29, 2019):
I don't believe that Debian Buster uses
sysvinit, and since Debian Jessie, it now uses systemd.#36 would have fulfilled this requirement, and I will make a PR soon to provide these units for a systemd user service, and possibly a systemd system service, but I'm not really convinced we need a systemd system service.
Could you confirm that Raspbian Buster uses systemd or sysvinit? You can check for systemd by running
systemctl, and seeing if returns an error.Thanks for the report!
@candeira commented on GitHub (Dec 29, 2019):
@Shymega, wouldn't a systemd system service allow users to use barrier for accessing client computers' display manager/login?
@shymega commented on GitHub (Dec 29, 2019):
@candeira Not sure. It could potentially work, but it wouldn't be per-user, and only for the root user, I'd imagine - so you'd need two Barrier configs.. on the same system. At least, that's how I understand it. I'd personally stick with a user service, but I can see the appeal of Barrier being available on the DM.
@mirh commented on GitHub (Jan 7, 2020):
My personal situation is a PC where I don't have physical keyboards attached, and in come cases I find myself having to switch to TTY.
If the thing is running as a normal user.. Of course I cannot login into the console to begin with.
@dayne commented on GitHub (Jan 17, 2020):
My solution for this is a set of scripts used on my Raspberry Pi 4 and couple another Linux boxes that I revision control in a gist over here:
https://gist.github.com/dayne/e3a7f31f0624bf299faf9fadfe510322
I see I have a note about fixing up my bash script stuff to make it work correctly in a mac... I'll loop back to that in the future but what I've linked above works for me on my RPi.
@detly commented on GitHub (Feb 3, 2020):
Before I go off and try to configure this from scratch, what is the expected way to initiate a Barrier connection with a headless client?
@rebroad commented on GitHub (May 12, 2020):
Adding:-
barrier &to the end of /home/pi/.profile was enough to get it running automatically upon boot up into desktop mode for me
@detly commented on GitHub (May 12, 2020):
@rebroad In this context, "at boot" means before logging in.
@detly commented on GitHub (May 27, 2020):
@lornix This will start Barrier on login, not on boot. This issue is about starting Barrier before any user is logged in, so that on multi-user systems someone can enter credentials at the login screen.
@simons-public commented on GitHub (May 28, 2020):
@detly I put in a PR #694 that has systemd services if you want to give that a try.
@detly commented on GitHub (May 28, 2020):
@simons-public Amazing! I left a review comment, I hope you don't mind me jumping in.
@Zazaaaa commented on GitHub (Jun 10, 2020):
I am sorry, but could someone please explain to me how I am supposed to do this? I am completely starting from scratch with my Raspberry Pi and I want to connect my keyboard and mouse first. I don't have any other users but the main one so I don't need to log on. I just need to run Barrier on startup so I don't have to plug in my keyboard first. Can somebody please help me? Thanks in forward.
@lachlanshanks commented on GitHub (Jun 12, 2020):
If you visit the /home/pi folder in the file explorer and in the drop down menu beside the address bar select to show hidden files, you'll see the ".profile" file. You just need to add "barrier &" to the end of that.
EDIT: This is working for me now.
@julio8a commented on GitHub (Jun 25, 2020):
Thank you! adding
barrier &to the end of the/home/pi/.profilefile worked for me.@Sk8wine commented on GitHub (Jun 25, 2020):
Thank you! Was forever changing dongle to boot Barrier - worked perfectly
@LRC32901 commented on GitHub (Jun 28, 2020):
I've added "barrier & to the end of my " .profile" file
When screen boots I get a screen looking for Server IP: .
Is there a way to pass it the ip or did I miss something on setuo.
Thanks
@skorokithakis commented on GitHub (Jul 19, 2020):
@LRC32901 You may be able to change the line to
barrierc <server ip> &but I haven't tested that.@ed-puckett commented on GitHub (Oct 8, 2020):
This is working for me:
The script (change barrier_host to the correct ip address for your barrier server, i.e., the one with the keyboard and mouse):
#!/bin/bash
export barrier_host=192.168.1.1 # CHANGE ME
export barrier_port=24800
export barrier_logfile="${HOME}/barrier.log"
if ! pgrep -af /usr/bin/barrierc; then
nohup /usr/bin/barrierc --no-tray --debug INFO --name raspberrypi --enable-crypto "[${barrier_host}]:${barrier_port}" <&- > "${barrier_logfile}" 2>&1 &
fi
@DanielGlaas commented on GitHub (Dec 11, 2020):
Hi guys, here is my solution to have the client automatically running on my raspberry pi:
edit file
sudo nano /etc/xdg/lxsession/LXDE-pi/autostartand add this line
@barrierc -f --name raspberrypi --enable-crypto 192.168.0.2The standard user "pi" is automatically loged in, this means that on the monitor already the desktop is visible. As soon as I start barrier server on my Laptop with Ubuntu 20.04, the connection establishes within seconds.
Maybe this helps someone!
@Kingo71 commented on GitHub (Jan 22, 2021):
This worked like a charm for me, thanks!
@1oh1 commented on GitHub (Mar 29, 2021):
If you use Dynamic DNS providers like No-IP, DuckDNS or similar, you can replace the IP address in the command with the your DDNS hostname (eg.
my-awesome-pc.duckdns.org) as long as the hostname points to your computer's local IP and not public IP.@ericlowry commented on GitHub (May 23, 2021):
@DanielGlaas, I cam looking for exactly this - worked like a charm! Thanks for saving hours of digging.
@Lazuli360 commented on GitHub (Jan 10, 2022):
Thank you! Spent at least 2-3 hours just going through GitHub and google search results trying to find a way to automate it and tried like 5-6 different solutions, and this is the only one that worked. Once again, thanks!
@KryptoOwl commented on GitHub (Oct 3, 2022):
now everyone is posting solutions here is mine because yaall`s didn't work for me lmao
I installed Putty.org and made 2 scripts one for the pi and 1 for windows to ssh and run the script onto the pi
" plink -ssh Rpi@192.168.X.X -pw Password -m C:\barrier.sh " < Turn this into a .bat file in windows
and put the barrier.sh in your C:\
Barrier.sh script: " barrierc --name raspberrypi --no-restart --no-daemon 192.168.X.X "
now you got yourself a button on your windows machine to ssh into your pi and launch barrier on your pi
use the IP address of your keyboard and mouse host
@p6002 commented on GitHub (Feb 26, 2023):
Thanks, works for me, Raspberry 3B. Shows some errors after loging via SSH, but barrier works.