1

I'm trying to pair Visual Studio 2022 (Windows) with a Mac for building a .NET MAUI or Xamarin.iOS project. I have full terminal access on the Mac, and I've already enabled Remote Login (SSH) on it. I can successfully connect from Windows terminal using:

ssh [email protected].###.###

What I've done:

  • Generated SSH keys on Windows via: ssh-keygen -t rsa -b 4096.
  • Copied the public key (id_rsa.pub) into ~/.ssh/authorized_keys on the Mac using nano.
  • Set permissions:
    • chmod 700 ~/.ssh
    • chmod 600 ~/.ssh/authorized_keys
  • Verified the key is in place and correctly formatted.
  • Ran ssh -v [email protected].###.### — it authenticates with the key, no password needed.

The problem is that Visual Studio still fails to pair with the Mac.

It shows: Error: An error occurred while generating the SSH keys. Please check that the environment is properly configured. Sometimes, it fails silently with no pairing success after "Add Mac."

1 Answer 1

0

Problem: Visual Studio 2022 fails to pair with Mac running macOS Ventura/Sonoma/Sequoia with error "An error occurred while generating the SSH keys" even though manual SSH connection works.

Root Cause

Modern macOS versions use OpenSSH 9.0+ which disabled RSA SHA-1 signatures by default, breaking Visual Studio's SSH key generation.

Solution: Manual SSH Key Generation

On Mac:

  1. Enable Remote Login: System Settings → General → Sharing → Remote Login (ON)

  2. Generate compatible SSH keys:

ssh-keygen -t ecdsa -b 521 -f ./id_ecdsa -q
# Enter a passphrase when prompted (required!)

On Windows:

rmdir /s /q "%LOCALAPPDATA%\Xamarin\MonoTouch"
# Create .ssh folder if it doesn't exist
if not exist "C:\Users\%USERNAME%\.ssh" mkdir "C:\Users\%USERNAME%\.ssh"
# Copy both id_ecdsa and id_ecdsa.pub from Mac to this folder

Restart Visual Studio and try pairing. VS will prompt for Mac credentials and SSH passphrase.

If you get dotnet runtime error after SSH connects:

# On Mac, install .NET SDK
brew install --cask dotnet

The manual ECDSA key generation bypasses Visual Studio's broken RSA key generation and works with modern macOS SSH servers.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.