gpt4 book ai didi

docker-machine - 无法成功创建 docker 机器 : Error creating machine

转载 作者:行者123 更新时间:2023-12-02 20:47:45 30 4
gpt4 key购买 nike

我遵循 docker 入门教程并到达第 4 部分,您需要使用 virtualbox ( https://docs.docker.com/get-started/part4/#create-a-cluster ) 创建 docker 机器,但当我尝试创建它时,它失败了。

首先,我使用 5.0 virtualbox 和 docker。这导致我每次尝试创建虚拟机时 Ubuntu 桌面都会卡住。我必须重新启动PC才能使其工作。然后我安装了新版本的virtualbox:Version 5.2.6 r120293 (Qt5.6.1) .

现在尝试使用docker创建VM时,PC不会卡住,但仍然无法成功创建VM。

运行此命令:

docker-machine create --driver virtualbox myvm1

我得到这个输出:
Running pre-create checks...
Creating machine...
(myvm1) Copying /home/oerp/.docker/machine/cache/boot2docker.iso to /home/oerp/.docker/machine/machines/myvm1/boot2docker.iso...
(myvm1) Creating VirtualBox VM...
(myvm1) Creating SSH key...
(myvm1) Starting the VM...
(myvm1) Check network to re-create if needed...
Error creating machine: Error in driver during machine creation: Unable to start the VM: /usr/bin/VBoxManage startvm myvm1 --type headless failed:
VBoxManage: error: The virtual machine 'myvm1' has terminated unexpectedly during startup with exit code 1 (0x1)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component MachineWrap, interface IMachine

现在打开 virtualbox 并尝试通过 virtualbox 接口(interface)运行“创建”的 VM 也失败了。它说:
RTR3InitEx failed with rc=-1912 (rc=-1912)

The VirtualBox kernel modules do not match this version of VirtualBox. The installation of VirtualBox was apparently not successful. Executing

'/sbin/vboxconfig'

may correct this. Make sure that you do not mix the OSE version and the PUEL version of VirtualBox.

where: supR3HardenedMainInitRuntime what: 4 VERR_VM_DRIVER_VERSION_MISMATCH (-1912) - The installed support driver doesn't match the version of the user.

运行 sudo /sbin/vboxvonfig也无济于事。该错误是否表明我为我的操作系统安装了不正确的 virtualbox?还是有别的意思?

我的操作系统是 Ubuntu 16.04我下载了这个虚拟机: https://download.virtualbox.org/virtualbox/5.2.6/virtualbox-5.2_5.2.6-120293~Ubuntu~xenial_amd64.deb
附言如果重要的话,我正在运行的操作系统(在我的 PC 中)不在虚拟机中。

最佳答案

当我安装 virtualbox 5.2 时,virtualbox 5.0 似乎有一些剩菜。所以这引起了提到的问题。

因此,对于在一个版本意外挂起您的 PC 并且另一个版本与旧版本遗留物混合时遇到类似问题的任何人,您可以尝试这样做(它帮助了我。看起来它与不知道的旧 linux 头文件有关新的虚拟机?):

sudo apt-get purge virtualbox-*.* dkms linux-headers-$(uname -r)  # (where * is specified version)
sudo apt-get install linux-headers-$(uname -r)
sudo apt-get install virtualbox-*.*

发现于: https://askubuntu.com/questions/205154/virtualbox-etc-init-d-vboxdrv-setup-issue

然后它应该解决不匹配的版本错误。

附言
但请注意,如果您已经尝试使用 docker-machine 创建 VM(然后将其删除)。创建新虚拟机时,它可能会给您另一个错误。它与证书有关。

对我来说,证书完好无损,即使我删除了不工作的虚拟机。它可能正在检查旧证书,因为我使用的是相同的虚拟机名称?

所以它给了我这个新错误:
Copying certs to the local machine directory...
Error creating machine: Error running provisioning: error generating server cert: tls: failed to find any PEM data in certificate input

要解决它,您可以删除 /home/user/.docker/machine/certs目录。之后,当您启动新 VM 时,它将重新生成新证书,并且不应再引发此错误。

关于docker-machine - 无法成功创建 docker 机器 : Error creating machine,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48840983/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com