vbox 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (131) hide show
  1. data/.gitignore +14 -0
  2. data/Gemfile +5 -0
  3. data/Gemfile.lock +68 -0
  4. data/README.md +5 -0
  5. data/Rakefile +91 -0
  6. data/bin/vbox +73 -0
  7. data/lib/java/README.txt +5 -0
  8. data/lib/java/dir2floppy.jar +0 -0
  9. data/lib/java/dir2floppy.java +134 -0
  10. data/lib/vagrant_init.rb +6 -0
  11. data/lib/vbox.rb +2 -0
  12. data/lib/vbox/command.rb +82 -0
  13. data/lib/vbox/config.rb +5 -0
  14. data/lib/vbox/export.rb +65 -0
  15. data/lib/vbox/scancode.rb +208 -0
  16. data/lib/vbox/session.rb +893 -0
  17. data/lib/vbox/shell.rb +54 -0
  18. data/lib/vbox/ssh.rb +193 -0
  19. data/lib/vbox/transaction.rb +122 -0
  20. data/lib/vbox/utils.rb +26 -0
  21. data/lib/vbox/version.rb +3 -0
  22. data/lib/vbox/web.rb +48 -0
  23. data/templates/CentOS-5.7-i386-netboot/definition.rb +16 -0
  24. data/templates/CentOS-5.7-i386-netboot/ks.cfg +45 -0
  25. data/templates/CentOS-5.7-i386-netboot/postinstall.sh +53 -0
  26. data/templates/CentOS-5.7-x86_64-netboot/definition.rb +16 -0
  27. data/templates/CentOS-5.7-x86_64-netboot/ks.cfg +45 -0
  28. data/templates/CentOS-5.7-x86_64-netboot/postinstall.sh +60 -0
  29. data/templates/CentOS-6.0-i386-netboot/definition.rb +16 -0
  30. data/templates/CentOS-6.0-i386-netboot/ks.cfg +52 -0
  31. data/templates/CentOS-6.0-i386-netboot/postinstall.sh +30 -0
  32. data/templates/CentOS-6.0-i386/definition.rb +17 -0
  33. data/templates/CentOS-6.0-i386/ks.cfg +47 -0
  34. data/templates/CentOS-6.0-i386/postinstall.sh +48 -0
  35. data/templates/CentOS-6.0-x86_64-netboot/definition.rb +16 -0
  36. data/templates/CentOS-6.0-x86_64-netboot/ks.cfg +52 -0
  37. data/templates/CentOS-6.0-x86_64-netboot/postinstall.sh +30 -0
  38. data/templates/CentOS-6.0-x86_64/definition.rb +17 -0
  39. data/templates/CentOS-6.0-x86_64/ks.cfg +47 -0
  40. data/templates/CentOS-6.0-x86_64/postinstall.sh +48 -0
  41. data/templates/Debian-6.0.3-amd64-netboot/definition.rb +42 -0
  42. data/templates/Debian-6.0.3-amd64-netboot/postinstall.sh +80 -0
  43. data/templates/Debian-6.0.3-amd64-netboot/preseed.cfg +42 -0
  44. data/templates/Debian-6.0.3-i386-netboot/definition.rb +44 -0
  45. data/templates/Debian-6.0.3-i386-netboot/postinstall.sh +80 -0
  46. data/templates/Debian-6.0.3-i386-netboot/preseed.cfg +42 -0
  47. data/templates/Fedora-15-i386-netboot/definition.rb +17 -0
  48. data/templates/Fedora-15-i386-netboot/ks.cfg +82 -0
  49. data/templates/Fedora-15-i386-netboot/postinstall.sh +18 -0
  50. data/templates/Fedora-15-i386/definition.rb +17 -0
  51. data/templates/Fedora-15-i386/ks.cfg +64 -0
  52. data/templates/Fedora-15-i386/postinstall.sh +33 -0
  53. data/templates/Fedora-15-x86_64-netboot/definition.rb +29 -0
  54. data/templates/Fedora-15-x86_64-netboot/ks.cfg +64 -0
  55. data/templates/Fedora-15-x86_64-netboot/postinstall.sh +33 -0
  56. data/templates/Fedora-15-x86_64/definition.rb +17 -0
  57. data/templates/Fedora-15-x86_64/ks.cfg +64 -0
  58. data/templates/Fedora-15-x86_64/postinstall.sh +33 -0
  59. data/templates/Sysrescuecd-2.0.0-experimental/autorun0 +3 -0
  60. data/templates/Sysrescuecd-2.0.0-experimental/definition.rb +20 -0
  61. data/templates/archlinux-i386-netboot/aif.cfg +34 -0
  62. data/templates/archlinux-i386-netboot/definition.rb +29 -0
  63. data/templates/archlinux-i386-netboot/postinstall.sh +87 -0
  64. data/templates/archlinux-i386-netboot/postinstall2.sh +28 -0
  65. data/templates/archlinux-i386/aif.cfg +33 -0
  66. data/templates/archlinux-i386/definition.rb +29 -0
  67. data/templates/archlinux-i386/postinstall.sh +106 -0
  68. data/templates/archlinux-x86_64-netboot/aif.cfg +34 -0
  69. data/templates/archlinux-x86_64-netboot/definition.rb +29 -0
  70. data/templates/archlinux-x86_64-netboot/postinstall.sh +90 -0
  71. data/templates/archlinux-x86_64-netboot/postinstall2.sh +28 -0
  72. data/templates/archlinux-x86_64/aif.cfg +33 -0
  73. data/templates/archlinux-x86_64/definition.rb +29 -0
  74. data/templates/archlinux-x86_64/postinstall.sh +90 -0
  75. data/templates/archlinux-x86_64/postinstall2.sh +38 -0
  76. data/templates/freebsd-8.2-experimental/definition.rb +19 -0
  77. data/templates/freebsd-8.2-experimental/postinstall.sh +191 -0
  78. data/templates/freebsd-8.2-pcbsd-i386-netboot/definition.rb +35 -0
  79. data/templates/freebsd-8.2-pcbsd-i386-netboot/pcinstall.fbg.cfg +58 -0
  80. data/templates/freebsd-8.2-pcbsd-i386-netboot/postinstall.sh +93 -0
  81. data/templates/freebsd-8.2-pcbsd-i386/definition.rb +31 -0
  82. data/templates/freebsd-8.2-pcbsd-i386/pcinstall.fbg.cfg +57 -0
  83. data/templates/freebsd-8.2-pcbsd-i386/postinstall.sh +93 -0
  84. data/templates/gentoo-latest-i386-experimental/definition.rb +29 -0
  85. data/templates/gentoo-latest-i386-experimental/postinstall.sh +184 -0
  86. data/templates/openSUSE-11.4-DVD-i586/autoinst_de.xml +1284 -0
  87. data/templates/openSUSE-11.4-DVD-i586/autoinst_en.xml +1284 -0
  88. data/templates/openSUSE-11.4-DVD-i586/definition.rb +28 -0
  89. data/templates/openSUSE-11.4-DVD-i586/postinstall.sh +43 -0
  90. data/templates/openSUSE-11.4-DVD-x86_64/autoinst_de.xml +1459 -0
  91. data/templates/openSUSE-11.4-DVD-x86_64/autoinst_en.xml +1459 -0
  92. data/templates/openSUSE-11.4-DVD-x86_64/definition.rb +28 -0
  93. data/templates/openSUSE-11.4-DVD-x86_64/postinstall.sh +43 -0
  94. data/templates/openSUSE-11.4-NET-i586/autoinst_de.xml +1278 -0
  95. data/templates/openSUSE-11.4-NET-i586/autoinst_en.xml +1278 -0
  96. data/templates/openSUSE-11.4-NET-i586/definition.rb +28 -0
  97. data/templates/openSUSE-11.4-NET-i586/postinstall.sh +43 -0
  98. data/templates/openSUSE-11.4-NET-x86_64/autoinst_de.xml +1453 -0
  99. data/templates/openSUSE-11.4-NET-x86_64/autoinst_en.xml +1453 -0
  100. data/templates/openSUSE-11.4-NET-x86_64/definition.rb +28 -0
  101. data/templates/openSUSE-11.4-NET-x86_64/postinstall.sh +43 -0
  102. data/templates/solaris-11-express-i386/auto_install/ai.dtd +58 -0
  103. data/templates/solaris-11-express-i386/auto_install/ai_manifest.xml +241 -0
  104. data/templates/solaris-11-express-i386/auto_install/configuration.dtd +44 -0
  105. data/templates/solaris-11-express-i386/auto_install/default.xml +124 -0
  106. data/templates/solaris-11-express-i386/auto_install/default.xml.orig +124 -0
  107. data/templates/solaris-11-express-i386/auto_install/sc_profiles/static_network.xml +105 -0
  108. data/templates/solaris-11-express-i386/auto_install/software.dtd +105 -0
  109. data/templates/solaris-11-express-i386/auto_install/target.dtd +196 -0
  110. data/templates/solaris-11-express-i386/default.xml +121 -0
  111. data/templates/solaris-11-express-i386/definition.rb +65 -0
  112. data/templates/solaris-11-express-i386/postinstall.sh +98 -0
  113. data/templates/ubuntu-10.04.3-server-amd64/definition.rb +54 -0
  114. data/templates/ubuntu-10.04.3-server-amd64/postinstall.sh +90 -0
  115. data/templates/ubuntu-10.04.3-server-amd64/preseed.cfg +87 -0
  116. data/templates/ubuntu-10.04.3-server-i386/definition.rb +24 -0
  117. data/templates/ubuntu-10.04.3-server-i386/postinstall.sh +91 -0
  118. data/templates/ubuntu-10.04.3-server-i386/preseed.cfg +87 -0
  119. data/templates/ubuntu-11.10-server-amd64/definition.rb +35 -0
  120. data/templates/ubuntu-11.10-server-amd64/postinstall.sh +90 -0
  121. data/templates/ubuntu-11.10-server-amd64/preseed.cfg +87 -0
  122. data/templates/ubuntu-11.10-server-i386/definition.rb +35 -0
  123. data/templates/ubuntu-11.10-server-i386/postinstall.sh +90 -0
  124. data/templates/ubuntu-11.10-server-i386/preseed.cfg +87 -0
  125. data/validation/features/steps/ssh_steps.rb +169 -0
  126. data/validation/support/env.rb +1 -0
  127. data/validation/vagrant-private.key +27 -0
  128. data/validation/vagrant.feature +52 -0
  129. data/validation/vagrant.pub +1 -0
  130. data/vbox.gemspec +32 -0
  131. metadata +338 -0
@@ -0,0 +1,24 @@
1
+ Veewee::Session.declare({
2
+ :cpu_count => '1', :memory_size=> '384',
3
+ :disk_size => '10140', :disk_format => 'VDI', :hostiocache => 'off',
4
+ :os_type_id => 'Ubuntu',
5
+ :iso_file => "ubuntu-10.04.3-server-i386.iso",
6
+ :iso_src => "http://releases.ubuntu.com/10.04.3/ubuntu-10.04.3-server-i386.iso",
7
+ :iso_md5 => "388104f6225ae676ceab0ba4bd7b5784",
8
+ :iso_download_timeout => "1000",
9
+ :boot_wait => "10", :boot_cmd_sequence => [
10
+ '<Esc><Esc><Enter>',
11
+ '/install/vmlinuz noapic preseed/url=http://%IP%:%PORT%/preseed.cfg ',
12
+ 'debian-installer=en_US auto locale=en_US kbd-chooser/method=us ',
13
+ 'hostname=%NAME% ',
14
+ 'fb=false debconf/frontend=noninteractive ',
15
+ 'console-setup/ask_detect=false console-setup/modelcode=pc105 console-setup/layoutcode=us ',
16
+ 'initrd=/install/initrd.gz -- <Enter>'
17
+ ],
18
+ :kickstart_port => "7122", :kickstart_timeout => "10000", :kickstart_file => "preseed.cfg",
19
+ :ssh_login_timeout => "10000", :ssh_user => "vagrant", :ssh_password => "vagrant", :ssh_key => "",
20
+ :ssh_host_port => "7222", :ssh_guest_port => "22",
21
+ :sudo_cmd => "echo '%p'|sudo -S sh '%f'",
22
+ :shutdown_cmd => "shutdown -P now",
23
+ :postinstall_files => [ "postinstall.sh"], :postinstall_timeout => "10000"
24
+ })
@@ -0,0 +1,91 @@
1
+ # postinstall.sh created from Mitchell's official lucid32/64 baseboxes
2
+
3
+ date > /etc/vagrant_box_build_time
4
+
5
+ # Apt-install various things necessary for Ruby, guest additions,
6
+ # etc., and remove optional things to trim down the machine.
7
+ apt-get -y update
8
+ apt-get -y upgrade
9
+ apt-get -y install linux-headers-$(uname -r) build-essential
10
+ apt-get -y install zlib1g-dev libssl-dev libreadline5-dev
11
+ apt-get clean
12
+
13
+ # Setup sudo to allow no-password sudo for "admin"
14
+ cp /etc/sudoers /etc/sudoers.orig
15
+ sed -i -e '/Defaults\s\+env_reset/a Defaults\texempt_group=admin' /etc/sudoers
16
+ sed -i -e 's/%admin ALL=(ALL) ALL/%admin ALL=NOPASSWD:ALL/g' /etc/sudoers
17
+
18
+ # Install NFS client
19
+ apt-get -y install nfs-common
20
+
21
+ # Install Ruby from source in /opt so that users of Vagrant
22
+ # can install their own Rubies using packages or however.
23
+ # We must install the 1.8.x series since Puppet doesn't support
24
+ # Ruby 1.9 yet.
25
+ wget http://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p334.tar.gz
26
+ tar xvzf ruby-1.8.7-p334.tar.gz
27
+ cd ruby-1.8.7-p334
28
+ ./configure --prefix=/opt/ruby
29
+ make
30
+ make install
31
+ cd ..
32
+ rm -rf ruby-1.8.7-p334*
33
+
34
+ # Install RubyGems 1.7.2
35
+ wget http://production.cf.rubygems.org/rubygems/rubygems-1.7.2.tgz
36
+ tar xzf rubygems-1.7.2.tgz
37
+ cd rubygems-1.7.2
38
+ /opt/ruby/bin/ruby setup.rb
39
+ cd ..
40
+ rm -rf rubygems-1.7.2*
41
+
42
+ # Installing chef & Puppet
43
+ /opt/ruby/bin/gem install chef --no-ri --no-rdoc
44
+ /opt/ruby/bin/gem install puppet --no-ri --no-rdoc
45
+
46
+ # Add /opt/ruby/bin to the global path as the last resort so
47
+ # Ruby, RubyGems, and Chef/Puppet are visible
48
+ echo 'PATH=$PATH:/opt/ruby/bin/'> /etc/profile.d/vagrantruby.sh
49
+
50
+ # Installing vagrant keys
51
+ mkdir /home/vagrant/.ssh
52
+ chmod 700 /home/vagrant/.ssh
53
+ cd /home/vagrant/.ssh
54
+ wget --no-check-certificate 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' -O authorized_keys
55
+ chmod 600 /home/vagrant/.ssh/authorized_keys
56
+ chown -R vagrant /home/vagrant/.ssh
57
+
58
+ # Installing the virtualbox guest additions
59
+ VBOX_VERSION=$(cat /home/vagrant/.vbox_version)
60
+ cd /tmp
61
+ wget http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso
62
+ mount -o loop VBoxGuestAdditions_$VBOX_VERSION.iso /mnt
63
+ sh /mnt/VBoxLinuxAdditions.run
64
+ umount /mnt
65
+
66
+ rm VBoxGuestAdditions_$VBOX_VERSION.iso
67
+
68
+ # Remove items used for building, since they aren't needed anymore
69
+ apt-get -y remove linux-headers-$(uname -r) build-essential
70
+ apt-get -y autoremove
71
+
72
+ # Zero out the free space to save space in the final image:
73
+ dd if=/dev/zero of=/EMPTY bs=1M
74
+ rm -f /EMPTY
75
+
76
+ # Removing leftover leases and persistent rules
77
+ echo "cleaning up dhcp leases"
78
+ rm /var/lib/dhcp3/*
79
+
80
+ # Make sure Udev doesn't block our network
81
+ # http://6.ptmc.org/?p=164
82
+ echo "cleaning up udev rules"
83
+ rm /etc/udev/rules.d/70-persistent-net.rules
84
+ mkdir /etc/udev/rules.d/70-persistent-net.rules
85
+ rm -rf /dev/.udev/
86
+ rm /lib/udev/rules.d/75-persistent-net-generator.rules
87
+
88
+ echo "Adding a 2 sec delay to the interface up, to make the dhclient happy"
89
+ echo "pre-up sleep 2" >> /etc/network/interfaces
90
+ exit
91
+ exit
@@ -0,0 +1,87 @@
1
+ ## Options to set on the command line
2
+ d-i debian-installer/locale string en_US
3
+ d-i console-setup/ask_detect boolean false
4
+ d-i console-setup/layout string Belgium
5
+
6
+ #d-i netcfg/get_hostname string dummy
7
+ d-i netcfg/get_hostname string unassigned-hostname
8
+ d-i netcfg/get_domain string unassigned-domain
9
+
10
+ # Continue without a default route
11
+ # Not working , specify a dummy in the DHCP
12
+ #d-i netcfg/no_default_route boolean
13
+
14
+ d-i time/zone string Europe/Brussels
15
+ d-i clock-setup/utc-auto boolean true
16
+ d-i clock-setup/utc boolean true
17
+
18
+ d-i kbd-chooser/method select Belgian
19
+
20
+ d-i netcfg/wireless_wep string
21
+
22
+ d-i base-installer/kernel/override-image string linux-server
23
+ #d-i base-installer/kernel/override-image string linux-image-2.6.32-21-generic
24
+
25
+ # Choices: Dialog, Readline, Gnome, Kde, Editor, Noninteractive
26
+ d-i debconf debconf/frontend select Noninteractive
27
+
28
+ d-i pkgsel/install-language-support boolean false
29
+ tasksel tasksel/first multiselect standard, ubuntu-server
30
+
31
+ #d-i partman-auto/method string regular
32
+ d-i partman-auto/method string lvm
33
+ #d-i partman-auto/purge_lvm_from_device boolean true
34
+
35
+ d-i partman-lvm/confirm boolean true
36
+ d-i partman-lvm/device_remove_lvm boolean true
37
+ d-i partman-auto/choose_recipe select atomic
38
+
39
+ d-i partman/confirm_write_new_label boolean true
40
+ d-i partman/confirm_nooverwrite boolean true
41
+ d-i partman/choose_partition select finish
42
+ d-i partman/confirm boolean true
43
+
44
+ #http://ubuntu-virginia.ubuntuforums.org/showthread.php?p=9626883
45
+ #Message: "write the changes to disk and configure lvm preseed"
46
+ #http://serverfault.com/questions/189328/ubuntu-kickstart-installation-using-lvm-waits-for-input
47
+ #preseed partman-lvm/confirm_nooverwrite boolean true
48
+
49
+ # Write the changes to disks and configure LVM?
50
+ d-i partman-lvm/confirm boolean true
51
+ d-i partman-lvm/confirm_nooverwrite boolean true
52
+ d-i partman-auto-lvm/guided_size string max
53
+
54
+ ## Default user, we can get away with a recipe to change this
55
+ d-i passwd/user-fullname string vagrant
56
+ d-i passwd/username string vagrant
57
+ d-i passwd/user-password password vagrant
58
+ d-i passwd/user-password-again password vagrant
59
+ d-i user-setup/encrypt-home boolean false
60
+ d-i user-setup/allow-password-weak boolean true
61
+
62
+ ## minimum is puppet and ssh and ntp
63
+ # Individual additional packages to install
64
+ d-i pkgsel/include string openssh-server ntp
65
+
66
+ # Whether to upgrade packages after debootstrap.
67
+ # Allowed values: none, safe-upgrade, full-upgrade
68
+ d-i pkgsel/upgrade select full-upgrade
69
+
70
+ d-i grub-installer/only_debian boolean true
71
+ d-i grub-installer/with_other_os boolean true
72
+ d-i finish-install/reboot_in_progress note
73
+
74
+ #For the update
75
+ d-i pkgsel/update-policy select none
76
+
77
+ # debconf-get-selections --install
78
+ #Use mirror
79
+ #d-i apt-setup/use_mirror boolean true
80
+ #d-i mirror/country string manual
81
+ #choose-mirror-bin mirror/protocol string http
82
+ #choose-mirror-bin mirror/http/hostname string 192.168.4.150
83
+ #choose-mirror-bin mirror/http/directory string /ubuntu
84
+ #choose-mirror-bin mirror/suite select maverick
85
+ #d-i debian-installer/allow_unauthenticated string true
86
+
87
+ choose-mirror-bin mirror/http/proxy string
@@ -0,0 +1,35 @@
1
+ Veewee::Session.declare({
2
+ :cpu_count => '1',
3
+ :memory_size=> '384',
4
+ :disk_size => '10140',
5
+ :disk_format => 'VDI',
6
+ :hostiocache => 'off',
7
+ :os_type_id => 'Ubuntu_64',
8
+ :iso_file => "ubuntu-11.10-server-amd64.iso",
9
+ :iso_src => "http://releases.ubuntu.com/11.10/ubuntu-11.10-server-amd64.iso",
10
+ :iso_md5 => "f8a0112b7cb5dcd6d564dbe59f18c35f",
11
+ :iso_download_timeout => "1000",
12
+ :boot_wait => "10",
13
+ :boot_cmd_sequence => [
14
+ '<Esc><Esc><Enter>',
15
+ '/install/vmlinuz noapic preseed/url=http://%IP%:%PORT%/preseed.cfg ',
16
+ 'debian-installer=en_US auto locale=en_US kbd-chooser/method=us ',
17
+ 'hostname=%NAME% ',
18
+ 'fb=false debconf/frontend=noninteractive ',
19
+ 'keyboard-configuration/layout=USA keyboard-configuration/variant=USA console-setup/ask_detect=false ',
20
+ 'initrd=/install/initrd.gz -- <Enter>'
21
+ ],
22
+ :kickstart_port => "7122",
23
+ :kickstart_timeout => "10000",
24
+ :kickstart_file => "preseed.cfg",
25
+ :ssh_login_timeout => "10000",
26
+ :ssh_user => "vagrant",
27
+ :ssh_password => "vagrant",
28
+ :ssh_key => "",
29
+ :ssh_host_port => "7222",
30
+ :ssh_guest_port => "22",
31
+ :sudo_cmd => "echo '%p'|sudo -S sh '%f'",
32
+ :shutdown_cmd => "shutdown -P now",
33
+ :postinstall_files => [ "postinstall.sh"],
34
+ :postinstall_timeout => "10000"
35
+ })
@@ -0,0 +1,90 @@
1
+ # postinstall.sh created from Mitchell's official lucid32/64 baseboxes
2
+
3
+ date > /etc/vagrant_box_build_time
4
+
5
+ # Apt-install various things necessary for Ruby, guest additions,
6
+ # etc., and remove optional things to trim down the machine.
7
+ apt-get -y update
8
+ apt-get -y upgrade
9
+ apt-get -y install linux-headers-$(uname -r) build-essential
10
+ apt-get -y install zlib1g-dev libssl-dev libreadline5
11
+ apt-get clean
12
+
13
+ # Setup sudo to allow no-password sudo for "admin"
14
+ cp /etc/sudoers /etc/sudoers.orig
15
+ sed -i -e '/Defaults\s\+env_reset/a Defaults\texempt_group=admin' /etc/sudoers
16
+ sed -i -e 's/%admin ALL=(ALL) ALL/%admin ALL=NOPASSWD:ALL/g' /etc/sudoers
17
+
18
+ # Install NFS client
19
+ apt-get -y install nfs-common
20
+
21
+ # Install Ruby from source in /opt so that users of Vagrant
22
+ # can install their own Rubies using packages or however.
23
+ # We must install the 1.8.x series since Puppet doesn't support
24
+ # Ruby 1.9 yet.
25
+ wget http://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p352.tar.gz
26
+ tar xvzf ruby-1.8.7-p352.tar.gz
27
+ cd ruby-1.8.7-p352
28
+ ./configure --prefix=/opt/ruby
29
+ make
30
+ make install
31
+ cd ..
32
+ rm -rf ruby-1.8.7-p352*
33
+
34
+ # Install RubyGems 1.7.2
35
+ wget http://production.cf.rubygems.org/rubygems/rubygems-1.7.2.tgz
36
+ tar xzf rubygems-1.7.2.tgz
37
+ cd rubygems-1.7.2
38
+ /opt/ruby/bin/ruby setup.rb
39
+ cd ..
40
+ rm -rf rubygems-1.7.2*
41
+
42
+ # Installing chef & Puppet
43
+ /opt/ruby/bin/gem install chef --no-ri --no-rdoc
44
+ /opt/ruby/bin/gem install puppet --no-ri --no-rdoc
45
+
46
+ # Add /opt/ruby/bin to the global path as the last resort so
47
+ # Ruby, RubyGems, and Chef/Puppet are visible
48
+ echo 'PATH=$PATH:/opt/ruby/bin/'> /etc/profile.d/vagrantruby.sh
49
+
50
+ # Installing vagrant keys
51
+ mkdir /home/vagrant/.ssh
52
+ chmod 700 /home/vagrant/.ssh
53
+ cd /home/vagrant/.ssh
54
+ wget --no-check-certificate 'http://github.com/mitchellh/vagrant/raw/master/keys/vagrant.pub' -O authorized_keys
55
+ chmod 600 /home/vagrant/.ssh/authorized_keys
56
+ chown -R vagrant /home/vagrant/.ssh
57
+
58
+ # Installing the virtualbox guest additions
59
+ VBOX_VERSION=$(cat /home/vagrant/.vbox_version)
60
+ cd /tmp
61
+ wget http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso
62
+ mount -o loop VBoxGuestAdditions_$VBOX_VERSION.iso /mnt
63
+ sh /mnt/VBoxLinuxAdditions.run
64
+ umount /mnt
65
+
66
+ rm VBoxGuestAdditions_$VBOX_VERSION.iso
67
+
68
+ # Remove items used for building, since they aren't needed anymore
69
+ apt-get -y remove linux-headers-$(uname -r) build-essential
70
+ apt-get -y autoremove
71
+
72
+ # Zero out the free space to save space in the final image:
73
+ # dd if=/dev/zero of=/EMPTY bs=1M
74
+ # rm -f /EMPTY
75
+
76
+ # Removing leftover leases and persistent rules
77
+ echo "cleaning up dhcp leases"
78
+ rm /var/lib/dhcp3/*
79
+
80
+ # Make sure Udev doesn't block our network
81
+ # http://6.ptmc.org/?p=164
82
+ echo "cleaning up udev rules"
83
+ rm /etc/udev/rules.d/70-persistent-net.rules
84
+ mkdir /etc/udev/rules.d/70-persistent-net.rules
85
+ rm -rf /dev/.udev/
86
+ rm /lib/udev/rules.d/75-persistent-net-generator.rules
87
+
88
+ echo "Adding a 2 sec delay to the interface up, to make the dhclient happy"
89
+ echo "pre-up sleep 2" >> /etc/network/interfaces
90
+ exit
@@ -0,0 +1,87 @@
1
+ ## Options to set on the command line
2
+ d-i debian-installer/locale string en_US.utf8
3
+ d-i console-setup/ask_detect boolean false
4
+ d-i console-setup/layout string USA
5
+
6
+ #d-i netcfg/get_hostname string dummy
7
+ d-i netcfg/get_hostname string unassigned-hostname
8
+ d-i netcfg/get_domain string unassigned-domain
9
+
10
+ # Continue without a default route
11
+ # Not working , specify a dummy in the DHCP
12
+ #d-i netcfg/no_default_route boolean
13
+
14
+ d-i time/zone string UTC
15
+ d-i clock-setup/utc-auto boolean true
16
+ d-i clock-setup/utc boolean true
17
+
18
+ d-i kbd-chooser/method select American English
19
+
20
+ d-i netcfg/wireless_wep string
21
+
22
+ d-i base-installer/kernel/override-image string linux-server
23
+ #d-i base-installer/kernel/override-image string linux-image-2.6.32-21-generic
24
+
25
+ # Choices: Dialog, Readline, Gnome, Kde, Editor, Noninteractive
26
+ d-i debconf debconf/frontend select Noninteractive
27
+
28
+ d-i pkgsel/install-language-support boolean false
29
+ tasksel tasksel/first multiselect standard, ubuntu-server
30
+
31
+ #d-i partman-auto/method string regular
32
+ d-i partman-auto/method string lvm
33
+ #d-i partman-auto/purge_lvm_from_device boolean true
34
+
35
+ d-i partman-lvm/confirm boolean true
36
+ d-i partman-lvm/device_remove_lvm boolean true
37
+ d-i partman-auto/choose_recipe select atomic
38
+
39
+ d-i partman/confirm_write_new_label boolean true
40
+ d-i partman/confirm_nooverwrite boolean true
41
+ d-i partman/choose_partition select finish
42
+ d-i partman/confirm boolean true
43
+
44
+ #http://ubuntu-virginia.ubuntuforums.org/showthread.php?p=9626883
45
+ #Message: "write the changes to disk and configure lvm preseed"
46
+ #http://serverfault.com/questions/189328/ubuntu-kickstart-installation-using-lvm-waits-for-input
47
+ #preseed partman-lvm/confirm_nooverwrite boolean true
48
+
49
+ # Write the changes to disks and configure LVM?
50
+ d-i partman-lvm/confirm boolean true
51
+ d-i partman-lvm/confirm_nooverwrite boolean true
52
+ d-i partman-auto-lvm/guided_size string max
53
+
54
+ ## Default user, we can get away with a recipe to change this
55
+ d-i passwd/user-fullname string vagrant
56
+ d-i passwd/username string vagrant
57
+ d-i passwd/user-password password vagrant
58
+ d-i passwd/user-password-again password vagrant
59
+ d-i user-setup/encrypt-home boolean false
60
+ d-i user-setup/allow-password-weak boolean true
61
+
62
+ ## minimum is puppet and ssh and ntp
63
+ # Individual additional packages to install
64
+ d-i pkgsel/include string openssh-server ntp
65
+
66
+ # Whether to upgrade packages after debootstrap.
67
+ # Allowed values: none, safe-upgrade, full-upgrade
68
+ d-i pkgsel/upgrade select full-upgrade
69
+
70
+ d-i grub-installer/only_debian boolean true
71
+ d-i grub-installer/with_other_os boolean true
72
+ d-i finish-install/reboot_in_progress note
73
+
74
+ #For the update
75
+ d-i pkgsel/update-policy select none
76
+
77
+ # debconf-get-selections --install
78
+ #Use mirror
79
+ #d-i apt-setup/use_mirror boolean true
80
+ #d-i mirror/country string manual
81
+ #choose-mirror-bin mirror/protocol string http
82
+ #choose-mirror-bin mirror/http/hostname string 192.168.4.150
83
+ #choose-mirror-bin mirror/http/directory string /ubuntu
84
+ #choose-mirror-bin mirror/suite select maverick
85
+ #d-i debian-installer/allow_unauthenticated string true
86
+
87
+ choose-mirror-bin mirror/http/proxy string
@@ -0,0 +1,35 @@
1
+ Veewee::Session.declare({
2
+ :cpu_count => '1',
3
+ :memory_size=> '384',
4
+ :disk_size => '10140',
5
+ :disk_format => 'VDI',
6
+ :hostiocache => 'off',
7
+ :os_type_id => 'Ubuntu',
8
+ :iso_file => "ubuntu-11.10-server-i386.iso",
9
+ :iso_src => "http://releases.ubuntu.com/11.10/ubuntu-11.10-server-i386.iso",
10
+ :iso_md5 => "881d188cb1ca5fb18e3d9132275dceda",
11
+ :iso_download_timeout => "1000",
12
+ :boot_wait => "10",
13
+ :boot_cmd_sequence => [
14
+ '<Esc><Esc><Enter>',
15
+ '/install/vmlinuz noapic preseed/url=http://%IP%:%PORT%/preseed.cfg ',
16
+ 'debian-installer=en_US auto locale=en_US kbd-chooser/method=us ',
17
+ 'hostname=%NAME% ',
18
+ 'fb=false debconf/frontend=noninteractive ',
19
+ 'keyboard-configuration/layout=USA keyboard-configuration/variant=USA console-setup/ask_detect=false ',
20
+ 'initrd=/install/initrd.gz -- <Enter>'
21
+ ],
22
+ :kickstart_port => "7122",
23
+ :kickstart_timeout => "10000",
24
+ :kickstart_file => "preseed.cfg",
25
+ :ssh_login_timeout => "10000",
26
+ :ssh_user => "vagrant",
27
+ :ssh_password => "vagrant",
28
+ :ssh_key => "",
29
+ :ssh_host_port => "7222",
30
+ :ssh_guest_port => "22",
31
+ :sudo_cmd => "echo '%p'|sudo -S sh '%f'",
32
+ :shutdown_cmd => "shutdown -P now",
33
+ :postinstall_files => [ "postinstall.sh"],
34
+ :postinstall_timeout => "10000"
35
+ })