microsoft / navcontainerhelper

Official Microsoft repository for BcContainerHelper, a PowerShell module, which makes it easier to work with Business Central Containers on Docker.
MIT License
382 stars 244 forks source link

Issue with Process isolation on Windows 11 #2986

Closed gntpet closed 1 year ago

gntpet commented 1 year ago

After upgrading to Windows11, I tried to create my containers using process isolation. Container creates successfully, but I cannot access BC. Browser just gives me connection tiemeout error.

If I run the same script with Hyperv param, it works flawless.

Is it and issue with Windows 11 or something todo with my local setup (antivirus, firewall)?

Scripts used to create container and cause the issue

New-NavContainer `
-accept_eula `
-containerName $containerName `
-artifactUrl $url `
-isolation 'process' `
-Credential $cred `
-auth UserPassword `
-updateHosts `
-useBestContainerOS `
-shortcuts desktop `
-EnableTaskScheduler

Full output of scripts

New-NavContainer `
-accept_eula `
-containerName $containerName `
-artifactUrl $url `
-isolation 'process' `
-Credential $cred `
-auth UserPassword `
-updateHosts `
-useBestContainerOS `
-shortcuts desktop `
-EnableTaskScheduler
BcContainerHelper is version 4.0.15
BcContainerHelper is running as administrator
HyperV is Enabled
UsePsSession is True
Host is Microsoft Windows 11 Enterprise - 10.0.22621.1413
Docker Client Version is 20.10.24
Docker Server Version is 20.10.24
Removing Session base22
Removing container base22
Removing entries from hosts
Removing base22 from container hosts file
Removing base22-* from container hosts file
Removing Desktop shortcuts
Removing C:\ProgramData\BcContainerHelper\Extensions\base22
Fetching all docker images
Fetching all docker volumes
Using image mcr.microsoft.com/businesscentral:10.0.20348.1668
Creating Container base22
Style: onprem
Multitenant: No
Version: 22.0.54157.54635
Platform: 22.0.54512.0
Generic Tag: 1.0.2.14
Container OS Version: 10.0.20348.1668 (ltsc2022)
Host OS Version: 10.0.22621.1413 (22H2)
Using process isolation
Using locale en-US
Disabling the standard eventlog dump to container log every 2 seconds (use -dumpEventLog to enable)
Additional Parameters:
--env customNavSettings=EnableTaskScheduler=True
Files in C:\ProgramData\BcContainerHelper\Extensions\base22\my:
- AdditionalOutput.ps1
- MainLoop.ps1
- SetupVariables.ps1
- updatehosts.ps1
Creating container base22 from image mcr.microsoft.com/businesscentral:10.0.20348.1668
d6d63afe046933a1ed267114d88206cd63bd402e1762996357277b1f7dede167
Waiting for container base22 to be ready
Using artifactUrl https://bcartifacts.azureedge.net/onprem/22.0.54157.54635/w1
Using installer from C:\Run\210-new
Installing Business Central
Installing from artifacts
Starting Local SQL Server
Starting Internet Information Server
Copying Service Tier Files
c:\dl\onprem\22.0.54157.54635\platform\ServiceTier\Program Files
c:\dl\onprem\22.0.54157.54635\platform\ServiceTier\System64Folder
Copying PowerShell Scripts
c:\dl\onprem\22.0.54157.54635\platform\WindowsPowerShellScripts\Cloud\NAVAdministration
c:\dl\onprem\22.0.54157.54635\platform\WindowsPowerShellScripts\WebSearch
Copying Web Client Files
c:\dl\onprem\22.0.54157.54635\platform\WebClient\Microsoft Dynamics NAV
Copying ModernDev Files
c:\dl\onprem\22.0.54157.54635\platform
c:\dl\onprem\22.0.54157.54635\platform\ModernDev\program files\Microsoft Dynamics NAV
Copying additional files
Copying ConfigurationPackages
C:\dl\onprem\22.0.54157.54635\platform\ConfigurationPackages
Copying Test Assemblies
C:\dl\onprem\22.0.54157.54635\platform\Test Assemblies
Copying Applications
C:\dl\onprem\22.0.54157.54635\platform\Applications
Copying dependencies
Copying ReportBuilder
Importing PowerShell Modules
Restoring CRONUS Demo Database
Setting CompatibilityLevel for CRONUS on localhost\SQLEXPRESS
Modifying Business Central Service Tier Config File for Docker
Creating Business Central Service Tier
Installing SIP crypto provider: 'C:\Windows\System32\NavSip.dll'
Starting Business Central Service Tier
Importing license file
Stopping Business Central Service Tier
Installation took 286 seconds
Installation complete
Initializing...
Setting kubernetes.docker.internal to 127.0.0.1 in container hosts file (copy from host hosts file)
Setting host.containerhelper.internal to 172.24.80.1 in container hosts file
Starting Container
Hostname is base22
PublicDnsName is base22
Using NavUserPassword Authentication
Creating Self Signed Certificate
Self Signed Certificate Thumbprint FE2B1B19BBB8741D0C90A4223715AA33E3318971
DNS identity base22
Modifying Service Tier Config File with Instance Specific Settings
Modifying Service Tier Config File with settings from environment variable
Setting EnableTaskScheduler to True
Starting Service Tier
Registering event sources
Creating DotNetCore Web Server Instance
Using application pool name: BC
Using default container name: NavWebApplicationContainer
Copy files to WWW root C:\inetpub\wwwroot\BC
Create the application pool BC
Create website: NavWebApplicationContainer without SSL
Update configuration: navsettings.json
Done Configuring Web Client
Creating http download site
Setting SA Password and enabling SA
Creating gps as SQL User and add to sysadmin
Creating SUPER user
Container IP Address: 172.24.85.250
Container Hostname  : base22
Container Dns Name  : base22
Web Client          : http://base22/BC/
Dev. Server         : http://base22
Dev. ServerInstance : BC
Setting base22 to 172.24.85.250 in host hosts file

Files:
http://base22:8080/ALLanguage.vsix

Container Total Physical Memory is 15.7Gb
Container Free Physical Memory is 4.3Gb

Initialization took 47 seconds
Ready for connections!
Reading CustomSettings.config from base22
Creating Desktop Shortcuts for base22
Cleanup old dotnet core assemblies
Container base22 successfully created

Screenshots image

Additional context

freddydk commented 1 year ago

Never heard about that before. I am using Windows 11 as well - works fine. It is probably a networking issue of some kind - but I don't know.

kylehardin6 commented 1 year ago

Agree with Freddy - sounds like networking. Open the powershell inside the container and look at the services (net start). Is the service tier running? Is IIS? Can you ping the container's address from there (Container IP Address: 172.24.85.250)?

Then open powershell on your host and try the same ping (Container IP Address: 172.24.85.250). If this last step doesn't work but the first steps do, you have a networking issue between your host and docker containers.

freddydk commented 1 year ago

You could also try to disable your defender/antivirus - these things are known to have issues with process isolation on desktop computers.