Ylianst / MeshCentral

A complete web-based remote monitoring and management web site. Once setup you can install agents and perform remote desktop session to devices on the local network or over the Internet.
https://meshcentral.com
Apache License 2.0
3.7k stars 510 forks source link

NixOS (Linux) Mesh Agent #5802

Open ww4 opened 4 months ago

ww4 commented 4 months ago

NixOS is gaining in popularity among Linux users, due to being an immutable / declarative style OS. There are thousands of packages available for it, including the MeshCentral server. However the Mesh Agent is not available.

The standard method of installation for Linux agents appears to be downloading a bash script and running it. This is not my preferred way to install software on Linux, and absolutely won't work on NixOS, as all packages are installed by Nix from a config file.

How do you go about adding Mesh Agent support for various Linux distributions? If someone can explain the codebase a little, I would be willing to take a stab at this.

si458 commented 4 months ago

You can just download the binary file directly from the web ui, then run meshagent -install for it to install OR meshagent -run to run it in the forground instead of the background Does this help?

Edit. I've never heard of nixos isn't it just an x64 bit platform? Edit2. Can't fully remember if those are the command line options but u can run meshagent -help to get the options

tomsik-radek commented 4 months ago

I talked about immutable Linux in #5384, about SteamOS. The issue was that you can't write the systemd service into /etc/systemd/system/. Sadly it wouldn't stay connected.

tomsik-radek commented 4 months ago

You can just download the binary file directly from the web ui, then run meshagent -install for it to install OR meshagent -run to run it in the forground instead of the background Does this help?

Edit. I've never heard of nixos isn't it just an x64 bit platform? Edit2. Can't fully remember if those are the command line options but u can run meshagent -help to get the options

It's an immutable distro, sort of like Fedora Silverblue or SteamOS3

ww4 commented 4 months ago

you can't write the systemd service into /etc/systemd/system/

NixOS usually handles this with symlinks. Lots of binaries get packaged this way for Nix, there are over 80,000 packages in the repo. https://search.nixos.org/packages. Someone just has to take an interest and dive in.

I'm working on this myself but it's a steep learning curve. So far I have gotten the installer to launch, but it complains about not running as sudo (it is running as sudo). I'll keep digging in as I have the time.

buckybytes commented 4 months ago

It looks like NixOS knows this is going to be a common issue for users.

https://nixos.wiki/wiki/Extend_NixOS

Shows how to extend the system with additional software, and how to upload your package to the repo.

Kuuchuu commented 3 months ago

Until a native NixOS solution is created, I've put together a workaround using Docker. Desktop tab does not work, but Terminal and Files work good, so perfectly fine for a headless NixOS install: https://github.com/Kuuchuu/meshagent-docker