New Linux Mint install needs barrier to load before login

Have not been able to find a solution to this one, but I use Barrier on my Kubuntu 23.04 as host/server and newly installed LM 21 on laptop as client. It never occurred to me before this that the reason I can use my keyboard/mouse to login on KDE is because those are already connected via bluetooth to that machine. Now when LM boots, I have to open the laptop and use its keyboard to login. Is there a way to have this autostart before login on LM? Or is the only option to auto login?

Thanks,
Sheila Flanagan

Hi Sheila, :wave:

have you tried:

  • start barrier
  • in GUI: tab “Barrier” —> “Change Settings”
  • in the “General” tab (there´s just this one, it seems): click on “Start Barrier on Startup”

No idea if it has the desired effect, but it´s worth a shot, I think.

Many greetings from Rosika :slightly_smiling_face:

No, I have that set on all systems. The issue is it only starts once the system loads, not before login so that I can use the keyboard to log in.

Thanks,
Sheila

I see.

Hmm, what you already suggested :

might be a solution.

In fact I´m using it this way as well.

My main system is a desktop PC (Linux Lite 6.2) and the other one is a laptop (Linux Lite 6.4).
As I´m the only user of both systems I had no problem with using auto-login with the laptop.
Your case may be different of course. So at the moment I´ve no idea what can be done other than opting for autologin for the laptop.

But perhaps there´s someone else in the forum who might be able to help.

Sorry, Sheila. :neutral_face:

Many greetings from Rosika :slightly_smiling_face:

1 Like

Yes, that would work for me as well @Rosika as I am the only user on all computers. I am currently testing Linux Mint (Cinnamon) on my old laptop to see if it will work for a new Linux user that I am giving it to (a family friend). They may want to login/have multiple users so I was just checking before uninstalling Barrier as a no-solution for their situation. Thanks for your help. I saw lots of posts on this subject a few years ago for Ubuntu, but no one ever came up with a solution, even on Github.

Sheila Flanagan

Thanks for the feedback, Sheila.

But hang on, I´m just in the middle of a conversation with ChatGPT regarding this very topic.

Let´s see if it can come up with anything substantial.

Cheers
Rosika :slightly_smiling_face:

1 Like

O.K., Sheila, there seems to be a way of letting barrier run before login.

Here´s how it could work:

Yes, there is a way to configure Barrier to run before login on Linux Mint.
To achieve this, you can set up Barrier as a systemd service.
Here’s a step-by-step guide to help you through the process:

  1. Open a terminal on your Linux Mint laptop.

  2. Create a systemd service unit file for Barrier using a text editor. Run the following command to open the file in the nano editor:

sudo nano /etc/systemd/system/barrier.service
  1. In the nano editor, enter the following content:
[Unit]
Description=Barrier Service
After=network.target

[Service]
ExecStart=/usr/bin/barrierc

[Install]
WantedBy=default.target
  1. Save the file and exit the nano editor. In nano, you can do this by pressing Ctrl+O, then Enter to save, followed by Ctrl+X to exit.

  2. Enable the Barrier service to start on boot:

sudo systemctl enable barrier.service
  1. Start the Barrier service:
sudo systemctl start barrier.service

Now, Barrier should start automatically before login on your Linux Mint laptop. You can test it by rebooting your system and verifying that Barrier is running before the login screen appears. Once you log in, Barrier should be ready to use.

Please note that the instructions provided assume that you have installed Barrier in the default location. If you have installed Barrier in a different location, you may need to modify the ExecStart line in the systemd service unit file accordingly.

Please note that I have not tested it. But the process sounds logical, I guess.

And as always, take anything ChatGPT says with a grain of salt. :wink:

Many greetings from Rosika :slightly_smiling_face:

P.S.:

perhaps a second opinion of the instructions above by some forum members :question:

I have knowledge of mkdir, is mkfile a command? Remember I am a beginner in terminal commands. If using mkdir/FILENAME where does this file reside? which directory?

I really appreciate your helping me to solve this.

Sheila

Actually if you only want to create a file use the touch command.
Like so: touch test.txt
It creates an empty text file in the current directory.

But the command

sees to it that the file barrier.service is created in the correct directory : /etc/systemd/system.

So you just need to issue the command. Then the nano editor (in the terminal) will open up and you can go on with inserting what´s listed under point 3 (see above).

Then point 4 to save it all. Then go on with point 5 and 6.

Cheers from Rosika :slightly_smiling_face:

@Rosika
Great. Done. Now I will wait for my current large file download to finish on LM and reboot to test. If this works, I guess ChatGPT might have some use…lol.

Sheila

Yes, that´s right.

But please bear in mind you should never trust ChatGPT blindly.

It´s best to have some basic knowledge regarding the suggested commands to see what they will do.
If in doubt do a research on them or look up the man pages etc.

That said, these recommendations are equally valid for any tutorials you find on the internet if you don´t know or completely trust the source.

However ChatGPT can certainly be a good starting point for solving problems. :wink:

Many greetings from Rosika :slightly_smiling_face:

Well, looks like it did not work. I tested using the mouse from my KDE pc running barrier and it did not work. Since the keyboard is a bluetooth connection, sometimes there is a delay in the response when logging into KDE system, but it always works (via bluetooth) after a few taps. I gave it time and more than a few keystrokes, but nothing in the password box for login on LM.

BUT I noticed that even though settings in Barrier have the “Start Barrier on startup” checked, it does NOT start (it says it is not running and the “start” button is active) and I see that the IP address is blank. I did not have this issue before on other systems (Windows 11, KDE, etc.) Why is is not retaining the IP address of the Barrier host?

My initial setup on LM was to disable SSL, input the host IP address and when this “not starting” happened upon the next reboot, I figured I needed to check the “auto config” box and that would remedy this. Guess not.

So in order to see if the process we used actually works, we need to get barrier to actually START on reboot. It might be easier to do this in terminal. Any thoughts?

Sheila

…

Hmm, I actually don´t know why that is. :thinking:

That´s good so far. I did it too on both of my systems.

I guess you have no firewall issues as barrier worked before?
I know barrier uses port 24800 and in my case this has to be taken care of…

Well, we definitively need other people´s help here.

I have to be off now, but perhaps tomorrow there might be some new answers to your problem…

Sorry I couldn´t be of much help.

Many greetings from Rosika :slightly_smiling_face:

Thanks @Rosika. I am unsure about the firewall on LM. It only worked before because I keep inputting the IP address and hitting start. So maybe there is something I am unfamiliar with in LM that did not occur in Kubuntu. I do want to ask about this to anyone reading this thread who could maybe answer. In reading the use of logs that @nevj pointed me to, I used the following command to check barrier via PID:

Jul 09 08:45:37 myviolinsings-desktop ksmserver[4077]: *** WARNING *** The program 'barrier' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the App>
Jul 09 08:45:37 myviolinsings-desktop ksmserver[4077]: *** WARNING *** Please fix your application to use the native API of Avahi!

Is this an issue that needs resolving? I read the link and it was “Greek” to me. Just want to ensure this warning does not preclude smooth running on the KDE as well as the LM system.

Sheila

1 Like

Hi Shiela,
It seems to mean barrier is trying to do a dns lookup (ie find the IP address corresponding to a computer name) . To do that it has to contact a computer which is setup as a nameserver ( probably your ISP ).
Barrier is trying to do this using something called DNSServiceRegister, but it should be using the Avahi daemon.
So 2 questions

  • is there any barrier setting that might be relevant to this ie anything to do with dns?
  • is the avahi daemon running… to check try
    ps ax | grep avahi

BTW I notice you have mastered the code in boxes business

Regards
Neville

1 Like

This is how I get around it - I don’t use Barrier - I use Synergy (Barrier is an OSS fork of Synergy) Pro… I think there’s a way to make it work like that on MS Windows, but I don’t have any MS Windows…

My Synergy server is my Ryzen 7 Pop!_OS desktop machine, my 3 clients are 2 MacBooks, and 1 x Thinkpad with Ubuntu 23.04.

BOTH the Linux machines autologin to the desktop, I trust this because in BOTH cases, my “/” root filesystem (I don’t partition - everything’s on “/”) is encrypted with LUKS. I hardly ever reboot anything, and I keep my MacBooks “awake” by a shell script that runs caffeinate (keeps MacOS “awake”) - and even when locked, I can still use Synergy to unlock them (but I mostly just use my fingerprint). When I knock off for the day (or evening) - I just close all my laptop lids and power off my monitors…

Without encryption, I don’t think I’d be comfortable with autologin…

Starting it before login could be a problem, as BEFORE login, you’re probably only running a DM (display manager) not a DE (desktop environment with window manager). I seem to remember I did this years ago with Synergy 1.14.x or something, back before I paid for a license, I used to kick synergy off manually / scripted with text file configuration - so it would run BEFORE the DE loaded… I bought Synergy Pro in 2018…

1 Like

@daniel.m.tripp I thought Synergy was dead and that Barrier had forked off of it. I did not know it still existed. I do have a windows laptop for client work that I have setup with Barrier for my Ubuntu 23.04 server, otherwise, all my machines are Linux or Android-based. I guess I could encrypt my system (with some assistance, of course) and I do not mind the autologin for my own machine since I am the only computer user in the home (kids are all gone) so not sure if it is necessary. Please explain why you need to encrypt for security.

The new system with Linux Mint is on one of my older laptops I am giving to a friend who wants to learn Linux, and she would not be comfortable with autologin. So I guess I have to tell her she will not be able to use Barrier until after the system loads, but it is a laptop, so it’s not like it can’t be done…more of a hassle. But if Synergy is still available, I could at least give her that option to purchase; I may look into that myself if it is better than Barrier (I do have some gripes).

Thanks,
Sheila Flanagan

No - Synergy OSS version is discontinued - hence why it was forked to Barrier - Synergy Pro is still a viable product, but it’s commercial.

I think the last version of Synergy you could get for free was 1.12/13.x or something (e.g. you can pull it into Ubuntu or Debian) - I paid for a Pro License so I can get the Pro version…

I think you can still install it (if you can find a download link - download from their site [Symless] requires a login) - but it will nag you about activating the product. I’m still using 1.46.6 - which will be the last 1x version they’re release I think - as they’re encouraging us (customers) to cutover to Synergy 3.x…

Because I bought it in 2018 - I’m classed as an early adopter, and I think I have a lifetime license to 3.x, but probably won’t be entitled to 4x if they ever get there, and/or I’m still around…

Note : neither Synergy (1, or 3) or Barrier support Wayland yet… I think they’re working on Wayland support in Synergy 3.

1 Like

I don’t think so. At least I don’t see anything about dns.

It is running on both machines. So why does Barrier report it not being used?

And yes my posts look pro now, thanks to you… :slightly_smiling_face:

Sheila

1 Like

@daniel.m.tripp What is the advantage of Pro? I will eventually be trying other non-Ubuntu/Debian desktops as I am trying to get a feel for multiple Linux OS and how they work differently, so for now, no Wayland, but if it works across most of them, it might be nice to check out. I’ll see what I can find.

Thanks,
Sheila Flanagan