簡體   English   中英

docker-machine-無法成功創建docker機器:創建機器時出錯

[英]docker-machine - cant successfully create docker machine: Error creating machine

我遵循了Docker入門教程,並到達了第4部分,您需要使用virtualbox( https://docs.docker.com/get-started/part4/#create-a-cluster )創建Docker計算機。創建它,它將失敗。

首先,我將5.0 virtualbox與docker一起使用。 每次我嘗試創建VM時,這都會導致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界面運行“創建的” 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 ,我下載了此virtualbox: https://download.virtualbox.org/virtualbox/5.2.6/virtualbox-5.2_5.2.6-120293~Ubuntu~xenial_amd64.deb : https://download.virtualbox.org/virtualbox/5.2.6/virtualbox-5.2_5.2.6-120293~Ubuntu~xenial_amd64.deb

PS如果很重要,我正在PC上運行的操作系統不在虛擬機內。

當我安裝virtualbox 5.2時,virtualbox 5.0似乎有一些剩余物。 因此,這引起了提到的問題。

因此,對於遇到類似問題的任何人,當一個版本意外掛起您的PC,而另一個版本卡在舊版本的剩余文件中時,您可以嘗試執行此操作(它對我有所幫助。它似乎與舊版Linux頭文件不了解有關新的virtualbox?):

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

然后應該解決不匹配的版本錯誤。

PS雖然請注意,如果您已經嘗試使用docker-machine創建VM(然后將其刪除)。 創建新的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時,它將重新生成新的證書,並且不再會出現此錯誤。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM