Workaround for Universal Control Disconnects?

I have started using the Universal Control feature to share a keyboard and mouse between an M2 Mac mini (2023) running Sequoia 15.3 and a Mac mini (2018) running Monterey 12.7.6. Although, the feature works well most of the time, I've experienced fairly frequent disconnects.


The automatic reconnect option is useful in this respect but I would like to find a workaround to avoid the disconnects, if at all possible. I read one post which suggested that Bluetooth pairing between the two machines could be useful. Unfortunately, I was not able to pair the two Macs (in either direction).


Perhaps it's anecdotal, but I believe there's been a slight improvement since I connected the ThunderBolt 3 and 4 ports on the two machines (to establish a ThunderBolt Bridge connection).


Would anyone have any other suggestions?


- Pie Lover


Mac mini (M2, 2023)

Posted on Feb 2, 2025 6:31 AM

Reply
13 replies
Sort By: 

Feb 3, 2025 8:37 AM in response to BlueberryLover

In addition to using a shorter (3 foot) ThunderBolt 4 cable between the 2 Macs, below are some other changes that seem, in total, to facilitate the use of Universal Control:


  1. moved a DECT 6.0 cordless phone further away from the two Mac minis. This should not have been an issue since DECT 6.0 frequencies don't overlap with WiFi or Bluetooth.
  2. oriented the Mac mini (2018) vertically in an attempt to have a better "line of sight" between with the WiFi router (approximately 6 feet away) and Bluetooth with the second Mac mini (approximately 3 feet away).
  3. (re-)enabled "Automatically reconnect to any nearby Mac. This makes it easier to reconnect should Universal Control disconnect.

Hope this helps.


- Pie Lover

P.S. Unrelated to Universal Control but the file transfer using the ThunderBolt bridge is about twice as fast as using a GigE ethernet connection



Reply

Feb 18, 2025 5:02 AM in response to BlueberryLover

I noticed that switching the network connection from a Virtual Interface ThunderBolt Bridge to a ThunderBolt Service resulted in about a 25% speed improvement when connecting the two Macs. I think this eliminates an extra protocol layer and works because of the point-to-point connection.


It's even possible that adding a second ThunderBolt Service (i.e. a second link) would enable multichannel SMB for even faster transfer speeds.


- Pie Lover


Reply

Feb 9, 2025 4:16 AM in response to BlueberryLover

Screen Lock of the display on the primary computer will prevent cursor movement and keyboard entry on secondary computer. This can be prevented by executing the caffeinate Terminal command (on the primary computer) as follows:


	tell application "Terminal"
		do script "caffeinate -d -t 3600"
	end tell


The numeric value is the time (in seconds) to delay the screen lockout period by.


- Pie Lover

Reply

Feb 17, 2025 11:01 AM in response to BlueberryLover

More recommendations for etc/nsmb.conf for macOS:


# /etc/nsmb.conf
# parameter                             default value
#
# nbtimeout               + + -          1s             Timeout for resolving a NetBIOS name
# minauth                 + + -          NTLMv2         Minimum authentication level allowed
# streams                 + + +          yes            Use NTFS Streams if server supported
# soft                    + + +          no             Force all mounts to be soft
# notify_off              + + +          no             Turn off using notifications
# kloglevel               + - -          0              Turn on SMB kernel logging
# protocol_vers_map       + - -          7              Bitmap of SMB Versions that are enabled
# signing_required        + - -          no             Turn on SMB client signing
# signing_req_vers        + - -          6              Bitmap of SMB Versions that have signing required
# validate_neg_off        + - -          no             Turn off using validate negotiate
# max_resp_timeout        + + -          30s            Max time to wait for any response from server
# submounts_off           + + +          no             Turn off using submounts
# dir_cache_async_cnt     + + -          10             Max async queries to fill dir cache
# dir_cache_max           + + -          60s            Max time to cache for a dir
# dir_cache_min           + + -          30s            Min time to cache for a dir
# max_dirs_cached         + + -          Varies         Varies from 200-300 depending on RAM amount
# max_cached_per_dir      + + -          Varies         Varies from 2000-10000 depending on RAM amount
# netBIOS_before_DNS      + + +          no             Try NetBIOS resolution before DNS resolution
# mc_on                   + - -          yes            Turn on SMB multichannel (allow more than one channel per session)
# mc_prefer_wired         + - -          no             Prefer wired NICs over wireless in multichannel mode - Some Wi-Fi networks advertise faster speeds than the connected wired network. 
# encrypt_cipher_map      + - -          15             Bitmap of SMB 3.1.1 encryption algorithms that are enabled
# force_sess_encrypt      + - -          no             Force session encryption for all mounts
# force_share_encrypt     + - -          no             Force share encryption for all mounts
[default]
# Protocol version is specified using binary bitmap
# 7 => 0111 => SMB 1/2/3 should be enabled
# 6 => 0110 => Only SMB v2/3 should be enabled
# 4 => 0100 => Only SMB v3 should be enabled
# 3 => 0011 => Only SMB v1/2 should be enabled
# 2 => 0010 => Only SMB v2 should be enabled
# 1 => 0001 => Only SMB v1 should be enabled
# Force SMB v3 only
protocol_vers_map=4
# No SMB1, so disable NetBIOS
# See the following for more details: 
# - https://support.apple.com/en-us/HT211927
port445=no_netbios
# Max time to wait for any response from server
#max_resp_timeout=600
# Use soft mounts by default
#soft=yes
# When you use an SMB 2 or SMB 3 connection, local caching is enabled by default. 
# You might want to turn off local caching if content on the server changes frequently, 
# or the Finder sometimes shows only a partial list of the contents of a share or folder 
# for a few seconds. (On busy or large file shares when using OS X El Capitan or macOS Sierra, 
# items might disappear from Finder while the local cache rebuilds.)
# See the following for more details: https://support.apple.com/en-us/101918
#dir_cache_max_cnt=0
# Disable directory caching
#dir_cache_off=yes
# Turn off packet signing due to macOS bugs
#
# See the following articles for more detais:
# - https://support.apple.com/en-us/HT205926
# - https://support.apple.com/en-us/HT212277
# - https://kb.promise.com/thread/disable-smb-signing-on-os-x-10-11-5-10-12-x/
signing_required=no
# Disable session signing
#
# See the following for more details: https://support.apple.com/en-us/HT204021
validate_neg_off=yes
# Turn off notifications
#
# Applying this setting can break workflows that require SMB notifications 
# for folder listings to be current. 
#
# Disabling change notifications can also lead to data corruption and other 
# issues where multiple users are accessing the same files and directories.
#notify_off=yes
# Use NTFS streams if supported. It is not necessary to force macOS to use 
# alternate data streams as it has been the default since macOS version 10.5.
streams=yes
# macOS 11.3 added SMB3 multichannel support and it is recommended to force macOS 
# to prefer wired connections as some Wi-Fi networks may advertise faster speeds 
# than the connected wired network.
#
# See the following for more details:
# - https://support.apple.com/en-us/102010
# - https://support.apple.com/en-us/HT212277
mc_on=on
mc_prefer_wired=yes
Reply

Feb 8, 2025 6:43 AM in response to BlueberryLover

After some experimentation, I found that the following configuration works very well and eliminates the frustration of the Universal Control disconnects:


  1. Use macOS screen sharing (in place of Universal Control) on the primary computer (M2 Mac mini (2023)) to access the desktop of the secondary computer (Mac mini (2018)) Set the screen sharing window to full screen.
  2. Switch the display to the secondary computer. In my case, the monitor has multiple video inputs. I use the HDMI input for the primary computer and DisplayPort input for the secondary computer. I use the monitor's OSD (on screen display) to switch between the two inputs.


Notes:

  1. The primary computer must always have the screen sharing window active in full screen.
  2. The mouse and keyboard are connected over Bluetooth to the primary computer. They function in a similar manner to Universal Control but with no disconnects. I did see one case, however, where the mouse pointer lagged for a brief moment.
  3. The image quality is maximized because the monitor is directly connected to the secondary computer.
  4. Using a ThunderBolt Bridge (point to point) connection between the primary and secondary computers increases throughput and reduces latency for the mouse movement and keyboard entry. I suggest setting the ThunderBolt Bridge as the top entry in the (network) Service Order list:


Hope this helps.


- Pie Lover

Reply

Feb 8, 2025 6:45 AM in response to BlueberryLover

After some experimentation, I found that the following configuration works very well and eliminates the frustration of the Universal Control disconnects:


  1. Use macOS screen sharing (in place of Universal Control) on the primary computer (M2 Mac mini (2023)) to access the desktop of the secondary computer (Mac mini (2018)) Set the screen sharing window to full screen.
  2. Switch the display to the secondary computer. In my case, the monitor has multiple video inputs. I use the HDMI input for the primary computer and DisplayPort input for the secondary computer. I use the monitor's OSD (on screen display) to switch between the two inputs.


Notes:

  1. The primary computer must always have the screen sharing window active in full screen.
  2. The mouse and keyboard are connected over Bluetooth to the primary computer. They function in a similar manner to Universal Control but with no disconnects. I did see one case, however, where the mouse pointer lagged for a brief moment.
  3. The image quality is maximized because the monitor is directly connected to the secondary computer.
  4. Using a ThunderBolt Bridge (point to point) connection between the primary and secondary computers increases throughput and reduces latency for the mouse movement and keyboard entry. I suggest setting the ThunderBolt Bridge as the top entry in the (network) Service Order list (on both computers):


Hope this helps.


- Pie Lover

Reply

Feb 10, 2025 12:06 PM in response to BlueberryLover

Tips for optimizing SMB transfer rates:


Adjust SMB browsing behavior in macOS


Turn off packet signing for SMB 2 and SMB 3 connections


Other SMB parameters:


#!/bin/bash

# Commands that decrease security

# Check if the nsmb.conf file exists and remove it if it does
if [ -f /private/etc/nsmb.conf ]; then
    rm /private/etc/nsmb.conf
fi

# Create a new nsmb.conf file with default section
echo "[default]" >> /etc/nsmb.conf

# Disable SMB signing (decreases security)
echo "signing_required=no" >> /etc/nsmb.conf

# Disable negotiation validation (decreases security)
echo "validate_neg_off=yes" >> /etc/nsmb.conf

# End Section

# Commands with neutral or mixed impact on security

# Enable support for named streams (neutral)
echo "streams=yes" >> /etc/nsmb.conf

# Disable change notifications (neutral, but might affect operational efficiency)
echo "notify_off=yes" >> /etc/nsmb.conf

# Enable soft mounts (neutral, but could impact data availability)
echo "soft=yes" >> /etc/nsmb.conf

# Disable directory caching (neutral, but impacts performance)
echo "dir_cache_max_cnt=0" >> /etc/nsmb.conf
echo "dir_cache_max=0" >> /etc/nsmb.conf
echo "dir_cache_off=yes" >> /etc/nsmb.conf

# End Section

# Commands that improve or do not affect security significantly

# Disable NetBIOS and use direct hosting over TCP/IP (improves security)
echo "port445=no_netbios" >> /etc/nsmb.conf

# Set SMB protocol version to SMB 2 or later (improves security)
echo "protocol_vers_map=4" >> /etc/nsmb.conf

# Enable multi-channel support and prefer wired connections (neutral, typically safe)
echo "mc_on=yes" >> /etc/nsmb.conf
echo "mc_prefer_wired=yes" >> /etc/nsmb.conf

# End Section

# Exit script
exit
Reply

Feb 4, 2025 7:21 AM in response to BlueberryLover

I am still experiencing the occasional Universal Control disconnect. When this happens, the cursor on the secondary Mac freezes and the keyboard stops working. Assuming that the Automatic reconnect option is enabled, I simply move my mouse in the direction of the primary Mac monitor and then back to the secondary monitor. Universal Control then reconnects which I follow by clicking on the desktop of the secondary Mac.


This is workable as long as the disconnects are not too frequent.


- Pie Lover

Reply

Feb 8, 2025 4:44 AM in response to BlueberryLover

I eventually gave up on using Universal Control as the number of disconnects made using it a frustrating experience. As an alternative, I'm using the macOS Screen Sharing feature. This works well when both Macs are connected to a common router using wired GigE connections.


I'm also experimenting using ThunderBolt Bridge rather than Ethernet. ThunderBolt Bridge provides higher throughput and lower latency which should improve the screen sharing user experience.


- Pie Lover

Reply

Feb 10, 2025 3:45 PM in response to BlueberryLover

See below for a minor correction to previous post. SMB protocol_vers_map=4 corresponds to SMB 3 (not SMB 2). This field is bit encoded as follows:

# Set SMB protocol version to SMB 3 or later (improves security)
# Protocol version is specified using binary bitmap

# 1 => 0001 => SMB 1 only
# 2 => 0010 => SMB 2 only
# 3 => 0011 => SMB 1 or 2
# 4 => 0100 => SMB 3 only
# 6 => 0110 => SMB 2 or 3

echo "protocol_vers_map=4" >> /etc/nsmb.conf
Reply

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Workaround for Universal Control Disconnects?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.