NetShareEnum returns 2114 (NERR_ServerNotStarted) inside Docker container on Windows












0














When calling NetShareEnum inside Docker container (based on mcr.microsoft.com/windows/servercore:1803 image) on Windows, I'm getting NERR_ServerNotStarted as a return value. Here's a minimal sample code that produces the error:



#include <stdio.h>

#include <windows.h>
#include <lm.h>

int main()
{
PSHARE_INFO_502 buffer;
DWORD entriesRead, totalEntries, resume = 0;
NET_API_STATUS result = NetShareEnum(NULL, 502, (LPBYTE*)&buffer, MAX_PREFERRED_LENGTH,
&entriesRead, &totalEntries, &resume);
if (result != ERROR_SUCCESS && result != ERROR_MORE_DATA)
{
printf("NetShareEnum error: %08x (%u)n", result, result);
return 1;
}

printf("All good!n");
NetApiBufferFree(buffer);

return 0;
}


which outputs:



NetShareEnum error: 00000842 (2114)


Same happens with other information levels like 2 or 0. Note that networking itself is working properly inside the container (I'm able to reach web resources and other computers) and is not related to this specific question.



I'd appreciate any insight as to what the issue is exactly and whether it is possible to fix it properly or at least work it around somehow. Thanks.





EDIT: Tried running LanmanServer in hopes that it's the one I need:



PS C:> Start-Service LanmanServer
Start-Service : Failed to start service 'Server (LanmanServer)'.
At line:1 char:1
+ Start-Service LanmanServer
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OpenError: (System.ServiceProcess.ServiceController:ServiceController) [Start-Service], ServiceCommandException
+ FullyQualifiedErrorId : StartServiceFailed,Microsoft.PowerShell.Commands.StartServiceCommand

PS C:> Get-EventLog System -Newest 1 | fl


Index : 603
EntryType : Error
InstanceId : 3221232495
Message : The Server service terminated with the following error:
%%2
Category : (0)
CategoryNumber : 0
ReplacementStrings : {Server, %%2}
Source : Service Control Manager
TimeGenerated : 11/20/2018 4:23:59 PM
TimeWritten : 11/20/2018 4:23:59 PM
UserName :









share|improve this question
























  • Similar to Running ServiceBus in windows docker container.
    – mike.dld
    Nov 21 at 0:32
















0














When calling NetShareEnum inside Docker container (based on mcr.microsoft.com/windows/servercore:1803 image) on Windows, I'm getting NERR_ServerNotStarted as a return value. Here's a minimal sample code that produces the error:



#include <stdio.h>

#include <windows.h>
#include <lm.h>

int main()
{
PSHARE_INFO_502 buffer;
DWORD entriesRead, totalEntries, resume = 0;
NET_API_STATUS result = NetShareEnum(NULL, 502, (LPBYTE*)&buffer, MAX_PREFERRED_LENGTH,
&entriesRead, &totalEntries, &resume);
if (result != ERROR_SUCCESS && result != ERROR_MORE_DATA)
{
printf("NetShareEnum error: %08x (%u)n", result, result);
return 1;
}

printf("All good!n");
NetApiBufferFree(buffer);

return 0;
}


which outputs:



NetShareEnum error: 00000842 (2114)


Same happens with other information levels like 2 or 0. Note that networking itself is working properly inside the container (I'm able to reach web resources and other computers) and is not related to this specific question.



I'd appreciate any insight as to what the issue is exactly and whether it is possible to fix it properly or at least work it around somehow. Thanks.





EDIT: Tried running LanmanServer in hopes that it's the one I need:



PS C:> Start-Service LanmanServer
Start-Service : Failed to start service 'Server (LanmanServer)'.
At line:1 char:1
+ Start-Service LanmanServer
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OpenError: (System.ServiceProcess.ServiceController:ServiceController) [Start-Service], ServiceCommandException
+ FullyQualifiedErrorId : StartServiceFailed,Microsoft.PowerShell.Commands.StartServiceCommand

PS C:> Get-EventLog System -Newest 1 | fl


Index : 603
EntryType : Error
InstanceId : 3221232495
Message : The Server service terminated with the following error:
%%2
Category : (0)
CategoryNumber : 0
ReplacementStrings : {Server, %%2}
Source : Service Control Manager
TimeGenerated : 11/20/2018 4:23:59 PM
TimeWritten : 11/20/2018 4:23:59 PM
UserName :









share|improve this question
























  • Similar to Running ServiceBus in windows docker container.
    – mike.dld
    Nov 21 at 0:32














0












0








0







When calling NetShareEnum inside Docker container (based on mcr.microsoft.com/windows/servercore:1803 image) on Windows, I'm getting NERR_ServerNotStarted as a return value. Here's a minimal sample code that produces the error:



#include <stdio.h>

#include <windows.h>
#include <lm.h>

int main()
{
PSHARE_INFO_502 buffer;
DWORD entriesRead, totalEntries, resume = 0;
NET_API_STATUS result = NetShareEnum(NULL, 502, (LPBYTE*)&buffer, MAX_PREFERRED_LENGTH,
&entriesRead, &totalEntries, &resume);
if (result != ERROR_SUCCESS && result != ERROR_MORE_DATA)
{
printf("NetShareEnum error: %08x (%u)n", result, result);
return 1;
}

printf("All good!n");
NetApiBufferFree(buffer);

return 0;
}


which outputs:



NetShareEnum error: 00000842 (2114)


Same happens with other information levels like 2 or 0. Note that networking itself is working properly inside the container (I'm able to reach web resources and other computers) and is not related to this specific question.



I'd appreciate any insight as to what the issue is exactly and whether it is possible to fix it properly or at least work it around somehow. Thanks.





EDIT: Tried running LanmanServer in hopes that it's the one I need:



PS C:> Start-Service LanmanServer
Start-Service : Failed to start service 'Server (LanmanServer)'.
At line:1 char:1
+ Start-Service LanmanServer
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OpenError: (System.ServiceProcess.ServiceController:ServiceController) [Start-Service], ServiceCommandException
+ FullyQualifiedErrorId : StartServiceFailed,Microsoft.PowerShell.Commands.StartServiceCommand

PS C:> Get-EventLog System -Newest 1 | fl


Index : 603
EntryType : Error
InstanceId : 3221232495
Message : The Server service terminated with the following error:
%%2
Category : (0)
CategoryNumber : 0
ReplacementStrings : {Server, %%2}
Source : Service Control Manager
TimeGenerated : 11/20/2018 4:23:59 PM
TimeWritten : 11/20/2018 4:23:59 PM
UserName :









share|improve this question















When calling NetShareEnum inside Docker container (based on mcr.microsoft.com/windows/servercore:1803 image) on Windows, I'm getting NERR_ServerNotStarted as a return value. Here's a minimal sample code that produces the error:



#include <stdio.h>

#include <windows.h>
#include <lm.h>

int main()
{
PSHARE_INFO_502 buffer;
DWORD entriesRead, totalEntries, resume = 0;
NET_API_STATUS result = NetShareEnum(NULL, 502, (LPBYTE*)&buffer, MAX_PREFERRED_LENGTH,
&entriesRead, &totalEntries, &resume);
if (result != ERROR_SUCCESS && result != ERROR_MORE_DATA)
{
printf("NetShareEnum error: %08x (%u)n", result, result);
return 1;
}

printf("All good!n");
NetApiBufferFree(buffer);

return 0;
}


which outputs:



NetShareEnum error: 00000842 (2114)


Same happens with other information levels like 2 or 0. Note that networking itself is working properly inside the container (I'm able to reach web resources and other computers) and is not related to this specific question.



I'd appreciate any insight as to what the issue is exactly and whether it is possible to fix it properly or at least work it around somehow. Thanks.





EDIT: Tried running LanmanServer in hopes that it's the one I need:



PS C:> Start-Service LanmanServer
Start-Service : Failed to start service 'Server (LanmanServer)'.
At line:1 char:1
+ Start-Service LanmanServer
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OpenError: (System.ServiceProcess.ServiceController:ServiceController) [Start-Service], ServiceCommandException
+ FullyQualifiedErrorId : StartServiceFailed,Microsoft.PowerShell.Commands.StartServiceCommand

PS C:> Get-EventLog System -Newest 1 | fl


Index : 603
EntryType : Error
InstanceId : 3221232495
Message : The Server service terminated with the following error:
%%2
Category : (0)
CategoryNumber : 0
ReplacementStrings : {Server, %%2}
Source : Service Control Manager
TimeGenerated : 11/20/2018 4:23:59 PM
TimeWritten : 11/20/2018 4:23:59 PM
UserName :






windows docker winapi networking windows-services






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 21 at 0:27

























asked Nov 21 at 0:02









mike.dld

2,4311018




2,4311018












  • Similar to Running ServiceBus in windows docker container.
    – mike.dld
    Nov 21 at 0:32


















  • Similar to Running ServiceBus in windows docker container.
    – mike.dld
    Nov 21 at 0:32
















Similar to Running ServiceBus in windows docker container.
– mike.dld
Nov 21 at 0:32




Similar to Running ServiceBus in windows docker container.
– mike.dld
Nov 21 at 0:32

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53403443%2fnetshareenum-returns-2114-nerr-servernotstarted-inside-docker-container-on-win%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53403443%2fnetshareenum-returns-2114-nerr-servernotstarted-inside-docker-container-on-win%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Wiesbaden

To store a contact into the json file from server.js file using a class in NodeJS

Marschland