Installing Docker Toolbox on Windows with Hyper-V Installed

Installing Docker on Windows is a fairly simple and straightforward process. It is very well documented here. However if you have Hyper-V installed as I do, the instructions will not work right out of the box. If you try to start the Docker Quickstart Terminal, you'll get the following error message:

Running pre-create checks...
Error with pre-create check: "Hyper-V is installed. VirtualBox won't boot a 64bits VM when Hyper-V is activated. If it's installed but deactivated, you can use --virtualbox-no-vtx-check to try anyways"
Looks like something went wrong in step ´Checking if machine default exists´

The issue is that when you run the terminal the very first time, the startup script attempts to create the default virtual machine in which the docker containers will run. This step of the process fails if you have Hyper-V installed, even if it is disabled. In my case, I do have it installed but I have a boot option set up to disable it when I am not using it. This post describes how to change the Docker startup script to allow you to create the default virtual machine using the startup script and still keep Hyper-V installed.

Before you start with the installation of Docker, I would suggest disabling Hyper-V. If you don't know how to do this, follow these instructions. Once you have disabled Hyper-V, the first step is to install Docker using the installer for Windows. The installation should run without any issues before you proceed with the next steps.

Once you have installed Docker, we'll modify the startup file to allow it to create the default VM. The file we want to modify is located under C:\Program Files\Docker Toolbox and is called called start.sh. To modify the file you'll have to open the file in an editor running as Administrator. If you don't open an elevated editor, you won't be able to save your changes.

It's now time to edit the file, but before you do so, you may want to save a copy of the original file. Just in case. In your editor, locate the following code snippet:

STEP="Checking if machine $VM exists"
if [ $VMEXISTSCODE -eq 1 ]; then
"${DOCKERMACHINE}" rm -f "${VM}" &> /dev/null || :
rm -rf ~/.docker/machine/machines/"${VM}"
#set proxy variables if they exists
if [ -n ${HTTP
PROXY+x} ]; then
PROXYENV="$PROXYENV --engine-env HTTPPROXY=$HTTPPROXY"
fi
if [ -n ${HTTPSPROXY+x} ]; then
PROXY
ENV="$PROXYENV --engine-env HTTPSPROXY=$HTTPSPROXY"
fi
if [ -n ${NO
PROXY+x} ]; then
PROXYENV="$PROXYENV --engine-env NOPROXY=$NOPROXY"
fi
"${DOCKERMACHINE}" create -d virtualbox $PROXYENV "${VM}"
fi

The second to last line is where the vm is created:

"${DOCKERMACHINE}" create -d virtualbox $PROXYENV "${VM}"

You will need to modify that line and add the --virtualbox-no-vtx-check switch to. The end result is that the line will look like this:

"${DOCKERMACHINE}" create -d virtualbox --virtualbox-no-vtx-check $PROXYENV "${VM}"

Save your changes and now you should be able to run the quickstart terminal without any issues.

安装Docker Toolbox后出现的问题的更多相关文章

  1. WIN7安装Docker Toolbox、制作镜像并发到阿里云

    一.安装Docker Toolbox,并配置国内源加速 WIndows7不支持Hyper-v,所以只能采用Docker Toolbox的方式使用Docker.传送门:http://mirrors.al ...

  2. win7下安装docker toolbox

    我的笔记本是win10系统,上面安装docker非常简单.只要在官网下载然后一路next就可以了.然而办公室的电脑装的是win7,我也懒得给它换win10.没想到,win7下安装docker这么费劲. ...

  3. Window 7 安装Docker toolbox , 启动terminal时遇到的小问题

    参考:http://blog.csdn.net/tina_ttl/article/details/51372604 参考前面网页成功安装后打开terminal,出现下面问题: Looks like s ...

  4. Windows10下的docker安装与入门 (一)使用docker toolbox安装docker

    Docker 是一个开源的应用容器引擎,让开发者可以打包他们的应用以及依赖包到一个可移植的容器中,然后发布到任何流行的 Linux 机器上,也可以实现虚拟化.容器是完全使用沙箱机制,相互之间不会有任何 ...

  5. Windows10 使用docker toolbox安装docker

    一.介绍 Docker 是一个开源的应用容器引擎,让开发者可以打包他们的应用以及依赖包到一个可移植的容器中,然后发布到任何流行的 Linux 机器上,也可以实现虚拟化.容器是完全使用沙箱机制,相互之间 ...

  6. (转)Windows10下的docker安装与入门 (一)使用docker toolbox安装docker

    Docker 是一个开源的应用容器引擎,让开发者可以打包他们的应用以及依赖包到一个可移植的容器中,然后发布到任何流行的 Linux 机器上,也可以实现虚拟化.容器是完全使用沙箱机制,相互之间不会有任何 ...

  7. docker toolbox在win7下的安装

    1.下载安装docker toolbox docker toolbox的下载地址: http://mirrors.aliyun.com/docker-toolbox/windows/docker-to ...

  8. Docker Toolbox安装

    公司最近搭建docker环境,其中会遇到一些问题,在这里记录一下. 先来了解一下docker 一.基本概念 1.Docker中基本概念镜像(Image) 提到镜像,有对操作系统有一定认知的都知道,镜像 ...

  9. 【学习】在Windows10平台使用Docker ToolBox安装docker(一)

    前言:今天距离元旦还有44天,时间点是18:11:45,想了想一路学习的过程和其中遇到的困难,其中有克服的,有放弃的,这有可能是我自己意志不坚定吧,学习docker也是我当下的一个目标,不知道会是成功 ...

随机推荐

  1. Swift开发第二篇——extension及fatalError

    本篇分两部分: 一.extension在 Swift 中的使用 二.Swift 中的 fatalError 一.extension在 Swift 中的使用 在 swift 中我们可以通过 extens ...

  2. iOS之 C++与oc混编

    声明:本文只是随笔,自己做个笔记方便以后查阅如要转载,注明出处.谢谢! 2016年第一篇随笔!!! 由于最近要搞一个项目用到c++的一些api所以要混编,于是就记录下这个过程中的一些细节上的东西! O ...

  3. 1.9 基础知识——GP2.10 高级别的领导检查(Higher level management)

    GP2.10 Review the activities,status,and results of XXX process with highter level management and res ...

  4. Play Framework 完整实现一个APP(一)

    A blog engine project yabe. 1.创建工程 >play new yabe 设置Application Name: Yet Another Blog Engine. 2. ...

  5. Play Framework安装和配置

    安装环境: jdk 1.7; play 1.3.1; eclipse 安装指南:http://play-framework.herokuapp.com/zh/install 安装Play Framew ...

  6. Java开发人员最常犯的10个错误

    这个列表总结了10个Java开发人员最常犯的错误. Array转ArrayList 当需要把Array转成ArrayList的时候,开发人员经常这样做: List<String> list ...

  7. SQL Server(六)——索引、视图和SQL编程

    1.索引 添加索引,设计界面,在任何一列前右键--索引/键--点击进入添加某一列为索引 2.视图 视图就是我们查询出来的虚拟表 创建视图:create view 视图名 as SQL查询语句,分组,排 ...

  8. spring 事务管理方式及配置

    1.Spring声明式事务配置的五种方式 前段时间对Spring的事务配置做了比较深入的研究,在此之前对Spring的事务配置虽说也配置过,但是一直没有一个清楚的认识.通过这次的学习发觉Spring的 ...

  9. MFC MDI 获取当前视图

    ==================================声明================================== 本文原创,转载在正文中显要的注明作者和出处,并保证文章的完 ...

  10. [整]SQL执行顺序

    SQL的执行顺序: 第一步:FROM <left_table> <join_type> JOIN <right_table> ON <on_predicate ...