MeshCentral icon indicating copy to clipboard operation
MeshCentral copied to clipboard

OSX Mojave MeshAgent Black Screen

Open fazakis opened this issue 5 years ago • 30 comments

On OSX Mojave after installing MeshAgent i can not do remote desktop session. It seems to connect but the screen stays black. image

Further investigation reveals the following:

  1. I can still push the open web browser button and will open a browser on remote machine if i'm logged in on the remote host
  2. On an other Mojave remote machine i first open TeamViewer login on a mojave local user and then if i press Desktop->Connect on MeshCentral it starts to show the Mojave Remote Desktop.

Other details: => version: [email protected] => Accessibility permission is checked for meshagent_osx64 in Privacy settings menu of OSX => Console output: image

fazakis avatar May 28 '19 11:05 fazakis

Mojave introduced some new security features. When you connect KVM for the first time. Mojave pops a security dialog box saying that MeshCentral is requesting remote control access. You'll then have to modify the security settings on Mojave, and then reconnect KVM, and it should work normally.

krayon007 avatar May 28 '19 15:05 krayon007

@krayon007 Thanks for your response as i have stated this option is checked image

fazakis avatar May 28 '19 15:05 fazakis

What version of Mojave are you running? (My machine is 10.14.3)

krayon007 avatar May 28 '19 15:05 krayon007

@krayon007 i have two mojave hosts one on 10.14.2 and one on 10.14.5

fazakis avatar May 28 '19 16:05 fazakis

@krayon007 As i mentioned on the first post and after further testing i can make it more clear:

  1. on mojave 10.14.5 if the mojave is logged in (unlocked with screen active) it is possible to connect the remote desktop and control it fine
  2. on mojave 10.14.2 even when unlocked it keeps showing black screen

Update: I can also confirm the exact same behavior (1) for OSX Yosemite (10.10.2), if the screen is locked(turned off-but no computer sleep) i can only see black screen from MeshCentral

As i can understand the whole problem is related to display-sleep of OSX.

Thanks

fazakis avatar May 28 '19 16:05 fazakis

@krayon007 i would like to ask if this issue is planned to get a fix or will be left as future request to deal with...?

fazakis avatar May 30 '19 18:05 fazakis

I'll take a look at it after we release the user-consent agent update, which should be very soon.

krayon007 avatar May 30 '19 18:05 krayon007

I've a similar issue. I've two monitors. When primary monitor has the focus, then it is working. If second monitor has the focus, I get only a black screen. And how can I switch between the two monitors? I do not see any option in MeshCentral to switch.

hunter-nl avatar Jun 07 '19 07:06 hunter-nl

I have the same issue, is any way to "wake-up" the screen remotely? or prevent it the display-sleep? Im using this on multiple headless mac-mini's so im unable to control them and/or wake-up the display them as they dont have keyboard/mouse and display..

barart avatar Jun 22 '22 01:06 barart

I'll start by doing some research to see if I can find a way to remotely wake the system.

krayon007 avatar Jun 22 '22 04:06 krayon007

I'll start by doing some research to see if I can find a way to remotely wake the system.

Is not exactly a wake the system because is already turned on, is more like a displayoff and is not receiving any internal inputs, if i move the physically a mouse i can start seeing the screen but only the part the the mouse moves and a refresh screen ok meshcentral brings the whole screen, but this is only is you move physically a mouse...

If i connect to vnc this behavior/bug is not present, maybe vnc can bring a clue to fix this

barart avatar Jun 22 '22 14:06 barart

Some video cards in windows, if there's no display connected the video card will not refresh display content (I think because it's in some low power state or something). Problem happens with screenconnect, and mesh on windows with some machines with no monitor.

It's why these exist

https://www.amazon.com/Display-Emulator-Compatible-Windows-fit-Headless/dp/B07C4TWZRM/

If you can find the cause, it'd be nice to try and get a software fix everywhere.

silversword411 avatar Jun 22 '22 14:06 silversword411

Some video cards in windows, if there's no display connected the video card will not refresh display content (I think because it's in some low power state or something). Problem happens with screenconnect, and mesh on windows with some machines with no monitor.

It's why these exist

https://www.amazon.com/Display-Emulator-Compatible-Windows-fit-Headless/dp/B07C4TWZRM/

If you can find the cause, it'd be nice to try and get a software fix everywhere.

I already tried with monitor attached and with this hdmi dummy and the same behavior occurs, also i have my power options on never turn off display and prevent computer from sleeping on all my macs

i already tested from a M1 mac mini, i5 mac mini and a old intel xeon mac pro using them as head-less, with monitor and with hdmi dummy attatched and same behaivor occurs

i can connect and control them using vnc without any problems, only meshcentral is having this issue, as a new clue, when i connect to them using vnc i see the black window too but as soon as i click on any part of the black screen the image comes and after it comes i can see the image on meshcentral too, the problem i see is that meshcentral seems not to send a input to the black screen as the black screen is present on vnc too but with vnc any click makes the black screen dissapear and as soon as the black screen dissapear the image shows in meshcentral too and you can control the machine with meshcentral

barart avatar Jun 22 '22 15:06 barart

That part I noticed a while ago. The API I use for input injection don't wake the screen, and also dont seem to trigger the hover event on the dock.

krayon007 avatar Jun 22 '22 16:06 krayon007

That part I noticed a while ago. The API I use for input injection don't wake the screen, and also dont seem to trigger the hover event on the dock.

Interesting...I wonder how many API methods there are...

silversword411 avatar Jun 23 '22 00:06 silversword411

Does we have a update on this?

barart avatar Jul 26 '22 19:07 barart

Again.. asking for update on this so this bug dont lose interest

barart avatar Nov 15 '22 19:11 barart

How many monitors are on your system?

krayon007 avatar Nov 15 '22 19:11 krayon007

How many monitors are on your system?

I have 4 systems, one M1 with two monitors, other M1 with one monitor, one i5 with one monitor and one old macpro xeon with one monitor too, all of them present the same problem

barart avatar Nov 15 '22 22:11 barart

Bumping this again

barart avatar Jan 04 '23 18:01 barart

Same here, but you can use caffeinate -u -t 30 to make the screen temporarily show the login page. If MeshCentral can execute this command when the desktop is connected, that's a perfect solution.

whlsxl avatar May 31 '23 14:05 whlsxl

The problem is not sleeping, i have my macs to prevent sleeping also to prevent turn off the display and the problem persist, if i attach a monitor to the mac, it shows the login screen always and i can login, but meshcentral still seeing the blackscreen until i login directly on the mac, if i "lock" the mac, meshcentral is able to see the login screen and im able to login, but after few minutes meshcentral only shows the blackscreen and im unable to do anything (only login to terminal) the use of caffeinate dont do anything because the mac is actually waked-up, the problem is something else

barart avatar Aug 18 '23 19:08 barart

Bumping again

barart avatar Oct 07 '23 18:10 barart

Bumping again

Please don't bump,

Sadly I don't have a mac so I cannot have a look at it, and @Ylianst works on it too from time to time, and I'm not sure if he has a Mac either? If anybody has mac hardware we can connect into or donate, please email me and ill have a look at it

si458 avatar Oct 07 '23 18:10 si458

fix was merged @si458 https://github.com/Ylianst/MeshAgent/pull/181

dinger1986 avatar Nov 12 '23 16:11 dinger1986

fix was merged @si458 Ylianst/MeshAgent#181

I have not been able to test it because the fix hast not been pushed yet, however, the fix is about permissions or validate permissions on start, but this is not the case... permissions are there actually, but, the problem is that if nobody is using the mac for xxx time, there is no way to "see" the screen or "send" any commands from the meshcentral desktop, client is connected and you can connect to Desktop but only to see a black screen, but you can use files and terminal without any problem, however if you "move" the mouse that is physically connected to the mac and then you "re-connect" or "connect" to the desktop on meshcentral you can see the screen again and use it from meshcentral

I can confirm that this is not any type or sleep or suspend, the mac itself is actually "awaken" showing the screensaver on the attached display, my guess is some kind of protection to prevent remote access if nobody use it in xxx time? BUT there is a BUT and my "workaround"... TeamViewer is not affected by this: I have installed teamviewer on the macs, so, when i want to connect to them from meshcentral and it shows the blackscreen, i connect to it from TeamViewer, and do anything (open a folder for example) then connect it from meshcentral and i can see the desktop and use it again,

Another workaround is to reboot it from meshcentral, and as soon as it connect it to mescentral again, connect to it and login a soon as possible and i can use it from meshcentral, this not work always, it only gives some secs to "activate" the protection¿? idk

barart avatar Jan 12 '24 01:01 barart

Sadly I only have an old 2012 macbook pro, so I can't get it to compile the source code for the agent correctly as the os is too old...

Anybody willing to donate access/post me a new M1 or above series device , I can look at getting the agent to compiled for you

si458 avatar Jan 12 '24 07:01 si458

@si458

You can run up to macOS Catalina on your macbook pro, the problem is not for M(x) processors it for Mojave OS (and later) or maybe earlier OS's idk, i just have access to mac mini 2014, i would like to donate an access to it but i cant as is my boss office computer, he is going to buy a new one this year and then i can give access to it but i dont know when this is going to happen

Or why you need a new M(x) mac?

barart avatar Jan 15 '24 17:01 barart

with an M mac, i can compile the code for arm64 but also run Mac x64 as VM and compile mac on there! hense the need for an M mac really as they are better, but prices are ridiculous! but once i have a new(ish) mac of some form, i can compile the binarys for the agent and do more testing! as explained above the PR was merged by @Ylianst into the repo to hopefully fix issues, but we cant compile the mac agents anymore without a mac

si458 avatar Jan 15 '24 17:01 si458

Hey Guys, Any Update on the Mesh Blank screen issue?

AymanAnsari avatar Feb 06 '24 15:02 AymanAnsari