Apple Messing You Up With MeshCentral: Difference between revisions

wiki.TerraBase.info
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
 
Line 1: Line 1:
...try the below to reset things, then set permissions as dialogues pop up, and remember, the thing that needs to be set is behind the window that pops up, and another permissions popup window will appear, hiding what you needed to click on.  Good job moro..., err, Apple!
...try the below to reset things, then set permissions as dialogues pop up, and remember, the thing that needs to be set is behind the window that pops up, and another permissions popup window will appear, hiding what you needed to click on.  Good job moro..., err, Apple!
= Fixing MeshCentral Screen and Input Permissions on macOS Monterey =
This procedure was tested with '''macOS 12.7.6 Monterey''' and MeshAgent installed as:
<pre>
/usr/local/mesh_services/meshagent/meshagent/meshagent
</pre>
The problem presented as MeshCentral remote desktop losing screen display and/or keyboard and mouse control even though macOS appeared to show the appropriate permissions.
The working fix was to reset the macOS privacy permissions and then explicitly enable MeshAgent again in the GUI.
== Reset Screen Recording ==
Run:
<pre>
USER_NAME="$(stat -f '%Su' /dev/console)"
USER_UID="$(id -u "$USER_NAME")"
echo "Console user: $USER_NAME ($USER_UID)"
launchctl asuser "$USER_UID" sudo -u "$USER_NAME" /usr/bin/tccutil reset ScreenCapture
pkill -u "$USER_UID" -f '/usr/local/mesh_services/meshagent/meshagent/meshagent -kvmagent' 2>/dev/null
launchctl kickstart -k system/meshagent
launchctl asuser "$USER_UID" sudo -u "$USER_NAME" \
open 'x-apple.systempreferences:com.apple.preference.security?Privacy_ScreenCapture'
</pre>
In:
'''System Preferences → Security & Privacy → Privacy → Screen Recording'''
MeshAgent was found unchecked after the reset.
Enable '''MeshAgent''' again.
Disconnect and reconnect the MeshCentral Desktop session.
This restored remote screen display.
== Reset Accessibility ==
Run:
<pre>
USER_NAME="$(stat -f '%Su' /dev/console)"
USER_UID="$(id -u "$USER_NAME")"
MESH="/usr/local/mesh_services/meshagent/meshagent/meshagent"
echo "Console user: $USER_NAME UID=$USER_UID"
pkill -u "$USER_UID" -f "$MESH -kvmagent" 2>/dev/null
launchctl asuser "$USER_UID" sudo -u "$USER_NAME" \
/usr/bin/tccutil reset Accessibility
launchctl asuser "$USER_UID" sudo -u "$USER_NAME" \
/bin/killall tccd 2>/dev/null
launchctl kickstart -k system/meshagent
sleep 2
launchctl asuser "$USER_UID" sudo -u "$USER_NAME" \
open 'x-apple.systempreferences:com.apple.preference.security?Privacy_Accessibility'
</pre>
In:
'''System Preferences → Security & Privacy → Privacy → Accessibility'''
Enable '''MeshAgent''' again.
Disconnect and reconnect the MeshCentral Desktop session.
This restored keyboard and mouse control.
== Result ==
After resetting and re-enabling both:
* '''Screen Recording''' restored remote video.
* '''Accessibility''' restored remote keyboard and mouse control.
* MeshCentral continued working after a complete shutdown and startup of the Mac.
This indicates that resetting the macOS Transparency, Consent, and Control (TCC) permissions and explicitly granting them again corrected the persistent permission state.


=== Rough Script Below ===
=== Rough Script Below ===

Latest revision as of 16:50, 28 August 2026

...try the below to reset things, then set permissions as dialogues pop up, and remember, the thing that needs to be set is behind the window that pops up, and another permissions popup window will appear, hiding what you needed to click on. Good job moro..., err, Apple!


Fixing MeshCentral Screen and Input Permissions on macOS Monterey

This procedure was tested with macOS 12.7.6 Monterey and MeshAgent installed as:

/usr/local/mesh_services/meshagent/meshagent/meshagent

The problem presented as MeshCentral remote desktop losing screen display and/or keyboard and mouse control even though macOS appeared to show the appropriate permissions.

The working fix was to reset the macOS privacy permissions and then explicitly enable MeshAgent again in the GUI.

Reset Screen Recording

Run:

USER_NAME="$(stat -f '%Su' /dev/console)"
USER_UID="$(id -u "$USER_NAME")"

echo "Console user: $USER_NAME ($USER_UID)"

launchctl asuser "$USER_UID" sudo -u "$USER_NAME" /usr/bin/tccutil reset ScreenCapture

pkill -u "$USER_UID" -f '/usr/local/mesh_services/meshagent/meshagent/meshagent -kvmagent' 2>/dev/null

launchctl kickstart -k system/meshagent

launchctl asuser "$USER_UID" sudo -u "$USER_NAME" \
	open 'x-apple.systempreferences:com.apple.preference.security?Privacy_ScreenCapture'

In:

System Preferences → Security & Privacy → Privacy → Screen Recording

MeshAgent was found unchecked after the reset.

Enable MeshAgent again.

Disconnect and reconnect the MeshCentral Desktop session.

This restored remote screen display.

Reset Accessibility

Run:

USER_NAME="$(stat -f '%Su' /dev/console)"
USER_UID="$(id -u "$USER_NAME")"
MESH="/usr/local/mesh_services/meshagent/meshagent/meshagent"

echo "Console user: $USER_NAME UID=$USER_UID"

pkill -u "$USER_UID" -f "$MESH -kvmagent" 2>/dev/null

launchctl asuser "$USER_UID" sudo -u "$USER_NAME" \
	/usr/bin/tccutil reset Accessibility

launchctl asuser "$USER_UID" sudo -u "$USER_NAME" \
	/bin/killall tccd 2>/dev/null

launchctl kickstart -k system/meshagent

sleep 2

launchctl asuser "$USER_UID" sudo -u "$USER_NAME" \
	open 'x-apple.systempreferences:com.apple.preference.security?Privacy_Accessibility'

In:

System Preferences → Security & Privacy → Privacy → Accessibility

Enable MeshAgent again.

Disconnect and reconnect the MeshCentral Desktop session.

This restored keyboard and mouse control.

Result

After resetting and re-enabling both:

  • Screen Recording restored remote video.
  • Accessibility restored remote keyboard and mouse control.
  • MeshCentral continued working after a complete shutdown and startup of the Mac.

This indicates that resetting the macOS Transparency, Consent, and Control (TCC) permissions and explicitly granting them again corrected the persistent permission state.


Rough Script Below

USER_NAME="$(stat -f '%Su' /dev/console)"
USER_UID="$(id -u "$USER_NAME")"
MESH="/usr/local/mesh_services/meshagent/meshagent/meshagent"

echo "Console user: $USER_NAME UID=$USER_UID"

pkill -u "$USER_UID" -f "$MESH -kvmagent" 2>/dev/null

launchctl asuser "$USER_UID" sudo -u "$USER_NAME" \
	/usr/bin/tccutil reset Accessibility

launchctl asuser "$USER_UID" sudo -u "$USER_NAME" \
	/bin/killall tccd 2>/dev/null

launchctl kickstart -k system/meshagent

sleep 2

launchctl asuser "$USER_UID" sudo -u "$USER_NAME" \
	open 'x-apple.systempreferences:com.apple.preference.security?Privacy_Accessibility'

echo
echo "ENABLE MeshAgent under ACCESSIBILITY."
echo "Then disconnect/reconnect the MeshCentral Desktop session."