Have MS Windows, Want Linux? A 5 minute Docker solution

I found this youtube about Docker interesting for how easily they got an Ubuntu image running. It takes just a minute (depending on download speed) and then pops open an Ubuntu shell / terminal window. I’ve been planning to “someday” get familiar with Docker as a way to have multiple system images and security isolation between things, without a lot of changing uSD cards or SBC systems; but jut not got that Round Tuit yet. For me, it will be somewhat different as I’m on Linux already. This is demonstrating putting an Ubuntu (or any of several other system images…) onto a Windows base platform. It does it in nearly no time and with nearly no effort.

Visit the Docker site and install Docker. (Does need a CPU that supports virtualization, so not for that old crappy White Box PC in the corner…)
Launch it.
Open a MS “power shell” (i.e. command line window)
Type: docker run -it ubuntu
Wait while 50 MB gets downloaded and uncompressed (it is a small image lacking things rarely used)
Pops open an Ubuntu window and you are live.
That’s It.

If I’m ever stuck on a Windoz box again, I’m doing this immediately ;-)

20 minutes as it then goes through some image management commands and other operational bits:

So now I’m much more encouraged to get set up with Docker and give it a try. For me, it will be more complicated as I’ll need images built for Arm arch. It does look like there are folks running Docker on the R.Pi and this page (picked at random from a quick search) looks like it is not that hard either. It does caution to make sure you search for Arm images.

https://blog.hypriot.com/getting-started-with-docker-on-your-arm-device/

One great aspect of running a Docker-based app is, you can be sure that it works on every machine running Docker with one exception.

Here we run Docker on a Raspberry Pi. So the CPU architecture here is ARM rather than x86/x64 by Intel or AMD. Thus, Docker-based apps you use have to be packaged specifically for ARM architecture! Docker-based apps packaged for x86/x64 will not work and will result in an error such as:

FATA[0003] Error response from daemon: Cannot start container 0f0fa3f8e510e53908e6a459e817d600b9649e621e7dede974d6a65761ad39e5: exec format error

Keep this in mind when searching for apps on the Docker Hub – the source for Docker apps/images. If you see the keyword RPI or ARM in the heading or description, this app can usually be used for the Raspberry Pi.

We prepared a couple of Raspberry Pi ready images for your convenience. Try them out now and have fun!

There is also a place called the “Docker Hub” where it seems lots of folks can store “images”. I sense a certain amount of security issue in that… but OK, for a place to start playing I can live with that. I can see a need for initial isolation of the Docker test station until learning more about how Docker Hub secures itself… and eventually I’d want to learn how to create my own images. Clearly a lot more to learn about the infrastructure of Docker, whenever I get started.

What I find appealing about this is the potential to, for example, build an image with the GHCN data loaded into a MySQL database and packaged with a few report and graph generator examples; then gift it to anyone who wants to download it. So for me, actually trying this will come after I’ve got that stuff built, polished, and running.

So there you have it. A quick and easy way to get a Linux image running on a Windows PC (provided it is the right kind / big enough…) without a lot of pain and suffering. I presume there are ways to do the usual “apt-get install” to add software to the image and some way to save it, so the initial small system image ought not be limiting.

For those wanting more, this is a 1 hour “Docker, FROM scratch” of a fast paced presentation at NDC {Sydney}:

Subscribe to feed

Advertisements

About E.M.Smith

A technical managerial sort interested in things from Stonehenge to computer science. My present "hot buttons' are the mythology of Climate Change and ancient metrology; but things change...
This entry was posted in Tech Bits and tagged , , , . Bookmark the permalink.

4 Responses to Have MS Windows, Want Linux? A 5 minute Docker solution

  1. cdquarles says:

    Windows has hosted Linux and itself had a POSIX subsystem for years now. Right now, on Windows, you can host Ubuntu as a system. I have Debian on mine, if I remember correctly. No need for anything else, just Windows 10 Pro and a processor capable of hardware virtualization.

  2. E.M.Smith says:

    Its that “Windows 10 Pro” that puts me off ;-)

    But yes, you can do that as a VM sort of thing. Even before Windows got on the Linux bandwagon, I ran a Linux and a Solaris image in a VM on a Windows 8 system. It’s a little more complicated to do, but not a whole lot. But the VM world is not as light weight as the Docker world. The Solaris I was running was painfully slow. Though it was fun when my boss, who knew I was a Linux / Unix fan and didn’t like Windows, walked by and saw the Solaris desktop on my PC ;-) The “what have you done now?” look was priceless… Especially as it was supposedly a locked down system…

    (Hey, what do you expect from a guy in a Security Group? It was our job to find security issues… just because the desktops were not formally in my project area doesn’t mean I can’t look ;-)

    IIRC, I ran qemu as the VM system, launched via the cmd window and not specifically installed as such into the MS image (which was locked). A minor overlooked issue by MS… Then, with a full root *Nix, I could do all sorts of things that were nominally forbidden by the MS admins ;-)

    The Linux VM was faster, likely because it didn’t need to deal with big-endian to little-endian stuff and was the same instruction set…

    One of the big advantages of Docker is the small size and fast speed of images means you can have many of them, all with isolation, for enhanced security and increased variety of things running. Basically, it’s just easier and lighter.

  3. cdquarles says:

    Personally, if you must run anything Microsoft, get the Pro and/or Enterprise version. It’s much better, security wise and gives you more options, than doing anything in the Home versions. My point is that you don’t have to do anything 3rd party, as such, within Windows Pro to get a *nix (and, I think, vice-versa; but may be wrong, though I am aware of things like WINE). Windows can and does, host it directly. I don’t have to deal with any third party stuff, if I don’t want to; for most of my use cases. I can and do, play with a number of 3rd party VMs, when I feel like it; so I will look at Docker.

  4. Larry Ledwick says:

    One of our sysadmins uses Oracle virtual box (free download) to do the same thing. I will be trying it here at home soon to run a linux image on my daily desk top.

    https://www.virtualbox.org/

    https://www.virtualbox.org/wiki/Downloads
    VirtualBox binaries
    By downloading, you agree to the terms and conditions of the respective license.

    If you’re looking for the latest VirtualBox 5.2 packages, see VirtualBox 5.2 builds. Please also use version 5.2 if you still need support for 32-bit hosts, as this has been discontinued in 6.0. Version 5.2 will remain supported until July 2020.

    VirtualBox 6.0.4 platform packages
    Windows hosts
    OS X hosts
    Linux distributions
    Solaris hosts
    The binaries are released under the terms of the GPL version 2.

Comments are closed.