You need to enable JavaScript to run this app. Hyper-V虚拟机如何连接运行在Windows主机上的SQL Server
优惠活动
大模型
产品
解决方案
定价
更多

Hyper-V虚拟机如何连接运行在Windows主机上的SQL Server

Hyper-V环境下虚拟机连接宿主SQL Server异常问题

问题概述

在使用Hyper-V的过程中,需要从已创建的虚拟机中访问运行在本地物理主机上的SQL Server,完成常规配置后仍出现连接失败,具体配置与实测情况如下。

已完成配置

  • 物理宿主PC已完成SQL Server安装
  • 已启用Hyper-V功能,新建虚拟机的网络连接配置为绑定Default Switch(内部虚拟交换机)
  • 已验证SQL Server运行状态正常:在主机上执行telnet localhost 1433、telnet 172.17.169.1 1433均可正常连通,其中172.17.169.1是Hyper-V虚拟网络为宿主分配的地址
  • 已在SQL Server网络配置中启用TCP/IP协议
  • 已在主机防火墙中添加入站规则,允许1433端口的入站通信
  • 已留存SQL Server网络配置界面的操作截图,佐证TCP/IP协议配置已生效

实测异常表现

在虚拟机中执行telnet 172.17.169.1 1433命令时,始终无法建立正常连接。

网络配置输出记录

物理主机命令行输出

C:\>ipconfig

Windows IP Configuration

...

Ethernet adapter vEthernet (Default Switch):

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::34f0:43ed:3e9b:8f6a%27
   IPv4 Address. . . . . . . . . . . : 172.17.169.1
   Subnet Mask . . . . . . . . . . . : 255.255.255.240
   Default Gateway . . . . . . . . . :

C:\>telnet 172.17.169.1 1433
.... OK

虚拟机命令行输出

C:\Users\User>ipconfig

Windows IP Configuration


Ethernet adapter Ethernet 2:

   Connection-specific DNS Suffix  . : mshome.net
   Link-local IPv6 Address . . . . . : fe80::99d0:eff8:c623:f82d%12
   IPv4 Address. . . . . . . . . . . : 172.17.169.4
   Subnet Mask . . . . . . . . . . . : 255.255.255.240
   Default Gateway . . . . . . . . . : 172.17.169.1

C:\Users\User>telnet 172.17.169.1 1433
Connecting To 172.17.169.1...Could not open connection to the host, on port 1433: Connect failed

内容的提问来源于stack exchange,提问作者Liero

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.11.22 02:06:03