boot2docker vm 在重新启动时忘记更改

boot2docker vm forgets changes when restarted

基本上,我在通过 SSH 连接到 VM 时所做的任何更改都会在 VM 重新启动时丢失。我假设问题与我停止 VM 时的错误有关。

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

但是,我可能只是在做一些蠢事。

我遵循的顺序如下(docker 徽标已删除),您可以看到它在重新启动时丢失了示例目录。

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:~$

运行

这就是我在“Windows Boot2Docker behind corporate proxy": there is no persistence in the Tiny Core 被 boot2docker 用作 Linux 虚拟机。

You need to make sure the VirtualBox has the Oracle_VM_VirtualBox_Extension_Pack downloaded and added in the Virtual Box / File / Settings / Extension / add the Oracle_VM_VirtualBox_Extension_Pack-4.x.yy-zzzzz.vbox-extpack file).

As documented in boot2docker, you will have access (from your Tiny Core ssh session) to /c/Users/<yourLogin> (ie the %USERPROFILE% is shared by Virtual Box)

我在 b2d.bat 启动脚本中所做的是复制我想要恢复的文件(主要是 docker profile.ashrc,对于 http_proxy 设置和最喜欢的别名),并在 /c/Users/<yourLogin>.

中保留我的所有其他修改