In a recent video about virtual machines I made mentioned that Microsoft has taken significant steps
to embrace the open source community.
One of those steps is the inclusion of a subsystem for Linux the windows subsystem for Linux is a Windows
feature that allows you to run an instance of Linux on your server.
Now I'm not talking about a dual boot scenario Windows and Linux can run at the same time.
This doesn't require hyper v or virtual machines or containers.
It's not virtualization at all.
It's an entire instance of Ubuntu or Seuss Linux running concurrently on your Windows Server installing
the feature is pretty simple but pulling down and installing a Linux distribution does take a couple
of steps.
You can install the subsystem by using the install Windows feature and power shell or by launching the
wizard from the server manager.
Since I did the last human and power show I'll go ahead and run this one from server manager just for
fun.
I'm going to launch the wizard from the dashboard and move forward through yes I want to install a role
or feature I want to install it on this machine and it's not a role I want to install a feature.
So here I'm going to scroll to the very bottom of the alphabetic list and look for Windows subsystem
for Linux.
And when I check that box you can see that no additional steps were added so I can go ahead and just
continue on forward and add this feature.
Now this installation might only take a few seconds or a couple minutes depending on your resources.
But as you can see here it does require a reboot because it's made some substantial changes.
So I'm going to go ahead and close this wizard and reboot the system
a restart because of a planned operating system reconfiguration and I'm going to fast forward to the
point where the server has restarted.
All right now that the reboot has completed I want to download and install a distribution of Linux so
let me go ahead and move over to power shell to do that run as administrator and first we need to go
ahead and download it and to do that I'm going to use the invoke web request command let.
I need to specify a couple of parameters here.
First I need to say that the you r i is h TTP s
a k a dot M S slash.
And here I give the name of the distribution that I would like to download.
And you can do web searches to find what's available at the time.
I've seen SLAs JNU suits Debian Ubuntu available for downloading and use in this environment.
But I'm going to go ahead and start with an a bunch to distribution one to let's use 16 0 4 and then
another parameter that I need to add to this command what is I need to specify the output file
and the file that I'm going to create I'm going to give it a very simple name to type later I'm just
going to call it a bunch to dot AP X because that's the file extension that it's downloading anyway
and I'm going to add one other parameter.
Use basic passing.
Now this download can be fairly large.
So once again I'm going to skip forward quite a bit and the video will resume momentarily at the end
of this download.
All right.
Now that's downloaded and know my server isn't quite that fast.
We just trimmed out some of the time to speed things up a bit here.
Now that the downloads done we're going to need to rename the files so that we can unpack it.
The Linux installer downloads as an AP exe file but that file has all of the same properties as a common
zip file so I can rename the file right here in power shell using rename item the file that I want to
rename is Ubuntu dot AP ex and I would like to rename it to Ubuntu dot zip
and renaming doesn't take very long at all.
So the next commandment is to expand the archive
and we're going to unpack the file Ubuntu dot Zip.
And we're going to put all of that information in a new directory which we will create and call Ubuntu
and that unpacking doesn't take very long.
Let me go ahead and take a look at where we are.
Here you can see that the Ubuntu folder is not here.
That's because I told it to put this folder in the root of the drive.
So let me go ahead and change directories to the root of this drive and if I hit the directory again
there's my Ubuntu folder.
So change directories into the Ubuntu folder run another directory listing.
And here we find the Ubuntu dot EMC the file that's going to install this distribution of Linux in power
so when you want to run an executable even if you're in the current directory it's always a good idea
to start with dot slash and power Shell is not real particular about whether that slash leans forward
or backwards whichever you type will end up working out just fine but let me go ahead and type Ubuntu
dot e x e and that will install Linux into that subsystem on this machine.
Now this is going to take longer than the download but when it's complete you'll be asked to create
a Linux user name and password and then you'll be dropped directly into your Linux environment.
You can exit out of that and at any given time you can open power shell or a command prompt and type
bash to re-enter your selected Linux distribution.
That environment will allow you to install Linux applications.
Maybe you want to install the Linux instance of Docker then you can host windows containers and Linux
containers at the same time from the same physical hardware or from within the same virtual server.