2

we use chrome remote desktop to perform remote access to ubuntu, but I am not able to enable more than 32 users (each user is a systemctl unit and after reaching 32 unit loaed, I cannot start others).

to list the loaded units use the command:

sudo systemctl reset-failed && sudo systemctl list-units 'chrome-remote*'

to activate the unit I use the command

sudo systemctl stop chrome-remote-desktop@<user>.service

  • sudo systemctl status chrome-remote-desktop@user.service

● chrome-remote-desktop@user.service - Chrome Remote Desktop instance for user
     Loaded: loaded (/etc/systemd/system/chrome-remote-desktop@.service; enabled; vendor preset: enabled)
     Active: inactive (dead) since Fri 2023-03-10 04:48:04 -03; 4min 5s ago
    Process: 58249 ExecStart=/opt/google/chrome-remote-desktop/chrome-remote-desktop --start --new-session (code=exited, status=1/FAILURE)
   Main PID: 58249 (code=exited, status=1/FAILURE)

sudo journalctl -u chrome-remote-desktop@<user>.service

mar 10 04:28:35 <host_name> chrome-remote-desktop[8639]: Invalid MIT-MAGIC-COOKIE-1 keyxdpyinfo: unable to open display ":25".
mar 10 04:28:36 <host_name> chrome-remote-desktop[8671]: Invalid MIT-MAGIC-COOKIE-1 keyxdpyinfo: unable to open display ":25".
mar 10 04:34:10 <host_name> chrome-remote-desktop[46517]: Killing process 31788
mar 10 04:35:23 <host_name> chrome-remote-desktop[49840]: Invalid MIT-MAGIC-COOKIE-1 keyxdpyinfo: unable to open display ":50".
mar 10 04:35:24 <host_name> chrome-remote-desktop[49841]: Invalid MIT-MAGIC-COOKIE-1 keyxdpyinfo: unable to open display ":50".
mar 10 04:35:24 <host_name> chrome-remote-desktop[49847]: Invalid MIT-MAGIC-COOKIE-1 keyxdpyinfo: unable to open display ":50".

How could I increase "units loaded" by leaving all services "active" and 'running'?

best

Rafael
  • 105
  • 7

1 Answers1

0

Yes systemd has a default limit of 32 units that can be loaded at once, you can fix that by modifying the DefaultTasksMax setting in the systemd configuration file.

go to /etc/systemd/system.conf

search DefaultTasksMax and put it to infinity like that DefaultTasksMax=infinity

then reload systemctl sudo systemctl daemon-reload it should work

Saxtheowl
  • 1,609
  • 2
  • 9
  • 20
  • I'm curious how you established the value of 32 units here? How exactly is that related to the DefaultTasksMax value (which appears to be `DefaultTasksMax=15%` in the default /etc/systemd/system.conf file). The documentation suggests it's expressed as a percentage of the /proc/sys/kernel/pid_max value, giving a "default default" of 0.15 x 32768 = 4915 even on a 32-bit system. Is this really the max number of units, or is it the max number of tasks that an individual unit may create? – steeldriver Mar 09 '23 at 19:10
  • It just was the value on the VM I was on – Saxtheowl Mar 09 '23 at 21:41
  • I made the suggested adjustment. All users appear as loaded, but after 32 loaded units, the rest are inactive and dead – Rafael Mar 10 '23 at 07:57
  • I put in the initial question the status of the user which would be "33 loaded units". I started 32 users. One of these was my user. so I stopped him, started another one. After that my user had the status indicated above – Rafael Mar 10 '23 at 08:05
  • what does sudo journalctl -u give you ? – Saxtheowl Mar 10 '23 at 18:10
  • 1
    I put the journalctl return at the end of the question above – Rafael Mar 10 '23 at 22:15
  • 1
    I think your problem is a ressources limit like memory or CPU running out of availability or a dependencies one which will force the system to mark your units as inactive or dead, maybe chrome need a ressources that can be opened more than 32 times ? you should check dmesg too – Saxtheowl Mar 11 '23 at 00:37
  • CPU and memory I believe are not a problem due to the hardware of the machine (RAM 32GB and AMD Ryzen 9 5950X 16-Core Processor) – Rafael Mar 15 '23 at 12:30
  • what should i look for in dmesg? systemd services won't show up there correct? – Rafael Mar 15 '23 at 12:39
  • We can try something new, go to /etc/systemd/system.conf with sudo search a line #DefaultInstancesMax and remove the leading # or add the variable it at the end of the file so that you have DefaultInstancesMax=64 then reload sudo systemctl daemon-reload – Saxtheowl Mar 15 '23 at 20:52
  • I still haven't been successful in having more than 32 active users. any suggestion is welcome! – Rafael Mar 21 '23 at 18:32
  • Lets try the file /etc/sysctl.conf , modify it by adding this line fs.file-max = 65536 then apply it sudo sysctl -p – Saxtheowl Mar 21 '23 at 18:43