docker-machine error to create default machine

核能气质少年 提交于 2019-12-08 03:16:51

问题


I'm trying to use docker-machine and virtualbox inside a container.

The host: Ubuntu 16.04

I installed in the host

sudo apt-get install linux-headers-generic virtualbox-dkms

The Dockerfile definition

FROM ubuntu:16.04
RUN apt-get update && apt-get install -y \
ca-certificates \
curl \
software-properties-common \
--no-install-recommends \
build-essential && \
curl -sSL https://www.virtualbox.org/download/oracle_vbox_2016.asc | apt-key add - && \
echo "deb http://download.virtualbox.org/virtualbox/debian xenial contrib" >> /etc/apt/sources.list.d/virtualbox.list && \
apt-get update && \
apt-get install -y \
virtualbox-5.0 \
&& rm -rf /var/lib/apt/lists/*

Builded the image container

docker build -t myVirtualbox .

I started the container using

docker run -it -v /dev/vboxdrv:/dev/vboxdrv --privileged=true myVirtualbox bash

Inside the container I downloaded the docker-machine

curl -L https://github.com/docker/machine/releases/download/v0.7.0/docker-machine-`uname -s`-`uname -m` -o docker-machine && chmod +x docker-machine

Then I ran

./docker-machine create --driver=virtualbox default

This is the error

(default) Starting the VM...
(default) Check network to re-create if needed...
Error creating machine: Error in driver during machine creation: Error setting up host only network on machine start: The host-only  adapter we just created is not visible. This is a well known VirtualBox  bug. You might want to uninstall it and reinstall at least version 5.0.12  that is is supposed to fix this issue
The default lines below are for a sh/bash shell, you can specify the  shell you're using, with the --shell flag.

In the container I have the virtualBox version 5.0.26r108824

来源:https://stackoverflow.com/questions/38620060/docker-machine-error-to-create-default-machine

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!