none
Can't start powershell session with Nano Server RRS feed

  • Question

  • I'm following this guide (https://technet.microsoft.com/en-us/library/mt126167.aspx - To quickly deploy Nano Server in a virtual machine), but I can't connect with Powershell to Nano server.

    This is what I did:

    1. Copy NanoServerImageGenerator.psm1 and Convert-WindowsImage.ps1 from the \NanoServer folder in the Windows Server Technical Preview ISO to C:\Temp\NanoServer.
    2. Start Windows PowerShell as an administrator, change directory to C:\Temp\NanoServer and then import the NanoServerImageGenerator script with

    Import-Module .\NanoServerImageGenerator.psm1 -Verbose

    3. Create a VHD with the ISO mounted as g:\

    New-NanoServerImage -MediaPath g:\ -BasePath .\Base -TargetPath .\Nano1\Nano.vhd -ComputerName Nano1 -GuestDrivers -EnableRemoteManagementPort


    4. In Hyper-V Manager, create a new virtual machine and use the VHD created in Step 3.
    5. Boot the virtual machine and in Hyper-V Manager connect to the virtual machine.
    6. Log on to the Recovery Console (see the "Nano Server Recovery Console" and obtain the IP address of the Nano Server virtual machine. Ip address = 169.254.62.82

    Next I tried to connect with Powershell. I did this by following the steps under "Using Windows PowerShell remoting":

    7. Open Powershell commandline as administrator

    8. Execute this command: 

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


    9. Execute this command: 

    Enter-PSSession -ComputerName "169.254.62.82" -Credential "169.254.62.82\Administrator"


    Now I get this error:

    Enter-PSSession : Connecting to remote server 169.254.62.82 failed with the following error message : The client cannot connect to the destination specified in the request. Verify that the service on the destination is running and is accepting requests. Consult the logs and documentation for the
    WS-Management service running on the destination, most commonly IIS or WinRM. If the destination is the WinRM service, run the following command on the destination to analyze and configure the WinRM service: "winrm quickconfig". For more information, see the about_Remote_Troubleshooting Help topic.
    At line:1 char:1
    + Enter-PSSession -ComputerName "169.254.62.82" -Credential "169.254.62.82\Adminis ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidArgument: (169.254.62.82:String) [Enter-PSSession], PSRemotingTransportException
        + FullyQualifiedErrorId : CreateRemoteRunspaceFailed

    Do you have any idea what I can do to fix this?

    Wednesday, February 3, 2016 12:23 PM

Answers

  • The 169.254.x.x address means that there is no IP address assigned to the VM, most likely because it could not communicate with a DHCP server.  That is what is known as an APIPA address.  It has its uses, but it is a very special case.  The machine from which you are trying to remotely manage the Nano Server system would also need an APIPA address in order for you to communicate with it because the APIPA addresses are not configured for routing.

    You need to have a DHCP service available to the Nano Server machine in order for it to receive a usable IP address.


    . : | : . : | : . tim

    Wednesday, February 3, 2016 3:07 PM

All replies

  • The 169.254.x.x address means that there is no IP address assigned to the VM, most likely because it could not communicate with a DHCP server.  That is what is known as an APIPA address.  It has its uses, but it is a very special case.  The machine from which you are trying to remotely manage the Nano Server system would also need an APIPA address in order for you to communicate with it because the APIPA addresses are not configured for routing.

    You need to have a DHCP service available to the Nano Server machine in order for it to receive a usable IP address.


    . : | : . : | : . tim

    Wednesday, February 3, 2016 3:07 PM
  • Thx. That helped me a lot.

    I used this link to setup networking on the VM: http://superuser.com/questions/469806/windows-8-hyper-v-how-to-give-vm-internet-access

    Wednesday, February 3, 2016 6:57 PM
  • Hello, kindly help me as i am having issues  with connecting to Nanoserver via powershell

    My Nanoserver is set up as a VM. Basic configurations. nothing fancy at all. This is a first time for me on nanoserver

    configured static IP and firewall rules to allow ping. 

    IP address assigned and i can ping it from the  host Windows 10

    I ran the "Set-item wsman" command, but i get following error.

    I also tried a WinrM reset from the Nano server

    Also tried restarting the VM. but same error. i cant manage run powershell commands without this. 

    Can you please tell me the problem? This was installed  from the 2016 ISO which was freshly downloaded on Feb 17th. 

    Sunday, February 18, 2018 11:55 AM
  • Can you please tell me the problem? This was installed  from the 2016 ISO which was freshly downloaded on Feb 17th. 

    Have you enabled winrm on the client that this errors appears on?

    Enable and Use Remote Commands in Windows PowerShell

    So ran 'winrm quickconfig' from a prompt, or Enable-PSRemoting –force from PowerShell?

    Sunday, February 18, 2018 5:05 PM
  • Also worth noting with Nano server, from Install Nano Server

    "Important+

    Starting in Windows Server, version 1709, Nano Server will be available only as a container base OS image. Check out Changes to Nano Server to learn what this means."

    Nano server is the original release is not longer Current Branch for Business.


    Sunday, February 18, 2018 5:07 PM
  • A bit late but if you are working with VM's, try disabling your host's firewall.
    Monday, February 10, 2020 12:45 PM
  • Not sure why disabling the host's firewall would do anything for the VM.  The host operating system is completely isolated from the VM operating system.  Firewall settings can be completely different in each environment with no effect on the other environment.

    tim

    Monday, February 10, 2020 3:41 PM