关于服务器:Windows-Server-2019-安装提要-及-VS-2019-Build-Tool

4次阅读

共计 5668 个字符,预计需要花费 15 分钟才能阅读完成。

FROM: Original

The Essentials: After Windows Server 2019 Evaluation Installed

试用评估版本

Windows Server 2019 容许试用 180 天,试用到期后还能够重置 5 次以缩短评估期,所以这是比拟难得的根底工具了。

Windows Server 试用 官网:这里

缩短试用期

缩短试用期的命令为:

slmgr.vbs -rearm

Windows Server 2019 Evaluation Keys:

曾经晓得的用于评估的 Product Key 如下:

Windows Server 2019 Standard

N69G4-B89J2-4G8F4-WWYCC-J464C

Windows Server 2019 Datacenter

WMDGN-G9PQG-XVVXX-R3X43-63DFG

版本比拟:Core 与 Desktop Experience

Windows Server 2019 有多种版本:

首先是大版本的划分:

  • Data Center,
  • Standard,
  • Essentials,(只有 Desktop Experience 小版本)

在大版本之外,还有一种 Hyper-V Server 2019 的大版本,只蕴含 Server Core 小版本),不多提了。

而后是小版本被分为 Server Core 和 With Desktop Exxpirience 两种,其区别在于有没有 GUI 环境。

Server Core

对于 Server Core 来说,只有一个命令行盒子的界面:

然而,所谓的 no GUI 只是在说没有 GUI 管理工具(例如开始菜单,各种控制面板元素等等),实际上它还是容许你从命令行界面启动 Desktop app 的。例如 Visual Studio 2019 Build Tool 就会被启动和运行在一个独立的窗口界面中:

稍后就会有装置治理界面进去。

在 Server Core 中,至多这些应用程序是不兼容的:

  • Microsoft Server Virtual Machine Manager 2019 (SCVMM)
  • System Center Data Protection Manager 2019
  • Sharepoint Server 2019
  • Project Server 2019

此外,零碎组件中至多这些是不兼容的:Windows Tiff IFilter, Internet Printing Client, RAS Connection Manager Kit, Simple TCP/IP Services, TFTP Client, Windows Search Service, XPS Viewer, 等等.

能够见到不兼容的货色简直和普通人无关。

除此之外,基本上你能够认为 Core 就是更轻量级一点的版本,它的装置后尺寸大概在 5.1GB 高低,算是比拟难得的了。

Desktop Experience

而 Desktop Experience 小版本则有残缺的 GUI 界面,你能够像操作 Windows 11 或者 Windows NT 那样通过开始菜单进行 GUI 操作,当然也能够关上命令行提示符做工作。

这里有该界面的参考图样:

Windows Server 2019 with Desktop Experience — The Classic Look (e.g. Windows 10 1809)

装置过程中的截图有这些:

小结

所以官网的称说,在 Windows Server 2019 ISO 的装置界面中可能看到,通常是这样:

  1. Windows Server 2019 Standard (Desktop Experience)
  2. Windows Server 2019 Standard

所以其中 2 即为 Server Core 版本。

磁盘尺寸占用

Server Core 是更轻量级一点的版本,它的装置后尺寸大概在 5.1GB 高低。

作为参考,一个一般的 Windows 20H2 装置后大概占用 20GB 左右,而一个 Windows Server 2019 Standard (Desktop Expirience) 的装置后尺寸大概为 8.6~9.3GB。

版本比拟

官网提供的比拟表格在这里:

Comparison of Standard and Datacenter editions Windows Server 2019 – Microsoft Docs

如果嫌它太长,那就先看这里:

Windows Server 2019 Licensing & Pricing – Microsoft

装置后提要

查看服务器 IP 地址

能够应用 ipconfig 或者 ipconfig /all

Enable Remote Desktop on Server Core

在 Server Core 上启用远程桌面

Following are the steps to enable remote desktop on Windows Server core.

依照上面的步骤来启用远程桌面,实用于 Windows Server Core。

Start the Server Configuration Tool, login to your Windows Server (2016/2019) core. Type SConfig and press Enter.

登录到你的 Windows Server 2016 或者 2019 core 并运行服务器配置工具:输出 sconfig 并回车。

You will find a list of options under Server Configuration. From the list, take a look at option 7 which is for Remote Desktop. Notice that Remote Desktop is currently Disabled

你将会看到 sconfig 命令显示了一个选项表。在这个选项表中抉择第 7 项,即远程桌面 条目。默认时这一项应该是“Disabled”的状态。

Press 7 and hit enter. The next line that you see lets you Enable or Disable remote desktop. To enable the remote desktop, type E and press enter key.

按下按键 7 并 回车 (Enter)。接下来显示行提醒你能够启用或者禁用远程桌面。要启用它,按下按键 E 并回车。

Now you see two options :- 当初你会看到两个子选项

  • Allow only clients running Remote Desktop with Network Level Authentication (more secure) 只有启用了加强的网络认证平安的 RDP 客户端能力连贯进入(更平安)
  • Allow clients running any version of Remote Desktop (less secure) 任何 RDP 客户端都能够连贯进入(安全性较低)

Type 1 and press Enter. You get a confirmation box for enabling Remote Desktop. Click OK.

按下按键 1 并回车,你会看到一个确认对话框,点击 OK 按钮确认它:

Now take a look at option 7, it shows Remote Desktop Enabled (more secure clients only).

当初再来看选项 7,它会显示远程桌面曾经启用了(Enabled all clients)。

In the next step we will enable the firewall to allow the remote desktop. Type 15 which is an exit to command line.

接下来咱们须要在防火墙上容许远程桌面的连贯进入。按下按键 15 并回车,即抉择第 15 选项以便退出 sconfig 的菜单界面,返回到命令行。

Now type the below command and press enter key.

当初输出上面的命令并回车运行它:

netsh advfirewall firewall set rule group="remote desktop" new enable=Yes

You get a line that reads Updated 3 rules.

它会容许远程桌面连贯通过。

Original: Enable Remote Desktop On Server Core – Prajwal Desai

批改服务器的主机名

同样应用 sconfig 命令,第 2 项为批改主机名称(Computer Name)。

减少操作员账户

如果不想实用 Administrator 身份登陆,你须要减少本人的操作员账户。还是应用 sconfig 命令,并抉择第 3 项(Add Local Administrator)。

使能文件共享

上面的命令能够启用文件共享:

netsh advfirewall firewall set rule group=”File and Printer Sharing”new enable=Yes

而后你能够通过管理者共享点的形式连贯到 Server Core:

# in macOS
open 'smb://server-core/admin$'
open 'smb://server-core/c$'

NET USE 命令

Net use | Microsoft Docs)

简略形式

典型的载入 LAN 中的 Samba 资源形式为:

net use z: \\hz-pc\downloads password /user:hz

用完之后能够删除它:

net use z: /delete

/savecred 形式

你能够应用 /savecred 来创立盘符,这样今后就无需显式输出 password 和 user 局部了。

net use z: \\hz-pc\downloads /savecred /persistent:yes

一个示例如下:

命令行格局

NET USE 命令的规范模式有这几种:

net use [{<DeviceName> | *}] \
   [\\<ComputerName>\<ShareName>[\<volume>]] \
   [{<Password> | *}]] \
   [/user:[<DomainName>\]<UserName] >[/user:[<DottedDomainName>\]<UserName>] \
   [/user: [<UserName@DottedDomainName>] \
   [/savecred] [/smartcard] \
   [{/delete | /persistent:{yes | no}}]
net use [<DeviceName> [/home[{<Password> | *}] \
   [/delete:{yes | no}]]
net use [/persistent:{yes | no}]

因为咱们隐含着上下文为近程连贯到一台 windows server 或者 windows server core 服务器,所以 NET USE 命令的长久化模式通常没有意义。在这种上下文中须要用到 NET USE 时个别是因为咱们在 LAN 中的下载服务器上事后下载了安装盘,所以须要链接到该下载服务器,而后去装置 Visual Studio 2019 Build Tool 等等。

Remote Desktop

RDP 形式

在 macOS 上能够应用收费的 RDP Client 工具:

CoRD: Remote Desktop for Mac OS X 或者

Remote Desktop Manager Free

留神 Remote Desktop Manager Free 须要你注销一个账号能力收费应用,或者也能够罗唆买一份它的 Enterprise License

如果你在评估或者正在治理 Azure 服务器,那么能够应用 Azure 治理界面中内嵌的远程管理工具。

VNC 形式

如果你正在应用 Windows 11 等 Home Edition 版本(例如笔记本预置 OEM),那么这些工作站上的远程桌面服务是不能激活的,很可耻——所以这时候你须要 VNC 工具:

TightVNC: VNC-Compatible Free Remote Control / Remote Desktop Software

SSH 形式

还能够应用 OpenSSH 工具,通过 ssh 形式近程连贯到服务器:

装置 OpenSSH | Microsoft Docs

其余

从 Windows 工作站发动远程管理会话时,也能够应用 Windows Admin Center 这个工具,这是 Microsoft 官网出的专用工具。

装置 Visual Studio 2019 Build Tool

官网:下载 Windows 版和 Mac 版 Visual Studio 2019

能够把 Visual Studio 2019 Build Tool 简略地看作是 Visual Studio 的无 GUI 版本就能够了。

建设离线安装包

参考:

  • 将 Visual Studio 生成工具装置到容器 | Microsoft Docs
  • 创立脱机装置 – Visual Studio (Windows) | Microsoft Docs

首先在官网下载 vs_setup 执行文件,而后应用这样的命令行就可能创立离线包了:

vs_buildtools__2036376674.1537335944.exe --layout .\vs2019bt_offline  --lang en-US

留神查看你下载失去的 vs_setup 执行文件名字,并用它去替换 vs_buildtools__2036376674.1537335944.exe 局部。

装置

下载离线包 OK 之后,在 Server Core 上能够通过 Samba 文件共享形式连贯到离线包的服务器:

net use z: \\hz-pc\d

而后转入子目录中发动装置过程:

cd /d z:\downloads\vs.2019.build.tool\vs2019bt_offline
vs_setup.exe

而后在拆散的装置窗口中进行勾选并实现装置即可。

磁盘尺寸

装置了 C++(带有 ATL 和 MFC)以及 .NET 构建工具的 BT 大概须要 17GB 的磁盘空间。所以咱们在一台 Server Core 上装置了 VS2019BT 工具之后,整个磁盘空间大概是 22.2GB,十分无语。

这是一个微小的耗费,在各方面意义上。

所以我对于 GitHub Actions 中的 Windows C++ 构建服务器还是很钦佩的,每次推送随同着一次构建服务器的下载,启动,调度构建 CI 命令,直到销毁,这些流程

🔚

临时写这么多。

正文完
 0