Skip to content

Instantly share code, notes, and snippets.

@ochinchina
Created September 26, 2014 01:57
Show Gist options
  • Save ochinchina/4644d373c686d7ac0f16 to your computer and use it in GitHub Desktop.
Save ochinchina/4644d373c686d7ac0f16 to your computer and use it in GitHub Desktop.
install boot2docker to harddisk in the virtualbox
1, create a virtual machine from the virtualbox with VDI harddisk
2, add a virtual CDROM to the virtual machine and select boot2docker.iso ( the boot2docker.iso should be downloaded before)
3, start the virtual machine
4, write the boot2docker.iso image to the virtual harddisk using dd command
# dd if=/dev/cdrom of=/dev/sda
5, shutdown the virtual machine
6, remove the virtual CDROM
7, restart the virtual machine
8, use fdisk to create second partition from the VDI harddisk
# fdisk /dev/sda
select "n" to create second primary partition table from the sda and save the change
9, format the second partition using following command:
#mkfs.ext4 -L boot2docker-data /dev/sda2
10, reboot the boot2docker, now the second partition will be mounted to /mnt/sda2/var/lib/docker/aufs and then softlink to /var/lib/docker
all the docker image will be put under /var/lib/docker directory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment