Bug 58920 - Unable to connect to Mac server with address='MacDev' and user=xxxx.
Summary: Unable to connect to Mac server with address='MacDev' and user=xxxx.
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: XMA ()
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2017-08-21 09:49 UTC by Paul Sinnema
Modified: 2017-10-03 15:19 UTC (History)
12 users (show)

Is this bug a regression?: ---
Last known good build:

Image showing the connection error. (92.86 KB, image/png)
2017-08-21 09:49 UTC, Paul Sinnema
Xamarin Logs (3.23 KB, application/x-zip-compressed)
2017-08-22 20:07 UTC, Gilles Dignard
Logs and environment descriptions (6.60 KB, application/x-zip-compressed)
2017-08-24 02:12 UTC, Gilles Dignard

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Paul Sinnema 2017-08-21 09:49:21 UTC
Created attachment 24324 [details]
Image showing the connection error.

I often get the error that the connection with the Mac server is lost. It happens most of the time after a longer period of inactivity. The only way to reestablish the connection is by closing VS2017 and start it again.

Version information:

Microsoft Visual Studio Professional 2017 
Version 15.3.1
Microsoft .NET Framework
Version 4.7.02046

Xamarin (306f76a)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android SDK (0cd0214)
Xamarin.Android Reference Assemblies and MSBuild support.

Xamarin.iOS and Xamarin.Mac SDK (bf350ba)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.
Comment 1 John Miller [MSFT] 2017-08-21 14:26:57 UTC

After this disconnection happens, please upload and attach the logs from the Help -> Xamarin -> Zip Xamarin Logs. That might contain more information about what happened. 

Also, during this inactivity, is your computer locked? i.e. The same as pressing Windows Key + L.
Comment 2 Gilles Dignard 2017-08-22 20:07:34 UTC
Created attachment 24354 [details]
Xamarin Logs
Comment 3 Gilles Dignard 2017-08-22 20:09:22 UTC
This is happening to me as well. Interestingly, it looks connected. This is immediately following a VS reboot. For me, to get this working I seem to need to reboot the Mac.

Also, I do see the connected target iPad in the Devices list, etc.

Output > Xamarin
Starting connection to Mac iMac...
Starting Broker in port 54771...
Connection successfully established with the Mac iMac:54771
Starting agents on Mac iMac (
Starting Agent IDB
Starting Agent Build
Agent Build is running
Agent IDB is running
Connected to the Mac iMac ( with Full support.

Error List
Severity	Code	Description	Project	File	Line	Suppression State
Error		The Xamarin Build Agent is not running on the Mac. An active Build Agent is required to perform the build	PTR-App-iOS-FilterExplorer
Comment 4 Gilles Dignard 2017-08-22 20:31:38 UTC
Oh, boy.

An update appeared on the Mac side for Android (from .19), iOS (from .18), and Mac (from .17) and after a reboot of both the Mac and the Windows machine, I now get this error immediately and so can no longer build at all.
Comment 5 Gilles Dignard 2017-08-24 02:11:10 UTC
Have done a full re-install of VS on both Mac and Win machines and it's still happening

I've attached info about the environments as well as Ide logs from both machines.

From the Mac side IDE log, this appears:

ERROR [2017-08-23 21:12:22Z]: An unhandled exception has occured. Terminating Visual Studio? False
System.Net.Sockets.SocketException (0x80004005): Success
  at Microsoft.ServiceHub.Utility.SocketClient+<ConnectAsync>d__0.MoveNext () [0x00231] in <77315aa4fd5d49b8add7ad003b8a13a2>:0 

While on the Windows side, this appears

Xamarin.VisualStudio.Remote.State.DisconnectedState|Error|0|An unexpected error occurred while configuring SSH for the user gdignard
Xamarin.Messaging.Exceptions.MessagingException: An unexpected error occurred while configuring SSH for the user gdignard ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

With the former likely explaining the latter.
Comment 6 Gilles Dignard 2017-08-24 02:12:06 UTC
Created attachment 24388 [details]
Logs and environment descriptions
Comment 7 Prashant [MSFT] 2017-08-29 09:28:41 UTC
Paul & Gilles,

While I investigate this issue could you try reading through the troubleshooting docs https://developer.xamarin.com/guides/ios/getting_started/installation/windows/connecting-to-mac/troubleshooting/
Comment 8 Gilles Dignard 2017-08-31 14:31:52 UTC
Yes; passes all these tests/recommendations. Short form: I can ssh into the mac using the same credentials and successfully "do stuff". That mac also has a drive mounted from the Windows machine with the VS running on it.
Comment 9 Yuri 2017-08-31 21:09:57 UTC
I have the same problem. Any updates?
Comment 10 Yuri 2017-08-31 21:30:13 UTC
when that happens I can disconnect from MAC Agent but when I press Connect nothing happens, I don't see in the status bar that VS is starting an agent. I need to exit VS and start it again. Then everything works again
Comment 11 mag@xamarin.com 2017-10-02 19:46:38 UTC

VS for Mac logs are not required because to develop iOS apps from Windows, we don't require VS for Mac IDE at all. Just VS logs on Windows are fine.

Related to the attached logs and that particular case, I see that the SSH server couldn't be reached successfully. The error is the typical error message that applies when the SSH daemon is not active on the Mac (which means Remote Login is not enabled). It could also means a network error between Windows and the Mac. See the error:

"Xamarin.Messaging.Exceptions.MessagingException: An unexpected error occurred while configuring SSH for the user gdignard ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
   at Renci.SshNet.Abstractions.SocketAbstraction.Connect(IPEndPoint remoteEndpoint, TimeSpan connectTimeout)"

However, the comment above mentions that all the recommendations has been applied and that an SSH connection using another client than Xamarin can be established.

In general, we have been working on several fixes around unexpected disconnections and the recovery process to reconnect or fail with the correct feedback. 

We also introduced important improvements around the connection process, including useful visual feedback on the Xamarin Mac Agent dialog about the current executing step, the status, the required actions if any, warning, errors, etc.

The mentioned changes will be available from the next 15.5 release.

For the mentioned reasons, I mark this bug as Resolved. If any connection issue is experienced after the 15.5 version, please feel free to re open this bug or report another one (if applies better), to analyze the particular problem.
Comment 12 Yuri 2017-10-02 19:58:58 UTC
15.5 of what? I am starting to get lost in all those versions. Is stable version out with those fixes?
Comment 13 Pierce Boggan [MSFT] 2017-10-03 15:19:30 UTC
Hey Yuri, 

Apologies, I agree the versions are super confusing! In "stable" right now for Visual Studio on Windows, we have 15.3.5. If you download the "preview" (more on this here: https://blog.xamarin.com/3-reasons-to-try-visual-studio-2017-version-15-4-previews/), we are currently on 15.4 Preview 4.

Once 15.4 is promoted to stable, then the 15.5 release mentioned here will be promoted to preview, and the fix above should be available via the Visual Studio preview builds. After this preview undergoes sufficient testing, it will be promoted to stable.

Hope this helps to clear things up. :)