Skip to content

Add Hyper-V socket support to sshd#794

Open
aurel26 wants to merge 3 commits intoPowerShell:latestw_allfrom
aurel26:sshd_hv_support
Open

Add Hyper-V socket support to sshd#794
aurel26 wants to merge 3 commits intoPowerShell:latestw_allfrom
aurel26:sshd_hv_support

Conversation

@aurel26
Copy link
Copy Markdown

@aurel26 aurel26 commented Jul 11, 2025

PR Summary

Add Hyper-V socket support to sshd (AF_HYPERV).

PR Context

This PR allows to bind the SSH server on a Hyper-V socket, which can then be accessed via hvc ssh <VM NAME>.

This is useful for connecting via SSH (e.g. for VS Code between the host and a VM) without having an IP connection.

This is PR fixes half of PowerShell/Win32-OpenSSH#2200

To be enabled, the socket must be explicitly declared in sshd_config (ListenAddress 00000000-0000-0000-0000-000000000000).

@aurel26
Copy link
Copy Markdown
Author

aurel26 commented Jul 11, 2025

@microsoft-github-policy-service agree

@fw2568
Copy link
Copy Markdown

fw2568 commented Aug 25, 2025

as this is still pending - we added a workaround here: https://github.com/eryph-org/guest-services

@hytecia9
Copy link
Copy Markdown

Thank you for your excellent work. I was looking for this exact patch.
However, I would like to report that building with v10.0.0.0 required upgrading _WIN32_WINNT in sshd-auth.
hytecia9@917001f

For Hyper-V enthusiasts, I've included a pre-built binary of v10.0.0.0 that supports Hyper-V sockets for x64, along with a simple usage guide.
https://github.com/hytecia9/openssh-portable-hyperv/releases/tag/v10.0.0.0-hyperv

If you don't trust the pre-built binaries, you can try building them yourself using the following instructions.
https://github.com/PowerShell/Win32-OpenSSH/wiki/Building-OpenSSH-for-Windows-(using-LibreSSL-crypto)

@gpotter2
Copy link
Copy Markdown

Hi @tgauth and very sorry for bothering. This PR brings cool improvements, I was wondering if you needed any help to make it go forward.

Something like adding unit testing, or maybe similar.

I understand it's a lot of work to keep the fork up-to-date with upstream, thanks a lot for your work !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants