安装Docker Toolbox后出现的问题

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 ${HTTPPROXY+x} ]; then
    PROXYENV="$PROXYENV --engine-env HTTPPROXY=$HTTPPROXY"
  fi
  if [ -n ${HTTPSPROXY+x} ]; then
    PROXYENV="$PROXYENV --engine-env HTTPSPROXY=$HTTPSPROXY"
  fi
  if [ -n ${NOPROXY+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.

时间: 2024-10-06 03:57:18

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

在windows7上安装docker toolbox

docker toolbox是一个docker组件的集合,还包括一个极小的虚拟机,在windows宿主机上安装了一个支持命令行工具,并提供了一个docker环境 docker toolbox自带了很多组件,包括: virtualbox; docker客户端: docker compose: Kitematic,一个docker和docker hub的GUI客户端: docker machine,用于帮助用户创建docker主机 docker toolbox下载地址:https://github.

Docker——Windows7下使用docker toolbox

一.安装 官方网址:https://docs.docker.com/docker-for-windows/install/ 本文的基础环境是Windows7,所以安装Docker Toolbox(docker的一个工具集):官方建议是安装完成后重启一下电脑便于开启Microsoft Hyper-V,Windows10可以在任务管理器看到虚拟化已启用的字样. Kitematic. 这是Docker的GUI版本Docker QuickStart shell. 这是一个已经配置好Docker的命令行环

在Windows上玩TensorFlow(一)——安装Docker【转】

"谷歌"+"深度学习",两个标签让2015年12月才由谷歌开源的深度学习工具TensorFlow在其发布之后就迅速地成为了全球最为炙手可热的开源项目,2016年4月,开源的TensorFlow又支持了分布式特性,向着生产环境下的应用更进一步. TensorFlow API支持Python 2.7和Python 3.3+,共支持4种安装方式. Pip install Virtualenv install Anaconda install Docker install

Windows下安装Docker

Windows用户可以使用Docker Toolbox安装Docker软件.Docker Toolbox包含如下Docker工具: Docker CLI 客户端:创建image和container的Docker引擎 Docker Machine:支持在Windows终端执行Docker Engine命令 Docker Compose:支持docker-compose命令 Kitematic:Docker GUI Docker QuickStart shell preconfigured for

在Windows中玩转Docker Toolbox

最近在研究虚拟化,容器和大数据,所以从Docker入手,下面介绍一下在Windows下怎么玩转Docker. Docker本身在Windows下有两个软件,一个就是Docker,另一个是Docker Toolbox.这里我选择的是Docker Toolbox,为什么呢?参见官方文档: https://blog.docker.com/2015/08/docker-toolbox/ 首先我们从官网下载最新版的Windows Docker Toolbox.安装后会安装一个VirtualBox虚拟机,一

Docker学习系列(一):windows下安装docker

本文目录如下: windows按照docker的基本要求 具体安装步骤 开始使用 安装远程连接工具连接docker 安装中遇到的问题 Docker的更新 Docker中的jupyter windows下使用docker的常用命令 windows下安装docker的方法应该参考docker官网,之前参考的是网上其他人翻译的博客,出了一些问题,后来发现,是由于docker更新速度较快,安装官网的方法最为妥当! 下面引用Docker 中文指南中的几个提示: 提示1:Docker 已经在windows7

在Windows中玩转Docker Toolbox【转载】

最近在研究虚拟化,容器和大数据,所以从Docker入手,下面介绍一下在Windows下怎么玩转Docker.Docker本身在Windows下有两个软件,一个就是Docker,另一个是Docker Toolbox.这里我选择的是Docker Toolbox,为什么呢?参见官方文档:https://blog.docker.com/2015/08/docker-toolbox/首先我们从官网下载最新版的Windows Docker Toolbox.安装后会安装一个VirtualBox虚拟机,一个Ki

Docker的学习(一)Windows下安装docker环境以及基础的配置

Docker是什么我这里就不多做介绍了,相信大家都清楚,网上有很多介绍的文章所以作为菜鸟的我就不用我的眼光以及理解来为大家介绍了,还是那句话,这篇文章主要是用作记录学习过程,希望不会误导新人,也希望各位大神看到后可以点评一下不足的地方. 本次操作系统为win10,在Windows下Docker的安装方式有2种(对于Windows10的用户),一种是使用Docker for Windows这种方式只能在Win10使用(部分Win10用户也是不可以的,好比我“学习版系统”),这种方式从安装到配置都比

win10家庭版安装docker

在win10家庭版中安装docker 1.安装 由于win10家庭版不支持Docker for Windows,所以选择安装docker toolbox,可以到阿里镜像源下载安装:http://mirrors.aliyun.com/docker-toolbox/windows/docker-toolbox/ 下载完毕后直接安装即可 可以选择是否需要安装的组件,安装好后桌面有新增下列三个图标: 2.初始化 点击Docker Quickstart Terminal进行初始化,这时会自动下载并启动一个