如何通过 Windows 10 远程管理 Hyper-V 2016 独立版?

如何通过 Windows 10 远程管理 Hyper-V 2016 独立版?

如何通过 Windows 10 笔记本电脑连接到 Hyper-V 2016 独立版?

背景:我把这里布置成一个家庭实验室。我关注 A 很少 指南,但我还没有找到一个指南/ Youtube教程,似乎适用于免费版的Hyper-V 2016。这是Hyper-V独立的“hello world”,我找不到适用于2016年的指南。(Hyper-V 2012 + Windows 8似乎有一些自动化脚本解决了该问题,但对于 Hyper-V 2016 却无效。

语境

  • 服务器:Hyper-V 服务器 2016(免费、独立),fqdn:服务器.本地,
  • 客户端:Windows 10 专业版
  • 补充笔记
    • 客户端的 etc/hosts 文件包含服务器 fqdn 的条目
    • 客户端和服务器均不在工作组或域中
  • 我的目标:使用客户端的 Hyper-V 管理器远程管理服务器

错误

An error occurred while attempting to connect to server "server.local". Check that the 
Virtual Machine Management service is running and that you are authorized to
connect to the server. 

Hyper-V encountered an error trying to access an object on computer 'server.local' because 
the object was not found. The object might have been deleted. Verify that the Virtual 
Machine Management service on the computer is running.

我在服务器上做了什么

# sconfig.cmd: Enable "Configure Remote Management"
# sconfig.cmd: Add Local Administrator
# sconfig.cmd: Enabled Remote Desktop
Enable-PSRemoting
Enable-WSManCredSSP -Role server
sc start vmms                                  # Is this the "missing object"?
netsh advfirewall set currentprofile state off # Let's try disabling firewall

我在客户端做了什么

Set-Item WSMan:\localhost\Client\TrustedHosts -Value "server.local"
Enable-WSManCredSSP -Role client -DelegateComputer "server.local"
# Changed group policy: "Computer Configuration > Administrative Templates > System > Credentials Delegation > Allow delegating fresh credentials with NTLM-only server authentication" by doing: "Click Enable and add wsman/fqdn-of-hyper-v-host."
# Disabled firewall
# dcomcnfg > COM SECURITY > Access Permissions > Edit Limits > Anonymous Login > ALLOW Remote Access
cmdkey /add:YOURSERVERNAME /user:USERNAMEONTHESERVER /pass:THEPASSWORDOFTHATUSER

我如何触发错误

在客户端上:

  1. 启动“连接服务器”
    1. 尝试一:“将‘另一台计算机:’设置为‘192.168.10.2’”
    2. 第二次尝试:“将‘另一台计算机:’设置为‘server.local’”
  2. 点击“确定”
  3. (错误:“尝试连接到服务器‘server.local’时发生错误...)

答案1

找到我的具体问题:) 我使用了无效的主机名,并且 DNS 无法正确解析。

  • 错误:server-1.local
  • 右侧:服务器-1-本地

但另一方面,我还发现微软文档(使用 Hyper-V 管理器远程管理 Hyper-V 主机) 没有记录我使它正常工作所需的所有说明。它大部分都是正确的,但缺少一个步骤。所以我附上了我的手动设置说明。

请参阅下面通过 Windows 10 Professional 远程管理 Hyper-V 2016 的完整设置说明。我的设置涉及两台独立的物理机器 - 我从头开始安装两个系统。

在 Hyper-V 服务器上

  1. 安装Hyper-V 服务器 2016(通过 GUI)
  2. 设置密码注意:在终端 GUI 运行中更改以下内容sconfig
  3. 设置计算机名称(例如 server-1);注意:不要使用句点
  4. 配置远程管理(禁用 => 启用)
  5. 远程桌面(禁用 => 启用)
  6. 在 Powershell 窗口中,以管理员身份运行:

Powershell 命令:

Enable-PSRemoting
Enable-WSManCredSSP -Role server

在台式机/笔记本电脑上,你将远程管理 Hyper-V

  1. 安装 Windows 10 专业版/您的驱动程序/您的应用程序(GUI)
  2. 更改网络适配器设置
    • 如果使用的是 Windows 10 的旧补丁
      • 单击“开始”>“搜索“家庭组”>“启动”家庭组”
      • 点击链接更改网络类型(公共 => 私人)
    • 如果使用的是 Windows 10 的较新补丁
      • 尝试以下操作:转到“开始菜单 >(输入)‘以太网’ >(单击)以太网适配器 >(单击)私人”
  3. 在您的主机文件中添加 DNS 条目(以管理员身份运行记事本)
    • 编辑“C:\Windows\System32\drivers\etc\hosts”
    • 添加类似“192.168.100.2 server-1”的条目
  4. 在 Powershell 窗口中,以管理员身份运行:

Powershell 命令:

Enable-PSRemoting
Set-Item WSMan:\localhost\Client\TrustedHosts -Value server-1
Enable-WSManCredSSP -Role client -DelegateComputer server-1
Enable-WindowsOptionalFeature -Online -FeatureName:Microsoft-Hyper-V -All
cmdkey /add:server-1 /user:Administrator /pass

笔记

微软官方文档缺少命令键指令,用于注册进入 Hyper-V 服务器所需的登录信息。我在另一篇文档中找到了它。

相关内容