本文介绍了boot2docker vm在重新启动时忘记更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基本上,在重新启动虚拟机时,我进入虚拟机时所做的任何更改都将丢失。我假设问题与我停止虚拟机时的错误有关。

  C:\Users\Tom> boot2docker在运行中停止
错误:无法停止机器boot2docker-vm:退出状态1

但是,我可能只是做一些愚蠢的事情。



我遵循的顺序如下(停靠点标志消失),您可以看到它在重新启动时丢失了示例目录。

  C:\Users\Tom> boot2docker up 

等待VM和Docker守护程序开始....................... ooo
开始。
写入C:\Users\Tom\.boot2docker\certs\boot2docker-vm\ca.pem
写入C:\Users\Tom\.boot2docker\certs \boot2docker-vm\cert.pem
写入C:\Users\Tom\.boot2docker\certs\boot2docker-vm\key.pem
Docker客户端不运行现在Windows请使用
boot2dockerssh
将SSH注册到VM中。


C:\Users\Tom> boot2docker ssh
Boot2Docker版本1.5.0,构建主机:a66bce5 - Tue Feb 10 23:31:27 UTC 2015
Docker版本1.5.0,构建a8a31ef
docker @ boot2docker:〜$ ls
boot2docker,请格式化
docker @ boot2docker:〜$ mkdir testdir
docker @ boot2docker :〜$ ls
boot2docker,请格式化testdir /
docker @ boot2docker:〜$ exit

C:\Users\Tom> boot2docker stop
运行错误:无法停止机器boot2docker-vm:退出状态1

C:\Users\Tom> boot2docker状态
poweroff

C :\Users\Tom> boot2docker start
等待VM和Docker守护进程启动...
.................... ooo
开始。
写入C:\Users\Tom\.boot2docker\certs\boot2docker-vm\ca.pem
写入C:\Users\Tom\.boot2docker\certs \boot2docker-vm\cert.pem
写入C:\Users\Tom\.boot2docker\certs\boot2docker-vm\key.pem
Docker客户端不运行现在Windows请使用
boot2dockerssh
将SSH注册到VM中。


C:\Users\Tom> boot2docker ssh
Boot2Docker版本1.5.0,构建主机:a66bce5 - Tue Feb 10 23:31:27 UTC 2015
Docker版本1.5.0,构建a8a31ef
docker @ boot2docker:〜$ ls
boot2docker,请格式化
docker @ boot2docker:〜$

运行




  • Windows:8.1

  • VirtualBox:4.3.12 r93733

  • Boot2Docker版本1.5.0,build master:a66bce5 - Tue Feb 10 23:31:27 UTC 2015

  • Docker版本1.5.0,构建a8a31ef


解决方案

我在 由boot2docker用作Linux VM。

我在启动脚本是复制要恢复的文件(主要是docker profile .ashrc ,用于http_proxy设置和最喜欢的别名),并将所有其他修改保留在 / c / Users /< yourLogin>


Basically any changes I make while SSHed into the VM are lost at restart of the VM. I am assuming the problem is associated with the error when I stop the VM.

C:\Users\Tom>boot2docker stop
error in run: Failed to stop machine "boot2docker-vm": exit status 1

But, I may just be doing something dumb.

The sequence I followed is below (docker logo elided), you can see it losing the sample directory across the restart.

C:\Users\Tom>boot2docker up

Waiting for VM and Docker daemon to start.......................ooo
Started.
Writing C:\Users\Tom\.boot2docker\certs\boot2docker-vm\ca.pem
Writing C:\Users\Tom\.boot2docker\certs\boot2docker-vm\cert.pem
Writing C:\Users\Tom\.boot2docker\certs\boot2docker-vm\key.pem
Docker client does not run on Windows for now. Please use
    "boot2docker" ssh
to SSH into the VM instead.


C:\Users\Tom>boot2docker ssh
Boot2Docker version 1.5.0, build master : a66bce5 - Tue Feb 10 23:31:27 UTC 2015
Docker version 1.5.0, build a8a31ef
docker@boot2docker:~$ ls
boot2docker, please format-me
docker@boot2docker:~$ mkdir testdir
docker@boot2docker:~$ ls
boot2docker, please format-me  testdir/
docker@boot2docker:~$ exit

C:\Users\Tom>boot2docker stop
error in run: Failed to stop machine "boot2docker-vm": exit status 1

C:\Users\Tom>boot2docker status
poweroff

C:\Users\Tom>boot2docker start
Waiting for VM and Docker daemon to start...
....................ooo
Started.
Writing C:\Users\Tom\.boot2docker\certs\boot2docker-vm\ca.pem
Writing C:\Users\Tom\.boot2docker\certs\boot2docker-vm\cert.pem
Writing C:\Users\Tom\.boot2docker\certs\boot2docker-vm\key.pem
Docker client does not run on Windows for now. Please use
    "boot2docker" ssh
to SSH into the VM instead.


C:\Users\Tom>boot2docker ssh
Boot2Docker version 1.5.0, build master : a66bce5 - Tue Feb 10 23:31:27 UTC 2015
Docker version 1.5.0, build a8a31ef
docker@boot2docker:~$ ls
boot2docker, please format-me
docker@boot2docker:~$

Running

  • Windows: 8.1
  • VirtualBox: 4.3.12 r93733
  • Boot2Docker version 1.5.0, build master : a66bce5 - Tue Feb 10 23:31:27 UTC 2015
  • Docker version 1.5.0, build a8a31ef

解决方案

That is what I explained in "Windows Boot2Docker behind corporate proxy": there is no persistence in the Tiny Core used by boot2docker as a Linux VM.

What I do in my b2d.bat start script is copy the files I want to be restored (mainly docker profile or .ashrc, for http_proxy settings and favorite aliases), and keep all my other modifications in /c/Users/<yourLogin>.

这篇关于boot2docker vm在重新启动时忘记更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-28 19:58