Linux on Windows 10 via Docker

Wanting to run Linux command line under windows usually brings you to one of two options:

  1. Install WSL (Windows Subsystem for Linux) – the main advantage here is performance optimizations made by Microsoft to take the most advantage of the hardware and OS infrastructure.
  2. Install Docker for Windows 10 and then create a Linux container which you can run and get the command line prompt from

There are other options such as running a full graphical virtual machine like VirtualBox, VMWare and the like, but our focus will be getting a quick Linux command line prompt from Windows.

My personal preference is using option 2, mainly due to it being easy to install and the ability to easily create multiple sandboxed instances and easily use them for different purposes.

The following describes how to install the latest Ubuntu version and run it as a docker container.

  1. If you haven’t already done so, install Docker for Windows
  2. open a command prompt and type:
    docker pull ubuntu
  3. next, type:
    docker images
    copy the image id of the repository named ubuntu
  4. suppose the image id of the repository you copied was f6a191f19b5f, type:
    docker run -it --name=ubuntu-container f6a191f19b5f /bin/sh
  5. that’s it, you have the root prompt on the latest Ubuntu running on your Windows system!
  6. After you exit the ubuntu container, you can always enter it again by typing from the command prompt:
    docker start -i ubuntu-container

Leave a Reply

Your email address will not be published. Required fields are marked *