none
Error when starting container with network mapping RRS feed

  • Question

  • Hi,

    I'm running Windows Server preview 3 in a VM locally and using docker. I've been able to create and run images successfully but when i try an map any port the container fails to start with the following error:

    "HCSShim::CreateComputeSystem - Win32 API call returned error r1=2147749890 err=winapi error #2147749890 id=c1e398b16c91560e6a49782401611c25dd58c9c327d4395ae479fd8209f85832 configuration={\"SystemType\":\"Container\",\"Name\":\"c1e398b16c91560e6a49782401611c25dd58c9c327d4395ae479fd8209f85832\",\"Owner\":\"docker\",\"IsDummy\":false,\"VolumePath\":\"\\\\\\\\?\\\\Volume{9ccf575e-4812-11e5-89c2-000c2956d878}\",\"Devices\":[{\"DeviceType\":\"Network\",\"Connection\":{\"NetworkName\":\"Virtual Switch\",\"EnableNat\":false,\"Nat\":{\"Name\":\"ContainerNAT\",\"PortBindings\":[{\"Protocol\":\"TCP\",\"InternalPort\":80,\"ExternalPort\":80}]}},\"Settings\":null}],\"IgnoreFlushesDuringBoot\":true,\"LayerFolderPath\":\"C:\\\\ProgramData\\\\docker\\\\windowsfilter\\\\c1e398b16c91560e6a49782401611c25dd58c9c327d4395ae479fd8209f85832\",\"Layers\":[{\"ID\":\"6390a974-8d88-5529-a16a-bf49f807f868\",\"Path\":\"C:\\\\ProgramData\\\\docker\\\\windowsfilter\\\\97eb3b33387118e62e25e32a7639ead24812835030b168b2fd4e34cfd54f0102\"},{\"ID\":\"f9fad2ee-61a1-5188-a5b5-df2f32e6d2dc\",\"Path\":\"C:\\\\ProgramData\\\\docker\\\\windowsfilter\\\\836ba1605bf988a3c09c6ecd1b9d5160c6d234387e338c993690ed36f26ba91d\"},{\"ID\":\"37425eb1-2ab5-5e7c-b880-ff5f0ce009e6\",\"Path\":\"C:\\\\ProgramData\\\\docker\\\\windowsfilter\\\\a266ad073d30d8b3d52ad02aafe562e6b9a7be07136815dcd6de4fa28307ae6e\"},{\"ID\":\"e7c38f2a-9924-5e7b-9050-ef5bdd37c822\",\"Path\":\"C:\\\\ProgramData\\\\docker\\\\windowsfilter\\\\aaa3260042e5a03c98b468ca5c951265a4f5c3ddc939587b8ac1778b6af444df\"},{\"ID\":\"280d667b-5583-57ef-8bad-bda47b2a80b6\",\"Path\":\"C:\\\\ProgramData\\\\docker\\\\windowsfilter\\\\ceefcc8f8cbb12a43301766d2842c192a3e51b100bcac937ce8f5d7da028b4d3\"},{\"ID\":\"f0d4aaa3-c43d-59c1-8ad0-44e6b3381efc\",\"Path\":\"C:\\\\ProgramData\\\\Microsoft\\\\Windows\\\\Images\\\\CN=Microsoft_WindowsServerCore_10.0.10514.0\"}]

    I installed the container as detailed at https://msdn.microsoft.com/en-us/virtualization/windowscontainers/quick_start/container_setup by running the powershell script.

    I did get an error when that ran see below and am not sure if that is significant or not:

    Querying status of Windows feature: Containers...
    Feature Containers is already enabled.
    Enabling container networking...
    Creating container switch (NAT)...
    Creating NAT for 172.16.0.0/12...
    New-NetNat : No matching interface was found for prefix (null).
    At C:\containersetup.ps1:247 char:5
    +     New-NetNat -Name ContainerNAT -InternalIPInterfaceAddressPrefix $ ...
    +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (MSFT_NetNat:root/StandardCimv2/MSFT_NetNat) [New-NetNat], CimException
        + FullyQualifiedErrorId : Windows System Error 1169,New-NetNat

    Installing Container OS image from http://aka.ms/ContainerOSImage (this may take a few minutes)...
    Downloading Container OS image (WIM) from http://aka.ms/ContainerOSImage to C:\Users\Administrator\ContainerBaseImage.w
    im...
    Waiting for VMMS to return image at (08/21/2015 13:02:34)...
    Container base image install complete.  Querying container images...
    The following images are present on this machine:
        ContainerImage (Name = 'WindowsServerCore') [Publisher = 'CN=Microsoft', Version = '10.0.10514.0'].Name

    Installing Docker...
    This script uses a third party tool: NSSM service manager. For more information, see https://nssm.cc/usage
    Downloading NSSM...
    Extracting NSSM from archive...
    Creating Docker program data...
    Configuring NSSM for Docker service...
    Waiting for Docker daemon...
    Successfully connected to Docker Daemon.
    Tagging new base image...
    Script complete!
    PS C:\Users\Administrator>

    Output from docker inspect for the image is:

    [
    {
        "Id": "c1e398b16c91560e6a49782401611c25dd58c9c327d4395ae479fd8209f85832",
        "Created": "2015-08-21T15:56:59.6759685Z",
        "Path": "cmd",
        "Args": [],
        "State": {
            "Running": false,
            "Paused": false,
            "Restarting": false,
            "OOMKilled": false,
            "Dead": false,
            "Pid": 0,
            "ExitCode": -1,
            "Error": "HCSShim::CreateComputeSystem - Win32 API call returned error r1=2147749890 err=winapi error #2147749890 id=c1e398b16c91560e6a49782401611c25dd58c9c327d4395ae479fd8209f85832 configuration={\"SystemType\":\"Container\",\"Name\":\"c1e398b16c91560e6a49782401611c25dd58c9c327d4395ae479fd8209f85832\",\"Owner\":\"docker\",\"IsDummy\":false,\"VolumePath\":\"\\\\\\\\?\\\\Volume{9ccf575e-4812-11e5-89c2-000c2956d878}\",\"Devices\":[{\"DeviceType\":\"Network\",\"Connection\":{\"NetworkName\":\"Virtual Switch\",\"EnableNat\":false,\"Nat\":{\"Name\":\"ContainerNAT\",\"PortBindings\":[{\"Protocol\":\"TCP\",\"InternalPort\":80,\"ExternalPort\":80}]}},\"Settings\":null}],\"IgnoreFlushesDuringBoot\":true,\"LayerFolderPath\":\"C:\\\\ProgramData\\\\docker\\\\windowsfilter\\\\c1e398b16c91560e6a49782401611c25dd58c9c327d4395ae479fd8209f85832\",\"Layers\":[{\"ID\":\"6390a974-8d88-5529-a16a-bf49f807f868\",\"Path\":\"C:\\\\ProgramData\\\\docker\\\\windowsfilter\\\\97eb3b33387118e62e25e32a7639ead24812835030b168b2fd4e34cfd54f0102\"},{\"ID\":\"f9fad2ee-61a1-5188-a5b5-df2f32e6d2dc\",\"Path\":\"C:\\\\ProgramData\\\\docker\\\\windowsfilter\\\\836ba1605bf988a3c09c6ecd1b9d5160c6d234387e338c993690ed36f26ba91d\"},{\"ID\":\"37425eb1-2ab5-5e7c-b880-ff5f0ce009e6\",\"Path\":\"C:\\\\ProgramData\\\\docker\\\\windowsfilter\\\\a266ad073d30d8b3d52ad02aafe562e6b9a7be07136815dcd6de4fa28307ae6e\"},{\"ID\":\"e7c38f2a-9924-5e7b-9050-ef5bdd37c822\",\"Path\":\"C:\\\\ProgramData\\\\docker\\\\windowsfilter\\\\aaa3260042e5a03c98b468ca5c951265a4f5c3ddc939587b8ac1778b6af444df\"},{\"ID\":\"280d667b-5583-57ef-8bad-bda47b2a80b6\",\"Path\":\"C:\\\\ProgramData\\\\docker\\\\windowsfilter\\\\ceefcc8f8cbb12a43301766d2842c192a3e51b100bcac937ce8f5d7da028b4d3\"},{\"ID\":\"f0d4aaa3-c43d-59c1-8ad0-44e6b3381efc\",\"Path\":\"C:\\\\ProgramData\\\\Microsoft\\\\Windows\\\\Images\\\\CN=Microsoft_WindowsServerCore_10.0.10514.0\"}]}",
            "StartedAt": "0001-01-01T00:00:00Z",
            "FinishedAt": "0001-01-01T00:00:00Z"
        },
        "Image": "97eb3b33387118e62e25e32a7639ead24812835030b168b2fd4e34cfd54f0102",
        "NetworkSettings": {
            "Bridge": "",
            "EndpointID": "",
            "Gateway": "",
            "GlobalIPv6Address": "",
            "GlobalIPv6PrefixLen": 0,
            "HairpinMode": false,
            "IPAddress": "",
            "IPPrefixLen": 0,
            "IPv6Gateway": "",
            "LinkLocalIPv6Address": "",
            "LinkLocalIPv6PrefixLen": 0,
            "MacAddress": "",
            "NetworkID": "",
            "PortMapping": null,
            "Ports": null,
            "SandboxKey": "",
            "SecondaryIPAddresses": null,
            "SecondaryIPv6Addresses": null
        },
        "ResolvConfPath": "",
        "HostnamePath": "",
        "HostsPath": "",
        "LogPath": "C:\\ProgramData\\docker\\containers\\c1e398b16c91560e6a49782401611c25dd58c9c327d4395ae479fd8209f85832\\c1e398b16c91560e6a49782401611c25dd58c9c327d4395ae479fd8209f85832-json.log",
        "Name": "/tomcat_container",
        "RestartCount": 0,
        "Driver": "windowsfilter",
        "ExecDriver": "Windows 1854 1.9.0-dev 4376380",
        "MountLabel": "",
        "ProcessLabel": "",
        "AppArmorProfile": "",
        "ExecIDs": null,
        "HostConfig": {
            "Binds": null,
            "ContainerIDFile": "",
            "LxcConf": [],
            "Memory": 0,
            "MemorySwap": 0,
            "CpuShares": 0,
            "CpuPeriod": 0,
            "CpusetCpus": "",
            "CpusetMems": "",
            "CpuQuota": 0,
            "BlkioWeight": 0,
            "OomKillDisable": false,
            "MemorySwappiness": -1,
            "Privileged": false,
            "PortBindings": {
                "80/tcp": [
                    {
                        "HostIp": "",
                        "HostPort": "80"
                    }
                ]
            },
            "Links": null,
            "PublishAllPorts": false,
            "Dns": null,
            "DnsSearch": null,
            "ExtraHosts": null,
            "VolumesFrom": null,
            "Devices": [],
            "NetworkMode": "default",
            "IpcMode": "",
            "PidMode": "",
            "UTSMode": "",
            "CapAdd": null,
            "CapDrop": null,
            "GroupAdd": null,
            "RestartPolicy": {
                "Name": "no",
                "MaximumRetryCount": 0
            },
            "SecurityOpt": null,
            "ReadonlyRootfs": false,
            "Ulimits": null,
            "LogConfig": {
                "Type": "json-file",
                "Config": {}
            },
            "CgroupParent": "",
            "ConsoleSize": [
                30,
                120
            ]
        },
        "GraphDriver": {
            "Name": "windowsfilter",
            "Data": {
                "dir": "C:\\ProgramData\\docker\\windowsfilter\\c1e398b16c91560e6a49782401611c25dd58c9c327d4395ae479fd8209f85832"
            }
        },
        "Mounts": null,
        "Config": {
            "Hostname": "c1e398b16c91",
            "Domainname": "",
            "User": "",
            "AttachStdin": true,
            "AttachStdout": true,
            "AttachStderr": true,
            "ExposedPorts": {
                "80/tcp": {}
            },
            "PublishService": "",
            "Tty": true,
            "OpenStdin": true,
            "StdinOnce": true,
            "Env": [
                "JAVA_HOME=c:/jre"
            ],
            "Cmd": [
                "cmd"
            ],
            "Image": "tomcat7_windows",
            "Volumes": null,
            "VolumeDriver": "",
            "WorkingDir": "",
            "Entrypoint": null,
            "NetworkDisabled": false,
            "MacAddress": "",
            "OnBuild": null,
            "Labels": {}
        }
    }
    ]

    Friday, August 21, 2015 4:19 PM

Answers

  • I found that there was a conflict between my vm network address and the nat address. When I changed the network address of the vm and ran the command 

    New-NetNat -Name ContainerNAT -InternalIPInterfaceAddressPrefix 172.16.0.0/12

    that was failing from the script it now worked.

    When I now run:

     Get-NetNat

    I get 

    Name                             : ContainerNAT
    ExternalIPInterfaceAddressPrefix :
    InternalIPInterfaceAddressPrefix : 172.16.0.0/12
    IcmpQueryTimeout                 : 30
    TcpEstablishedConnectionTimeout  : 1800
    TcpTransientConnectionTimeout    : 120
    TcpFilteringBehavior             : AddressDependentFiltering
    UdpFilteringBehavior             : AddressDependentFiltering
    UdpIdleSessionTimeout            : 120
    UdpInboundRefresh                : False
    Store                            : Local
    Active                           : True

    and my run commands now work ok :-)

    Monday, August 24, 2015 8:46 AM

All replies

  • Can you open PowerShell, run "get-vmswitch" and post the output here?

    This posting is provided AS IS with no warranties, and confers no rights. You assume all risk for your use.

    Friday, August 21, 2015 5:47 PM
  • Hi Ben,

    Thanks for your reply.

    Output below. Looks like the switch is missing ?

    Any suggestions how to create it ?


    PS C:\Users\Administrator\Documents> get-vmswitch

    Name           SwitchType NetAdapterInterfaceDescription
    ----           ---------- ------------------------------
    Virtual Switch NAT


    PS C:\Users\Administrator\Documents>

    Sunday, August 23, 2015 8:21 PM
  • I found that there was a conflict between my vm network address and the nat address. When I changed the network address of the vm and ran the command 

    New-NetNat -Name ContainerNAT -InternalIPInterfaceAddressPrefix 172.16.0.0/12

    that was failing from the script it now worked.

    When I now run:

     Get-NetNat

    I get 

    Name                             : ContainerNAT
    ExternalIPInterfaceAddressPrefix :
    InternalIPInterfaceAddressPrefix : 172.16.0.0/12
    IcmpQueryTimeout                 : 30
    TcpEstablishedConnectionTimeout  : 1800
    TcpTransientConnectionTimeout    : 120
    TcpFilteringBehavior             : AddressDependentFiltering
    UdpFilteringBehavior             : AddressDependentFiltering
    UdpIdleSessionTimeout            : 120
    UdpInboundRefresh                : False
    Store                            : Local
    Active                           : True

    and my run commands now work ok :-)

    Monday, August 24, 2015 8:46 AM
  • Great!

    This posting is provided AS IS with no warranties, and confers no rights. You assume all risk for your use.

    Tuesday, August 25, 2015 5:52 AM