Windows Server 2016 Containers Basic Setup
If you would like to lab and play around with containers, there is a really great setup script and a few easy steps you can follow to get a copy of Windows Server 2016 TP 4 setup with containers working. First things first you will need to spin up Windows Server 2016 TP4 in your favorite hypervisor. I am using VMware Workstation 12 Pro which works great with Server 2016. After you have the OS installed and everything up and running along with Internet connectivity, we can use powershell to pull down a setup script that will do the heavy lifting for us to get containers setup and running.
wget -uri https://aka.ms/setupcontainers -OutFile C:ContainerSetup.ps1
The above of course will download the ContainerSetup.ps1 script. Next, we need to run the containersetup.ps1 file.
C:ContainerSetup.ps1
The setup containersetup process above will start the setup and install process of the containers Windows feature. Your server will reboot. Setup will resume once the server has restarted. Container networking is enabled along with the container switch, NAT, etc.
The step below will pull down the Windows Server Core container image. This step will take a bit of time depending on your connection speed.
The script continues along – docker is installed and the script will finally complete.
Starting the Container
After you have run the setup script and it completes successfully, you can now start the container.
$container = New-Container -Name "TestContainer" -ContainerImageName WindowsServerCore Start-Container -Name "TestContainer"
Now we can enter a powershell session to the running container:
Enter-PSSession -ContainerId $container.ContainerId -RunAsAdministrator
We can verify now that we have a subset of processes running in the container as opposed to our host OS:
Host:
Container OS:
As you can see the difference between the processes that show to be running in the container are definitely stripped down compared to our host processes.
Files and Storage
As far as where things are stored, we see a lot of the Hyper-V default storage locations being utilized with the containers technology as well as their DNA is very similar.
C:ProgramDataMicrosoftWindowsImages – This is the location where the Windows Server Core container image was located. It weighed in at around 9GB.
C:ProgramDataMicrosoftWindowsHyper-V – This appears to house most of the container metadata and other container specific information.
Final Thoughts
Containers are basically like virtualization 2.0. We will definitely see a tremendous amount of development around this super cool technology. Hardware virtualization may become more of the old school way of doing things once container technology matures in the near future. More to come on containers in future posts….stay tuned!
Url “https://aka.ms/setupcontainers” no longer works