Ylianst/MeshAgent

Black screen before log in on MAC

Opened this issue · 9 comments

r4yzs commented

Hello,

I can't see my screen before log in with my Mac.

I have the latest MeshAgent and macos Ventura.

I see it online and I can use the terminal but I have black screen.

Thanks

Hi @r4yzs,

I see the same issue sometimes with my machines (see attached photo).

I think I figured out what the issue is... Seems like there is something new when it comes to display/monitor sleep that will prevent the Mac from sharing the screen or allowing control.

On the Terminal tab, try running this built in command: caffeinate -u -t 2

caffeinate is a built-in Mac command since 10.9 (Yosemite) that controls whether a user is active or not. -u says to mark the user as active and turn on the display/monitor if it's off. Then -t 2 says to use a 2 second timeout (instead of the default 5 seconds, may not be needed but I found it helpful).

After running that command in the terminal, wait 2 seconds and then go to the Desktop tab and connect. Do you see the screen now and you are in?

Example Issue Image:
image

r4yzs commented

Salut @r4yzs,

Je vois parfois le même problème avec mes machines (voir photo ci-jointe).

Je pense avoir compris quel est le problème... On dirait qu'il y a quelque chose de nouveau en ce qui concerne l'affichage/la veille du moniteur qui empêchera le Mac de partager l'écran ou d'autoriser le contrôle.

Dans l'onglet Terminal, essayez d'exécuter cette commande intégrée : caffeinate -u -t 2

caffeinateest une commande Mac intégrée depuis 10.9 (Yosemite) qui contrôle si un utilisateur est actif ou non. -udit de marquer l'utilisateur comme actif et ** d'allumer l'affichage/le moniteur s'il est éteint. ** Alors -t 2dit d'utiliser un délai d'attente de 2 secondes (au lieu des 5 secondes par défaut, cela peut ne pas être nécessaire mais je l'ai trouvé utile).

Après avoir exécuté cette commande dans le terminal, attendez 2 secondes, puis accédez à l'onglet Bureau et connectez-vous. Voyez-vous l'écran maintenant et vous êtes dedans ?

Exemple d'image de problème :  image

Thanks for your reply,

Same problem, I tried with sudo or not and always black screen....

Gotcha, okay. Sudo is not needed because the meshagent already runs as root in this case.

Out of curiosity, what permissions did you give meshcentral when you installed it on the Mac? After install on the client, I run (on the mesh central admin interface) the "Desktop" tab and click "Connect" which prompts an alert to give "accessibility" to meshcentral to allow control.

After I allow that in the Security settings of "System Settings..." (Ventura, System Preferences... for older) I also go to "Full Disk Access" and drag the meshcentral binary into there. I also go to "Screen Recording" and make sure it's in there. And also put it in "Input Monitoring."

So to list, I give permissions to:

  1. Accessibility
  2. Screen Recording
  3. Full Disk Access
  4. Input Monitoring

(Even though it usually only asks for 1 of these permissions I manually make sure it has all 4).

It could be that you NEED "Screen Recording" or "Input Monitoring" to see the login screen. Not sure because on my side the ONLY time the login screen has been black to remote control is when the display/monitor is turned off (yes including iMacs). And using that caffeinate command wakes up the screen so I can remote control without any black screen.

I am somewhat new meshcentral as well so I am learning as well. Let me know if you are able to give those other permissions, then restart the client machine you are testing with and then try remote controlling it with the MeshCentral agent.

I am not affiliated with MeshCentral but I would be happy to help directly maybe over discord cause I am curious about the specific issue and happy to share my experience with Mac client machines through MeshCentral.

r4yzs commented

@spiffyguy Is there a meshcenter discord ? Or maybe add me : Kyar#4610

Oh, I remember a while ago someone mentioned the sleep thing and caffeinated. I should add an agent command for that, that way in addition to being able to use that from the console tab, we can perhaps add a hook so that the kvm can try to call that on connect or something...

r4yzs commented

Oh, I remember a while ago someone mentioned the sleep thing and caffeinated. I should add an agent command for that, that way in addition to being able to use that from the console tab, we can perhaps add a hook so that the kvm can try to call that on connect or something...

@krayon007 We tested and black screen is only on macos Ventura
I think some dependancy need to be update ..?

Hi @krayon007, yes that sounds good.

I just worked with r4yzs a little on discord and it seems that there are 2 different things going on. What I mentioned still applies. If the screen goes to sleep, sometimes MeshAgent will not wake it up and you get a black screen when you remote control in the Desktop tab. So for that issue, everything you said sounds great.

But the cold boot specific issue r4yzs was having is different (I now see) and realized I am having it too! On Ventura, on a cold boot (or restart) I only get a black screen through MeshCentral. The caffeinate function does not help in this case cause I can see the monitor at work through the security cameras and it is NOT off. Just sitting at the login screen.

Once someone physically signs in at the machine, I then get access to the screen on MeshCentral. I have permissions setup properly and if the person logs out, I STILL have access to the machine remote control. (I can disconnect and reconnect no problem)

So it seems just on the FIRST cold boot there is some sort of hook needed to get the screen to share before logging in.

r4yzs mentioned the software AnyDesk works on a cold boot to get in on Ventura so there IS a way... just not sure what they are doing different compared to MeshAgent.

Still learning and trying things but wanted to share what we experience and be clear about the issue.

r4yzs commented

Hello,

@krayon007 @Ylianst do you have news ?

Thanks you

I'm having the same issue any workaround for this?