如何从 Hyper V VM 连接到主机中运行的 SQL Server?

Lie*_*ero 5 sql-server networking hyper-v

在我的电脑(主机)上我有:

  1. 安装的 SQL Server
  2. 启用 Hyper V,创建一个连接到“默认交换机”(内部)的新虚拟机。
  3. 验证 sql server 正在运行telnet localhost 1433并且telnet 172.17.169.1 1433(Hyper V 创建的网络中的主机 IP),请参阅 ip config 输出
  4. 在 SQL Server 网络配置中启用 TCP/IP:
  5. 我添加了入站防火墙规则:允许端口 1433

在此输入图像描述

但是,我无法使用telnet 172.17.169.1 1433.

CMD 输出(主机):

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
Run Code Online (Sandbox Code Playgroud)

命令输出(VM):

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
Run Code Online (Sandbox Code Playgroud)