Skip to content

Instantly share code, notes, and snippets.

@johannespetzold
Last active August 29, 2015 14:03
Show Gist options
  • Save johannespetzold/05b2fc00793a6ec0b0d6 to your computer and use it in GitHub Desktop.
Save johannespetzold/05b2fc00793a6ec0b0d6 to your computer and use it in GitHub Desktop.
boot2docker stop
VBoxManage sharedfolder add boot2docker-vm -name workspace -hostpath $HOME/workspace
boot2docker up
boot2docker ssh "sudo modprobe vboxsf && sudo mkdir -p $HOME/workspace && sudo mount -t vboxsf -o umask=0022,gid=50,uid=1000 workspace $HOME/workspace"
#!/bin/bash -ex
export DOCKER_HOST=tcp://$(boot2docker ip 2>/dev/null):2375
docker build -t my-boot2docker-img .
docker run --rm my-boot2docker-img > boot2docker.iso
FROM boot2docker/boot2docker
RUN apt-get -y install p7zip-full
ENV VBOX_VERSION 4.3.12
# Build VBox guest additions
RUN mkdir -p /vboxguest && \
cd /vboxguest && \
curl -L -o vboxguest.iso http://download.virtualbox.org/virtualbox/${VBOX_VERSION}/VBoxGuestAdditions_${VBOX_VERSION}.iso && \
7z x vboxguest.iso -ir'!VBoxLinuxAdditions.run' && \
sh VBoxLinuxAdditions.run --noexec --target . && \
mkdir x86 && cd x86 && tar xvjf ../VBoxGuestAdditions-x86.tar.bz2 && cd .. && \
mkdir amd64 && cd amd64 && tar xvjf ../VBoxGuestAdditions-amd64.tar.bz2 && cd .. && \
cd amd64/src/vboxguest-${VBOX_VERSION} && KERN_DIR=/linux-kernel/ make && cd ../../.. && \
cp amd64/src/vboxguest-${VBOX_VERSION}/*.ko $ROOTFS/lib/modules/$KERNEL_VERSION-tinycore64 && \
mkdir -p $ROOTFS/sbin && cp x86/lib/VBoxGuestAdditions/mount.vboxsf $ROOTFS/sbin/
RUN depmod -a -b $ROOTFS $KERNEL_VERSION-tinycore64
RUN /make_iso.sh
CMD ["cat", "boot2docker.iso"]
@johannespetzold
Copy link
Author

Hi Luis, sorry for late response, just noticed your comment. I think the problem was that add-share.sh included "/Users/pivotal/workspace" instead of $HOME/workspace, which was the same on my machine but not on yours. I fixed it, so hopefully this will work for you now.

@haren
Copy link

haren commented Sep 10, 2014

Hi @johannespetzold,

I tried to use your scripts but every single time I get this (the container builds correctly):
modprobe: module vboxsf not found in modules.dep
2014/09/10 14:15:17 exit status 1

Have you come across this?

@poy
Copy link

poy commented Oct 7, 2014

Hello @ johannespetzold

I tried to use your scripts but every single time I get this (the container builds correctly):
modprobe: module vboxsf not found in modules.dep
2014/09/10 14:15:17 exit status 1

Have you come across this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment