Windows Server Notes

1. Extend Trial Period

  • To extend the trial period by an additional 180 days, do the following:

    1. Launch an elevated command prompt.

    2. Run slmgr -rearm

2. Docker on Windows Server 2022

2.1. Synposis

  • This will only allow for Windows docker containers.

2.2. Docker Install

  • Original doc.

    1. Install Hyper-V and select the Containers feature.

    2. Install Docker

      1. Launch an elevated PowerShell window

      2. Execute:

        Install-Module -Name DockerMsftProvider -Repository PSGallery -Force
        Install-Package -Name docker -ProviderName DockerMsftProvider
    3. Now reboot

      Restart-Computer
    4. Test a Docker image.

      1. Launch an elevated CMD window and run the following:

        docker run -d -p 9001:9001 --name The-Portainer-Agent --restart=always -v C:\:C:\host -v C:\ProgramData\docker\volumes:C:\ProgramData\docker\volumes -v \\.\pipe\docker_engine:\\.\pipe\docker_engine portainer/agent:latest
      2. Confirm

        docker ps
        Example
        C:\Windows\system32>docker ps
        CONTAINER ID   IMAGE                    COMMAND              CREATED         STATUS         PORTS                    NAMES
        94f3cc30eec4   portainer/agent:latest   "C:/app/agent.exe"   2 minutes ago   Up 2 minutes   0.0.0.0:9001->9001/tcp   The-Portainer-Agent

2.3. Install Portainer Container Manager UI

  • What is Portainer:

    Portainer hides the complexity of managing containers behind an easy-to-use UI. By removing the need to use the CLI, write YAML or understand manifests, Portainer makes deploying apps and troubleshooting problems so easy that anyone can do it.

    — Portainer
Requires docker container support

2.3.1. Portainer Installation

  • Original install doc can be found here.

    1. Launch an elevated PowerShell window and run the following commands:

      1. Create a volume for the Portainer Server’s DB

        docker volume create portainer_data
      2. Start the container:

        docker run -d -p 8000:8000 -p 9443:9443 --name PortainerCE --restart always -v \\.\pipe\docker_engine:\\.\pipe\docker_engine -v portainer_data:C:\data portainer/portainer-ce
    2. Open FireWall port

      netsh advfirewall firewall add rule name="portainer" dir=in action=allow protocol=TCP localport=9443

    3. Log in locally:

      https://localhost:9443
    4. Log in remotely:

      https://v-serv2022-docker:9443/

3. WSL

  • Follow this doc.