Skip to content

Home.Service.Linux Setup

Code A Software edited this page May 2, 2025 · 13 revisions

Home.Service.Linux - Client

Additional Information

  • To fix black screenshots with scrot on Ubuntu >= 21.10 see: https://askubuntu.com/a/1347651/692902
  • To get screenshots from a Raspberry PI, change display_server_protocol to wayland (see config.json)

Commands/Tools used:

  • sudo apt install scrot
  • sudo apt install grim (for screenshots using Raspberry PI)
  • sudo apt install sysstat
  • sudo apt install curl
  • sudo apt install lshw

⚠ WARNING: The version you can install on the Raspberry PI produces invalid json! Make sure lshw generates valid json-data, otherwise it is recommended to compile it yourself:

  1. git clone https://github.com/lyonel/lshw.git
  2. make
  3. sudo make install
  • Ensure that both scripts screenshot.sh and hw.sh are executable (using chmod -x)

Setup

  1. Edit config.json (comments should be removed!):
{
  "id": null, /* Will be set automatically */
  "user": "server", /* Should not be root, but can be like pi */
  "api": "http://192.168.10.10:83",
  "location": null,
  "device_group": null,
  "os": 1, /* Android = 0 | Linux = 1 | LinuxMint = 2 | LinuxUbuntu = 3 | Windows = 4-9 | Unix = 10 | Other = 11 */
  "type": 0, /* SingleBoardDevice = 0 | MiniPC = 1 | Notebook = 2 | Desktop = 3 | Server = 4 */
  "is_signed_in": false, /* should be false on first start! */
  "ip": null, /* Can be set if IP cannot be read */
  "mac": null, /* Can bet set if Mac cannot be read */
  "enable_screenshots": true,
  "x_display_index": 0,
  "display_server_protocol": "x11", /* x11 or wayland (scrot, grim) [Used for screenshots: RPI: wayland, Ubuntu-Desktop: x11 with https://askubuntu.com/a/1347651]*/
  "enable_remote_file_access": true,
  "check_for_updates_on_start": true, /* Updates will only work correctly, if Home.Service.Linux is running via systemd-service! */
  "use_automatic_update_timer": false,
  "automatic_timer_interval_hours": 24,
  "dotnet_path": "/usr/bin/dotnet"
}
  1. See here for installing dotnet8 for your linux distro!
  2. Locate your dotnet installation (.NET Core 8.0.x and ASP.NET Core 8.0.x are both required!)
  3. Create a service file at /etc/systemd/system/home.client.service:
[Unit]
Wants=network-online.target
After=network.target network-online.target
Description=HomeClient Service

[Service]
WorkingDirectory=/media/server/Server/andy/home.client
ExecStart=/usr/bin/dotnet /media/server/Server/andy/home.client/Home.Service.Linux.dll
Restart=always
# Restart service after 10 seconds if the dotnet service crashes:
RestartSec=10
# Timeout to ensure that the service gets killed fast
TimeoutStopSec=5
SyslogIdentifier=homeclient
User=root

[Install]
WantedBy=multi-user.target
  • Make sure your pathes are correctly setuped!
  1. Enable service: sudo systemctl enable home.client.service
  2. Start service: sudo systemctl start home.client.service
  • You can also maintain the service with sudo service home status!

Clone this wiki locally