{"id":1448,"date":"2022-11-13T00:32:57","date_gmt":"2022-11-13T06:32:57","guid":{"rendered":"https:\/\/www.schwie.com\/brad\/?p=1448"},"modified":"2022-11-13T00:53:52","modified_gmt":"2022-11-13T06:53:52","slug":"system-com-apple-screensharing-fix","status":"publish","type":"post","link":"https:\/\/www.schwie.com\/brad\/?p=1448","title":{"rendered":"system\/com.apple.screensharing fix"},"content":{"rendered":"<p>After <a href=\"https:\/\/www.schwie.com\/brad\/?p=1355\">installing OpenCore Legacy Patcher on my Mac mini<\/a>, it has been flawlessly running Monterey for several months, with the exception that screensharing stops randomly. To get around this, I&#8217;ve been making an ssh connection to the Mac mini and then run this command:<\/p>\n<p><code>sudo launchctl kill KILL system\/com.apple.screensharing<\/code><\/p>\n<p>Rather than having to run this command manually, automate it with launchctl to run as a LaunchDaemon every day at 2 am:<\/p>\n<ol>\n<li>Touch a .plist file in the following directory using this command in Terminal:<br \/>\n<code>sudo touch \/Library\/LaunchDaemons\/com.screensharing.restart.plist<\/code><\/li>\n<li>Edit the .plist file by executing this command in Terminal:<code>sudo pico com.screensharing.restart.plist<\/code><\/li>\n<li>Copy text from <a href=\"http:\/\/schwie.com\/brad\/images\/keep\/example.plist\">this file<\/a> and paste it into your .plist file.<\/li>\n<li>Save your .plist file by pressing the &#8220;control&#8221; and &#8220;x&#8221; keys and choose press &#8220;y&#8221; and &#8220;return&#8221;.<\/li>\n<li>Load the .plist into launchctl using the following command in Terminal.app:<br \/>\n<code>sudo launchctl load \/Library\/LaunchDaemons\/com.screensharing.restart.plist<\/code><\/li>\n<li>If the LaunchDaemon loaded, it should appear in the list produced by this Terminal command:<br \/>\n<code>sudo launchctl list<\/code><\/li>\n<li>To unload the LaunchDaemon we created above, execute the following command in Terminal:<br \/>\n<code>launchctl unload \/Library\/LaunchDaemons\/com.screensharing.restart.plist<\/code><\/li>\n<li>Finally, if you wish to completely remove this command from your machine, delete the .plist file with this command:<br \/>\n<code>sudo rm \/Library\/LaunchDaemons\/com.screensharing.restart.plist<\/code>\n<\/ol>\n<p>Worth noting, this LaunchDaemon executes as the &#8220;_www&#8221; user, so it should run whenever the Mac mini has booted Monterey. Will keep you posted how this works and if I need to increase the frequency. Ultimately, I&#8217;d like to find out what is causing the screensharing crash, but that may be above my abilities.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>After installing OpenCore Legacy Patcher on my Mac mini, it has been flawlessly running Monterey for several months, with the exception that screensharing stops randomly. To get around this, I&#8217;ve been making an ssh connection to the Mac mini and &hellip; <a href=\"https:\/\/www.schwie.com\/brad\/?p=1448\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1448","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.schwie.com\/brad\/index.php?rest_route=\/wp\/v2\/posts\/1448","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.schwie.com\/brad\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.schwie.com\/brad\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.schwie.com\/brad\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.schwie.com\/brad\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1448"}],"version-history":[{"count":19,"href":"https:\/\/www.schwie.com\/brad\/index.php?rest_route=\/wp\/v2\/posts\/1448\/revisions"}],"predecessor-version":[{"id":1467,"href":"https:\/\/www.schwie.com\/brad\/index.php?rest_route=\/wp\/v2\/posts\/1448\/revisions\/1467"}],"wp:attachment":[{"href":"https:\/\/www.schwie.com\/brad\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1448"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.schwie.com\/brad\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1448"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.schwie.com\/brad\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1448"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}