Skip to content

Instantly share code, notes, and snippets.

@tpett
Created September 12, 2014 20:34
Show Gist options
  • Save tpett/2badbda8e3d7d44ec38b to your computer and use it in GitHub Desktop.
Save tpett/2badbda8e3d7d44ec38b to your computer and use it in GitHub Desktop.
Setup boot2docker with host additions for VirtualBox
# I had to piece together tips from several websites to get this to work so I've pulled
# everything into one place.
# Prereqs:
# Install docker
# Install boot2docker
cd ~/.boot2docker
mv boot2docker.iso boot2docker.iso.bak
# Check for the latest version:
# https://medium.com/boot2docker-lightweight-linux-for-docker/boot2docker-together-with-virtualbox-guest-additions-da1e3ab2465c
curl http://static.dockerfiles.io/boot2docker-v1.2.0-virtualbox-guest-additions-v4.3.14.iso > boot2docker.iso
boot2docker init
# Setup Virtualbox to share the home folder
# http://www.snip2code.com/Snippet/74401/Setting-up-boot2docker-for-use-with-fig
VBoxManage sharedfolder add boot2docker-vm -name home -hostpath /Users
boot2docker up
# Mount the shared path
# https://coderwall.com/p/fvfjyg
boot2docker ssh "sudo modprobe vboxsf && mkdir -v -p /Users && sudo mount -v -t vboxsf -o uid=0,gid=0 home /Users"
# Test it:
boot2docker ssh "ls /Users"
# You should see your system's users listed out.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment