針對 Nano 伺服器進行疑難排解Troubleshooting Nano Server

適用於︰Windows Server 2016Applies To: Windows Server 2016

重要

從 Windows Server 版本 1709 開始,Nano Server 僅以容器基礎 OS 映像的形式來提供。Starting in Windows Server, version 1709, Nano Server will be available only as a container base OS image. 請查看 Nano Server 的變更以了解這代表的意義。Check out Changes to Nano Server to learn what this means.

本主題所包含的相關資訊是有關可用來連線至、診斷和修復 Nano 伺服器安裝的工具。This topic includes information about tools you can use to connect to, diagnose, and repair Nano Server installations.

使用 Nano 伺服器修復主控台Using the Nano Server Recovery Console

Nano 伺服器包含修復主控台,確保即使錯誤網路組態干擾與 Nano 伺服器的連線,您還是可以存取 Nano 伺服器。Nano Server includes a Recovery Console that ensures you can access your Nano Server even if a network mis-configuration interferes with connecting to the Nano Server. 您可以使用修復主控台修正網路,然後使用一般的遠端管理工具。You can use the Recovery Console to fix the network and then use your usual remote management tools.

當您在虛擬機器中或已連接監視器和鍵盤的實體電腦上啟動 Nano 伺服器時,會看到全螢幕的文字模式登入提示。When you boot Nano Server in either a virtual machine or on a physical computer that has a monitor and keyboard attached, you'll see a full-screen, text-mode logon prompt. 使用系統管理員帳戶登入這個提示字元,以查看 Nano 伺服器的電腦名稱和 IP 位址。Log into this prompt with an administrator account to see the computer name and IP address of the Nano Server. 您可以使用下列命令,在這個主控台中進行瀏覽︰You can use these commands to navigate in this console:

  • 使用方向鍵捲動Use arrow keys to scroll

  • 使用 TAB 移至任何開頭為 > 的文字,然後按 ENTER 進行選取。Use TAB to move to any text that starts with >; then press ENTER to select.

  • 若要往回一個畫面或頁面,請按 ESC 鍵。To go back one screen or page, press ESC. 如果您在首頁,請按 ESC 鍵登出。If you're on the home page, pressing ESC will log you off.

  • 有些畫面會在畫面的最後一行顯示其他功能。Some screens have additional capabilities displayed on the last line of the screen. 例如,如果您瀏覽網路介面卡,F4 會停用網路介面卡。For example, if you explore a network adapter, F4 will disable the network adapter.

修復主控台可讓您檢視與設定網路介面卡和 TCP/IP 設定,以及防火牆規則。The Recovery Console allows you to view and configure network adapters and TCP/IP settings, as well as firewall rules.

注意

修復主控台只支援基本鍵盤功能。The Recovery Console only supports basic keyboard functions. 不支援鍵盤背光、10 個按鍵區段和鍵盤配置切換 (例如 Caps Lock 和 Number Lock)。Keyboard lights, 10-key sections, and keyboard layout switching such as caps lock and number lock are not supported. 只支援英文鍵盤和字元集。Only English keyboards and character set are supported.

使用緊急管理服務透過序列連接埠存取 Nano 伺服器Accessing Nano Server over a serial port with Emergency Management Services

緊急管理服務 (EMS) 可讓您執行基本疑難排解、取得網路狀態,以及使用終端機模擬器透過序列連接埠開啟主控台工作階段 (包括 CMD/PowerShell)。Emergency Management Services (EMS) lets you perform basic troubleshooting, get network status, and open console sessions (including CMD/PowerShell) by using a terminal emulator over a serial port. 這會取代使用鍵盤和監視器進行伺服器疑難排解的需求。This replaces the need for a keyboard and monitor to troubleshoot a server. 如需 EMS 的詳細資訊,請參閱 Emergency Management Services Technical Reference (緊急管理服務技術參照)。For more information about EMS, see Emergency Management Services Technical Reference.

若要在 Nano 伺服器映像上啟用 EMS,供您稍後需要使用時使用,請執行這個 Cmdlet︰To enable EMS on a Nano Server image so that it's ready should you need it later, run this cmdlet:

New-NanoServerImage -MediaPath \\Path\To\Media\en_us -BasePath .\Base -TargetPath .\EnablingEMS.vhdx -EnableEMS -EMSPort 3 -EMSBaudRate 9600

這個範例 Cmdlet 會使用 9600 bps 的傳輸速率在序列連接埠 3 上啟用 EMS。This example cmdlet enables EMS on serial port 3 with a baud rate of 9600 bps. 如果您不想包含這些參數,則預設值是連接埠 1 和 115200 bps。If you don't include those parameters, the defaults are port 1 and 115200 bps. 若要將這個 Cmdlet 用於 VHDX 媒體,請一定要包含 Hyper-V 功能,以及對應的 Windows PowerShell 模組。To use this cmdlet for VHDX media, be sure to include the Hyper-V feature and the corresponding Windows PowerShell modules.

核心偵錯Kernel debugging

您可以設定 Nano 伺服器映像,透過各種方法支援核心偵錯。You can configure the Nano Server image to support kernel debugging by a variety of methods. 若要搭配使用核心偵錯與 VHDX 映像,請一定要包含 Hyper-V 功能,以及對應的 Windows PowerShell 模組。To use kernel debugging with a VHDX image, be sure to include the Hyper-V feature and the corresponding Windows PowerShell modules. 如需遠端核心偵錯的基本詳細資訊,請參閱Setting Up Kernel-Mode Debugging over a Network Cable Manually (透過網路纜線手動設定核心模式偵錯) 和 Remote Debugging Using WinDbg (使用 WinDbg 的遠端偵錯)。For more information about remote kernel debugging generally see Setting Up Kernel-Mode Debugging over a Network Cable Manually and Remote Debugging Using WinDbg.

使用序列連接埠偵錯Debugging using a serial port

請使用這個 Cmdlet,透過序列連接埠針對映像進行偵錯︰Use this example cmdlet to enable the image to be debugged using a serial port:

New-NanoServerImage -MediaPath \\Path\To\Media\en_us -BasePath .\Base -TargetPath .\KernelDebuggingSerial -DebugMethod Serial -DebugCOMPort 1 -DebugBaudRate 9600

這個範例會使用 9600 bps 的傳輸速率在序列連接埠 2 上啟用偵錯。This example enables serial debugging over port 2 with a baud rate of 9600 bps. 如果您未指定這些參數,則預設值是連接埠 2 和 115200 bps。If you don't specify these parameters, the defaults are prot 2 and 115200 bps. 如果您想要同時使用 EMS 和核心偵錯,則必須將其設定成使用兩個不同的序列連接埠。If you intend to use both EMS and kernel debugging, you'll have to configure them to use two separate serial ports.

透過 TCP/IP 網路偵錯Debugging over a TCP/IP network

請使用這個 Cmdlet,透過 TCP/IP 網路針對映像進行偵錯︰Use this example cmdlet to enable the image to be debugged over a TCP/IP network:

New-NanoServerImage -MediaPath \\Path\To\Media\en_us -BasePath .\Base -TargetPath .\KernelDebuggingNetwork -DebugMethod Net -DebugRemoteIP 192.168.1.100 -DebugPort 64000

這個 Cmdlet 會啟用核心偵錯,只允許 IP 位址為 192.168.1.100 的電腦連線,而且所有通訊都是透過連接埠 64000 進行。This cmdlet enables kernel debugging such that only the computer with the IP address of 192.168.1.100 is allowed to connect, with all communications over port 64000. -DebugRemoteIP 和 -DebugPort 是必要參數,而且連接埠號碼大於 49152。The -DebugRemoteIP and -DebugPort parameters are mandatory, with a port number greater than 49152. 這個 Cmdlet 會在檔案和產生的 VHD 中產生加密金鑰,這個加密金鑰是透過連接埠進行通訊所需的項目。This cmdlet generates an encryption key in a file alongside the resulting VHD which is required for communication over the port. 或者,您可以使用 -DebugKey 參數指定自己的金鑰 (如這個範例所示)︰Alternately, you can specify your own key with the -DebugKey parameter, as in this example:

New-NanoServerImage -MediaPath \\Path\To\Media\en_us -BasePath .\Base -TargetPath .\KernelDebuggingNetwork -DebugMethod Net -DebugRemoteIP 192.168.1.100 -DebugPort 64000 -DebugKey 1.2.3.4

使用 IEEE1394 通訊協定偵錯 (Firewire)Debugging using the IEEE1394 protocol (Firewire)

若要透過 IEEE1394 啟用偵錯,請使用這個範例 Cmdlet︰To enable debugging over IEEE1394 use this example cmdlet:

New-NanoServerImage -MediaPath \\Path\To\Media\en_us -BasePath .\Base -TargetPath .\KernelDebuggingFireWire -DebugMethod 1394 -DebugChannel 3

-DebugChannel 是必要參數。The -DebugChannel parameter is mandatory.

使用 USB 偵錯Debugging using USB

您可以使用這個 Cmdlet,透過 USB 進行偵錯︰You can enable debugging over USB with this cmdlet:

New-NanoServerImage -MediaPath \\Path\To\Media\en_us -BasePath .\Base -TargetPath .\KernelDebuggingUSB -DebugMethod USB -DebugTargetName KernelDebuggingUSBNano

當您將遠端偵錯工具連線至產生的 Nano 伺服器時,請指定 -DebugTargetName 參數所設定的目標名稱。When you connect the remote debugger to the resulting Nano Server, specify the target name as set by the -DebugTargetName parameter.