Nano Server速记

入门参考https://docs.microsoft.com/zh-cn/windows-server/get-started/nano-server-quick-start

1、创建VHD

Import-module .\NanoServerImageGenerator.psm1 -Verbose

New-NanoServerImage -Edition Standard -DeploymentType Guest -MediaPath j:\ -BasePath d:\vm\nano -TargetPath d:\vm\nano\nano.vhd -ComputerName Nano -Package Microsoft-NanoServer-IIS-Package –EnableRemoteManagementPort

 

2、使用VHD创建虚拟机

3、远程管理

A、连接

Set-Item WSMan:\localhost\Client\TrustedHosts "10.168.1.125"

Enter-PSSession -ComputerName "10.168.1.125" -Credential "administrator"

 

B、共享文件夹

参考https://www.cnblogs.com/dotNETCoreSG/p/aspnetcore-2_5-nano_server_on_core.html

 

mkdir c:\temp

(启用文件共享没什么效果)netsh advfirewall firewall set rule group="File and Printer Sharing" new enable=yes

net share ShareTemp=c:\temp /GRANT:EVERYONE`,FULL

 

C、开端口

参考http://www.pstips.net/manage-firewall-using-powershell.html

 

New-NetFirewallRule -Name "MyService" -DisplayName "我的服务" -Protocol TCP -LocalPort 80,8080,3413-3420 -Action Allow -Enabled True

 

 

 

IIS

参考 https://www.cnblogs.com/dotNETCoreSG/p/aspnetcore-2_5-nano_server_on_core.html

 

猜你喜欢

转载自www.cnblogs.com/QinQouShui/p/9426050.html
今日推荐