I'm starting to play with docker on my PC (windows 7) so I'm using Boot2Docker, but when I stop the VM all my work are remove. My questions are:
Why ?
How to solve this problems ?
finally I resolve my problem:
Solution I've made a boot2docker delete and then a boot2docker init, when I start/stop the VM it works correctly (and it starts faster
Why : I don't know, the only possible reason is that I install boot2docker ant activate the VT-x in the BIOS after
Related
I know this is not what docker containers should be used for, but hear me out. I'm trying to port over a local environment that is currently run on Windows 10 with Chef, Vagrant & Virtualbox.
I believe it is possible to do this in Ubuntu by installing Virtualbox on the host, then mounting the /dev/vboxdrv directory into the container. While there is a vboxdrv directory for the Windows installation C:\Program Files\Oracle\VirtualBox\drivers\vboxdrv, it won't work for a Linux-based container.
Is it possible to get Virtualbox running inside of a Docker container while on a Windows host? I doubt it, but thought I'd ask to confirm in case I had missed some nice workaround.
OK so here is what I have done so far. I installed docker for mac, and that worked fine. From there I tried to get a project up and running using docker-compose and I got the following error:
Could not read CA certificate "/Users/<useraccountfolder>/.boot2docker/certs/boot2docker-vm/ca.pem": open /Users/<useraccountfolder>/.boot2docker/certs/boot2docker-vm/ca.pem: no such file or directory
So I tried to fix it by trying this accepted answer. This is when I got another error, Host does not exist: “default”. This is when I trie this accepted answer, but when I tried to run docker-machine create default, I got this error: Error with pre-create check: "VBoxManage not found. Make sure VirtualBox is installed and VBoxManage is in the path". I am just lost at this point. Any help?
To use docker machine you need the latest version of VirtualBox, from the docker docs:
IF YOU ARE USING DOCKER FOR MAC
Docker for Mac uses HyperKit, a lightweight macOS virtualization solution built on top of the Hypervisor.framework in macOS 10.10 Yosemite and higher.
Currently, there is no docker-machine create driver for HyperKit, so you will use virtualbox driver to create local machines. (See the Docker Machine driver for Oracle VirtualBox.) Note that you can run both HyperKit and Oracle VirtualBox on the same system. To learn more, see Docker for Mac vs. Docker Toolbox.
Make sure you have the latest VirtualBox correctly installed on your system (either as part of an earlier Toolbox install, or manual install).
Source: https://docs.docker.com/machine/get-started/#prerequisite-information
OK so I found a solution which is probably not fixing the root issue, but it does work. To unset previous variables I ran this command unset ${!DOCKER*}. This worked, but then I had to run it every time I started a new terminal session, so I added it to my .bash_profile and now I am good.
I'm using Vagrant with the VMWare plugin. I've noticed that VMs upped using Vagrant are not displayed automatically in the VMWare Workstation GUI.
I can (manually) open them using File->Open... and selecting the .vagrant\machines\puppet\vmware_workstation\some-unique-id...vmx file. But that's a bit annoying. Using VirtualBox, vagrant VMs are automatically added and removed from the Virtualbox GUI.
Am I missing something or is that just not supported for VMWare boxes?
Reaons why I'm not just sticking with vagrant commands:
To quickly see which machines are running (I have multiple machine setups and yes, I know vagrant status does the same...)
To create and restore snapshots (I have a time consuming provisioning and sometimes it's nice to just restore to a snapshot while testing)
I didn't get #mmey's exact solution to work, but putting this in the Vagrantfile worked for me:
config.vm.provider "vmware_fusion" do |v|
v.gui = true
end
Documentation
I don't think there's much to do about #1, it looks like VMWare limitation.
However you can use this Vagrant plugin to add snapshot ability from the command line.
I found the (not so surprising) answer to my question: Just disable headless mode by setting config.vm.provider.gui=true in the Vagrantfile (as described at https://docs.vagrantup.com/v2/vmware/configuration.html).
I'm in boot2docker. I'm not entirely sure I understand it completely, but it seems to be needed for a project I'm on.
I've ssh'd in, and I tried to do a make on our project, but I got
make: not found
Then I tried a:
apt-get install make
And got
apt-get: not found
Tried googling, but couldn't find anything about that, or any package manager.
Any suggestions on how to install anything in boot2docker?
EDIT:
When I asked this I misunderstood how boot2docker and docker worked hand in hand. There is actually a package manager (tce-load) that allows install of packages, but really, it shouldn't be used and anything involving a project using docker should be using a docker container within boot2docker that has the build tools inside of that. Although I did find tce-load useful installing nano, since I'm not a fan of vi and that's occationaly useful.
Seems boot2docker uses Tiny Linux which has its own package manager called "tce-load". There's a list of packages for it here:
http://distro.ibiblio.org/tinycorelinux/tcz_2x.html
There's everything that's needed to make or whatever located there.
You should not be installing anything on the boot2docker vm as that gets deleted and reset often. You should install any tools inside a docker container running on the boot2docker vm.
Only linux can run docker so when running on osx or windows you must use boot2docker. boot2docker is just running a linux vm that has docker installed. Once you are using boot2docker you use docker like you would normally.
The boot2docker vm is not where you should be installing things, what you should be doing is running a container that has the programs you need installed. This can be accomplished by finding a useful image from the docker registry or by making your own docker image.
I've installed docker and followed the directions here: https://docs.docker.com/installation/windows/#installation but when I run boot2docker start this happens:
Trying to get IP one more time
exit status 255
Docker client does not run on Windows for now. Please use
"boot2docker" ssh
to SSH into the VM instead
Trying boot2docker ssh results in the same 255 error. I tried to get the VM IP with boot2docker IP but that also yielded nothing - I presume because boot2locker wasn't successful in the start process.
A couple of observations...I lloked at the vm settings and there wasn't any network or storage settings specified and the memory allocation in the vm settings didn't match the values in the config (boot2docker config). The boot2docker start/stop commands work.
I'm stumped.
I observed similar issue. Following steps helped me:
Open VirtualBox GUI.
Remove boot2docker-vm virtual machine.
Start Boot2Docker Start --- it will recreate boot2docker-vm virtual machine.
We had exactly this on someone's machine.
The solution for us was to find the
Run the VirtualBox UI (C:\program files\oracle....)
locate the VM (at the top)
select 'power off'
Once all that was done, boot2docker started correctly again.
In extremis, you could delete the boot2docker-vm image out of virtualbox, and it ought to re-install it.
go to the Oracle VM VirtualBox Manager, power off boot2docker-vm and start again. It worked for me.
just in case it helps. My problem was because boot2docker's default settings is beyond my laptop's capability (I know). I fixed the problem by changing the properties of boot2docker-vm through the VirtualBox GUI. Soon as I open thr properties I saw a few warnings at the bottom of the dialogue box, so I followed the hint and resolve those warnings, save the setttings and was able to start docker then.
I changed the CPU from 4->1, memory from 2G to 1.5G and video memory to 20M. Hope it helps.
Mostly you didn't enable the "Virtualization" in your BIOS. boot2docker needs to install 64bit OS in Virtualbox.
Its worth noting I had some huge problems trying to run docker on windows. Boot2docker would install OK with VritualBox 4.3.20. I could NOT run boot2docker or docker itself.
It took me ages to figure out that I had uninstall VirtualBox 4.3.20 and use 4.3.12 instead which worked first time like a treat!
So.. for Windows boot2docker only use VirtualBox 4.3.12.