Wednesday, June 17, 2015

Docker Installation on Windows - Failed to Open a Session for the Virtual Machine Boot2Docker-vm - [Resolved]

Last weekend I installed Docker on my Windows 8.1 machine. The installation process was simple but as I went for testing it if everything is working fine, I encountered the following error.

As I double clicked Boot2Docker Start shortcut icon on desktop it opened the following Unix shell only for a moment and disappeared without any alert or clue. Something was wrong somewhere - no idea what was that.


I verified the  PATH in system environment variables whether it has the following entries:
  1. C:\Program Files (x86)\Git\bin;
  2. C:\Program Files\Boot2Docker for Windows 
Yes, they were there and the .sh extension was rightly mapped to the sh.exe in the Default Programs,  and still this Boot2Docker thing was not working! The Docker installation has also installed Oracle VM VirtualBox. I doubled clicked on that shortcut icon with an intention to explore it. It showed an error dialog box with the following message:
  • Failed to Open a Session for the Virtual Machine Boot2Docker-vm. Refer the following image for details: [In case of any of the below images -> Click to see a bigger image]
Docker Issue - Failed to Open a Session for the Virtual Machine Boot2Docker-vm
The above screenshot indeed has the required clue for why the Boot2Docker shortcut was not working. The virtual machine was not starting because virtual technology was NOT ENABLED in the BIOS.

Note as per the Docker installation prerequisite - Docker has been tested on Windows 7.1 and 8; it may also run on older versions. Your processor needs to support hardware virtualization.

If you're curious, you can find my machine configuration here in the following image:

System Information - Docker Installation


Enable Virtual Technology in BIOS

1. Enter in your machine BIOS settings. In my machine I found the virtual technology in Configuration section as seen in the following image inside the red colored rectangle.

Enable Virtualization in BIOS

2. Enable it by pressing F9 key. Press F10 to Save and Exit. 

Enable Virtualization - BIOS

3. Reboot the machine and double click the Boot2Docker shortcut. Now it should successfully start the Docker Daemon and VM. 

I typed the following command to test the installation:
  • docker run hello-world 
The output was as expected, a perfect hello from docker as seen in the following image.

Here's an important but optional info as far as this article is concerned.

"The Docker Engine uses Linux-specific kernel features, so to run it on Windows we need to use a lightweight virtual machine (VM). Although you will be using Windows Docker client, the docker engine hosting the containers will still be running on Linux. Until the Docker engine for Windows is developed, you can launch only Linux containers from your Windows machine". [source]

Here's another thread you may need to refer if your issue is still not fixed.

No comments:

Post a Comment