The dream
Microsoft Windows and Linux working together is a today reality!
And while, my beloved, WSL is pretty much a work-in-progress, Docker and Containers are Production ready.
That's why, when Docker and Microsoft announced the public availability of Linux Containers on Windows (LCOW), the next question from the community was: what if both "platforms" could run with only one daemon.
Well, wait no more, the technology is here. Now!
Yet another guide?
true, but believe me when I say that I followed very carefully the guides done by Docker and another by one of "my" captain, I ended several times in getting errors and no LCOW at all.The frustration was so big that I decided to build a "new" environment step by step.
I'm nowhere near their level (I support an LMS cloud application in my day to day work), which means my setup is certainly less complex and at the same time more complicated, due to the fact I'm missing certain technical aspects here and there.
One is good, more is better
Actually, after discussing with my "first" captain, I decided to make this guide a 3 part separated as follow:Part 1: Introduction and Windows 10 Hyper-V host configuration
Part 2: Windows 2016 Hyper-V guest and Docker daemon configuration
Part 3: Windows 10 Docker client configuration
LCOW with the usual WSL touch
of course, having a blog called "wslcorsair", I cannot have my environment without WSL, right?And this will allow us to follow the guide for securing the Docker Daemon (part 2) thanks the one of the most useful feature: Interopability.
Starting from the end
as you should never believe everything you read on Internet, here is a short animation of the end result:What can be shortly seen in the animation contains the following components:
- Windows 10 (client)
- Hyper-V as the hypervisor
- WSL (ubuntu) as the SSH and Docker client
- Windows 2016 server 1709 (server)
- Hyper-V as the hypervisor
- Docker for Windows (Server)
- WSL (kali) as the SSH server
One short note about the SSH Server: YES, you can use the, now official, OpenSSH feature for Windows (both 10 and 2016).
Or even better, you can do the setup directly from the Hyper-V console.
In my case, I wanted to have this "enterprise feeling", where I do not have direct access to the Hyper-V hosts and will get only Guest access.
Setup: Windows 10 Hyper-V
I will start with an important learning: do not try to go with another virtualization other than Hyper-V.
I tried virtualbox and vmware player first, and due to "nested virtualization" requirements, it always ended up in error when pulling my first image.
The reason I tried other technologies was mainly related to the network management (read NAT with Internet access).
As I'm working from a Laptop, when I setup an external network adapter on Hyper-V, it will "hijack" my Wifi network from the host and only the guest OS will have Internet access.
Not really what I need.
As for the other technologies, it didn't work well when it came to the Nested requirements (or not at all for Virtualbox).
So after long hours of Internet research, I finally found the several parts that lead to the solution, which I gladly share here:
Hopefully, this first part might already help some persons getting started with a nested Hyper-v VM.
This is the end of this Part 1. I will publish the parts 2 and 3 in the next coming days.
The reason I tried other technologies was mainly related to the network management (read NAT with Internet access).
As I'm working from a Laptop, when I setup an external network adapter on Hyper-V, it will "hijack" my Wifi network from the host and only the guest OS will have Internet access.
Not really what I need.
As for the other technologies, it didn't work well when it came to the Nested requirements (or not at all for Virtualbox).
So after long hours of Internet research, I finally found the several parts that lead to the solution, which I gladly share here:
- In the Hyper-V Manager console, open the Virtual Switch Manager
- Check the name of the NAT virtual adapter that you will use for your VM(s)
- Once the name confirmed, enable the Network Sharing on the host (hypervisor)
- Add this adapter to your VMs as a Legacy Network Adapter
- Finally, expose the Virtualization extensions to the VM (source)
Set-VMProcessor -VMName <VMName> -ExposeVirtualizationExtensions $true
Hopefully, this first part might already help some persons getting started with a nested Hyper-v VM.
This is the end of this Part 1. I will publish the parts 2 and 3 in the next coming days.
>>> Nunix Out <<<
Comments
Post a Comment