问题
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
回答1:
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.
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)
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>
.
来源:https://stackoverflow.com/questions/29507481/boot2docker-vm-forgets-changes-when-restarted