-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathmk_virtualbox_image
executable file
·40 lines (31 loc) · 1.17 KB
/
mk_virtualbox_image
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
# Ensure git\VBoxManage is installed
# Get latest vmdebootstrap code
# Get latest python-cliapp code
# Run vmdebootstrap script to create image
# Convert image to vdi hard drive
# don't tolerate errors.
set -e
basedir=`pwd`
IMAGE=$1
# Get latest vmdebootstrap code
rm -rf vmdebootstrap
git clone git://gitorious.org/~nickdaly/vmdebootstrap/nickdalys-vmdebootstrap.git vmdebootstrap
# Run vmdebootstrap script to create image
sudo ./vmdebootstrap/vmdebootstrap \
--log freedombox.log --log-level debug \
--image $IMAGE.img --hostname freedombox --size 2G --verbose --enable-dhcp \
--package ssh --package apache2 --package git --package mercurial \
--package build-essential --package checkinstall \
--package python-simplejson \
--mirror http://ftp.uk.debian.org/debian/ --package pandoc \
--package python-cheetah --package python-argparse \
--customize=$basedir/freedombox-customize --root-password=freedom \
--arch=i386 --distribution=wheezy
# Convert image to vdi hard drive
VBoxManage convertdd $IMAGE.img $IMAGE.vdi
# Clean up
rm -rf vmdebootstrap
#mkdir testing
#sudo mount -o loop,offset=1048576 freedombox.img testing/
#sudo umount testing/