├── .gitignore ├── LICENSE ├── Makefile ├── README.md ├── boxes └── .gitignore ├── debian-7.8.0 ├── Vagrantfile ├── preseed.cfg └── template.json ├── scripts ├── base-debian.sh ├── base-ubuntu.sh ├── base-xenserver.sh ├── base.sh ├── cleanup.sh ├── finish.sh ├── mirage.sh ├── networking.sh ├── opam.sh ├── packages.sh ├── reboot.sh ├── vagrant.sh ├── virtualbox.sh ├── xen.sh └── zerodisk.sh ├── ubuntu-14.04 ├── Vagrantfile ├── preseed.cfg └── template.json ├── ubuntu-14.10 ├── Vagrantfile ├── preseed.cfg └── template.json └── xenserver-6.5.0 ├── Vagrantfile ├── answerfile └── template.json /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .vagrant 3 | packer_cache/ 4 | output-virtualbox-iso 5 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2015 Richard Mortier 3 | # 4 | # Permission to use, copy, modify, and distribute this software for any purpose 5 | # with or without fee is hereby granted, provided that the above copyright 6 | # notice and this permission notice appear in all copies. 7 | # 8 | # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 9 | # REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 10 | # AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 11 | # INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 12 | # LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 13 | # OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 14 | # PERFORMANCE OF THIS SOFTWARE. 15 | # 16 | 17 | help: 18 | @grep '^[^#[:space:]]' Makefile 19 | @echo Pattern targets: 20 | @for n in $$(ls -lR1 */Vagrantfile) ; do echo "\t$$(dirname $$n)" ; done 21 | 22 | %-box: # build vagrant box 23 | packer build $*/template.json 24 | vagrant box add -f $*-xen boxes/$*-amd64.box 25 | 26 | %-vagrant: # boot and provision vagrant box 27 | cd $* && vagrant up --provision 28 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Mirage Virtualbox VMs via Vagrant 2 | 3 | ## Setup 4 | 5 | ### Clone this repo 6 | 7 | $ git clone https://github.com/mirage/mirage-vagrant-vms.git 8 | $ cd mirage-vagrant-vms 9 | 10 | This currently contains support for Ubuntu 14.04 LTS ("Trusty Tahr"), Ubuntu 11 | 14.10 ("Utopic Unicorn"), Debian 7.8.0 ("wheezy") and Citrix XenServer 6.5.0. 12 | 13 | XenServer support imported from . 14 | 15 | ### Install `Virtualbox` 16 | 17 | First, install Oracle's [Virtualbox][]. Download the appropriate installer for 18 | your platform from and follow the 19 | instructions. 20 | 21 | [virtualbox]: https://www.virtualbox.org/ 22 | 23 | Note that you need a reasonably recent version -- at time of writing, `4.3.4` 24 | has been observed to fail to build, while `4.3.26` has been observed to work. 25 | Reports of other working or failing versions welcome! (Perhaps as pull requests 26 | to this file in this repo :) 27 | 28 | ### Install `vagrant` 29 | 30 | Next, install [Vagrant][]. On OSX I use [homebrew][] so I do this as follows: 31 | 32 | $ brew tap phinze/cask 33 | $ brew install brew-cask 34 | $ brew cask install vagrant 35 | $ vagrant --version 36 | Vagrant 1.4.3 37 | 38 | [homebrew]: http://brew.sh/ 39 | [vagrant]: http://vagrantup.com/ 40 | 41 | ### Install `packer` 42 | 43 | Then, install [Packer][]. Again, using [homebrew][] this becomes: 44 | 45 | $ brew tap homebrew/binary 46 | $ brew install packer 47 | 48 | [packer]: https://www.packer.io 49 | 50 | ## Use 51 | 52 | Build a new box using `packer`: 53 | 54 | $ make {ubuntu-14.04,ubuntu-14.10,debian-7.8.0,xenserver-6.5.0}-box 55 | 56 | Bring it up and provision it using `vagrant`: 57 | 58 | $ make {ubuntu-14.04,ubuntu-14.10,debian-7.8.0,xenserver-6.5.0}-vagrant 59 | 60 | Connect to it via `ssh`: 61 | 62 | $ cd {ubuntu-14.04,ubuntu-14.10,debian-7.8.0,xenserver-6.5.0} && vagrant ssh 63 | 64 | Finally, within a box, make sure you add `~/bin` to your `$PATH` to use 65 | `0install` installed binaries (specifically, `opam`). 66 | 67 | Subsequently, `vagrant halt` will stop the VM (or the usual `shutdown -h now` 68 | when logged into it), `vagrant up` will restart it, and `vagrant ssh` to login. 69 | 70 | # _Deprecated_ 71 | 72 | The following networking instructions need to be updated. 73 | 74 | 75 | ## Networking 76 | 77 | At the risk of this becoming a "general" Xen networking tutorial (as if such a 78 | thing were possible)... 79 | 80 | 81 | virtualbox 82 | 83 | [ dom0 ] [ mirage-domU ] 84 | [ 100.64.0.2 ] [ 100.64.0.3 ] 85 | [ vifN.0 ] 86 | | | 87 | +---[ xenbr0 ]---+ 88 | | 89 | | 90 | [ eth2 ] 91 | | 92 | | 93 | 94 | 95 | ### Useful commands 96 | 97 | On host: 98 | 99 | vboxmanage list hostonlyifs 100 | vboxmanage list dhcpservers 101 | 102 | On dom0: 103 | 104 | sudo xm network-list mort-www 105 | 106 | 107 | ### /etc/network/interfaces 108 | 109 | network interface configuration. eth0-N, xenbr0 110 | 111 | auto xenbr0 112 | iface xenbr0 inet dhcp 113 | bridge_ports eth2 114 | bridge_stp off 115 | bridge_waitport 0 116 | bridge_fd 0 117 | 118 | #VAGRANT-BEGIN 119 | # The contents below are automatically generated by Vagrant. Do not modify. 120 | auto eth1 121 | iface eth1 inet static 122 | address 172.16.0.2 123 | netmask 255.255.255.0 124 | #VAGRANT-END 125 | 126 | #VAGRANT-BEGIN 127 | # The contents below are automatically generated by Vagrant. Do not modify. 128 | auto eth2 129 | iface eth2 inet static 130 | address 100.64.0.2 <*> 131 | netmask 255.255.255.0 <*> 132 | #VAGRANT-END 133 | 134 | Lines marked <*> move to the `xenbr0` config from the `eth2` config, and the `eth2` config marked as `manual` not `static`. This makes connection from `dom0` to `mirage-domU` work. 135 | 136 | ### /etc/dhcp/dhcpd.conf 137 | 138 | DHCP server config. subnets from which addresses should be responded with. 139 | 140 | subnet 100.64.0.0 netmask 255.255.255.0 { 141 | range 100.64.0.2 100.64.0.254; 142 | # option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org; 143 | } 144 | -------------------------------------------------------------------------------- /boxes/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /debian-7.8.0/Vagrantfile: -------------------------------------------------------------------------------- 1 | # -*- mode: ruby -*- 2 | 3 | VAGRANTFILE_API_VERSION = "2" 4 | 5 | Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| 6 | 7 | config.vm.box = "debian-7.8.0-xen" 8 | 9 | # config.vm.network :forwarded_port, guest: 80, host: 8080 10 | # config.vm.network :private_network, ip: "192.168.77.2" 11 | 12 | # config.vm.synced_folder "/tmp/mirage-vagrant-vms", "/host", type: "nfs" 13 | config.vm.synced_folder ".", "/vagrant", disabled: true 14 | 15 | config.vm.provider :virtualbox do |vb| 16 | vb.gui = false 17 | end 18 | 19 | config.vm.provision "shell", path: "../scripts/packages.sh" 20 | config.vm.provision "shell", path: "../scripts/xen.sh" 21 | config.vm.provision "shell", path: "../scripts/networking.sh" 22 | config.vm.provision "shell", path: "../scripts/opam.sh", privileged: false 23 | config.vm.provision "shell", path: "../scripts/mirage.sh", privileged: false 24 | config.vm.provision "shell", path: "../scripts/finish.sh" 25 | 26 | end 27 | -------------------------------------------------------------------------------- /debian-7.8.0/preseed.cfg: -------------------------------------------------------------------------------- 1 | #### Contents of the preconfiguration file (for wheezy) 2 | ### Localization 3 | # Locale sets language and country. 4 | d-i debian-installer/locale string en_US.UTF-8 5 | 6 | # Keyboard selection. 7 | #d-i keymap select us 8 | d-i keyboard-configuration/xkb-keymap select us 9 | 10 | ### Network configuration 11 | # netcfg will choose an interface that has link if possible. This makes it 12 | # skip displaying a list if there is more than one interface. 13 | d-i netcfg/choose_interface select auto 14 | 15 | # To pick a particular interface instead: 16 | #d-i netcfg/choose_interface select eth1 17 | 18 | # If you have a slow dhcp server and the installer times out waiting for 19 | # it, this might be useful. 20 | #d-i netcfg/dhcp_timeout string 60 21 | 22 | # If you prefer to configure the network manually, uncomment this line and 23 | # the static network configuration below. 24 | #d-i netcfg/disable_dhcp boolean true 25 | 26 | # If you want the preconfiguration file to work on systems both with and 27 | # without a dhcp server, uncomment these lines and the static network 28 | # configuration below. 29 | #d-i netcfg/dhcp_failed note 30 | #d-i netcfg/dhcp_options select Configure network manually 31 | 32 | # Static network configuration. 33 | #d-i netcfg/get_nameservers string 192.168.1.1 34 | #d-i netcfg/get_ipaddress string 192.168.1.42 35 | #d-i netcfg/get_netmask string 255.255.255.0 36 | #d-i netcfg/get_gateway string 192.168.1.1 37 | #d-i netcfg/confirm_static boolean true 38 | 39 | # Any hostname and domain names assigned from dhcp take precedence over 40 | # values set here. However, setting the values still prevents the questions 41 | # from being shown, even if values come from dhcp. 42 | #d-i netcfg/get_hostname string vagrant 43 | d-i netcfg/get_domain string vagrantup.com 44 | 45 | # Disable that annoying WEP key dialog. 46 | d-i netcfg/wireless_wep string 47 | # The wacky dhcp hostname that some ISPs use as a password of sorts. 48 | #d-i netcfg/dhcp_hostname string radish 49 | 50 | # If non-free firmware is needed for the network or other hardware, you can 51 | # configure the installer to always try to load it, without prompting. Or 52 | # change to false to disable asking. 53 | #d-i hw-detect/load_firmware boolean true 54 | 55 | ### Network console 56 | # Use the following settings if you wish to make use of the network-console 57 | # component for remote installation over SSH. This only makes sense if you 58 | # intend to perform the remainder of the installation manually. 59 | #d-i anna/choose_modules string network-console 60 | #d-i network-console/password password r00tme 61 | #d-i network-console/password-again password r00tme 62 | 63 | ### Mirror settings 64 | # If you select ftp, the mirror/country string does not need to be set. 65 | #d-i mirror/protocol string ftp 66 | d-i mirror/country string manual 67 | d-i mirror/http/hostname string http.us.debian.org 68 | d-i mirror/http/directory string /debian 69 | d-i mirror/http/proxy string 70 | 71 | # Suite to install. 72 | #d-i mirror/suite string testing 73 | # Suite to use for loading installer components (optional). 74 | #d-i mirror/udeb/suite string testing 75 | 76 | ### Clock and time zone setup 77 | # Controls whether or not the hardware clock is set to UTC. 78 | d-i clock-setup/utc boolean true 79 | 80 | # You may set this to any valid setting for $TZ; see the contents of 81 | # /usr/share/zoneinfo/ for valid values. 82 | d-i time/zone string UTC 83 | 84 | # Controls whether to use NTP to set the clock during the install 85 | d-i clock-setup/ntp boolean true 86 | # NTP server to use. The default is almost always fine here. 87 | #d-i clock-setup/ntp-server string ntp.example.com 88 | 89 | ### Partitioning 90 | # If the system has free space you can choose to only partition that space. 91 | #d-i partman-auto/init_automatically_partition select biggest_free 92 | 93 | # Alternatively, you can specify a disk to partition. The device name must 94 | # be given in traditional non-devfs format. 95 | # Note: A disk must be specified, unless the system has only one disk. 96 | # For example, to use the first SCSI/SATA hard disk: 97 | #d-i partman-auto/disk string /dev/sda 98 | # In addition, you'll need to specify the method to use. 99 | # The presently available methods are: "regular", "lvm" and "crypto" 100 | d-i partman-auto/method string lvm 101 | 102 | # If one of the disks that are going to be automatically partitioned 103 | # contains an old LVM configuration, the user will normally receive a 104 | # warning. This can be preseeded away... 105 | d-i partman-lvm/device_remove_lvm boolean true 106 | # The same applies to pre-existing software RAID array: 107 | d-i partman-md/device_remove_md boolean true 108 | 109 | # And the same goes for the confirmation to write the lvm partitions. 110 | d-i partman-lvm/confirm boolean true 111 | d-i partman-lvm/confirm_nooverwrite boolean true 112 | 113 | 114 | d-i partman/choose_partition select finish 115 | d-i partman-auto-lvm/guided_size string max 116 | 117 | # You can choose one of the three predefined partitioning recipes: 118 | # - atomic: all files in one partition 119 | # - home: separate /home partition 120 | # - multi: separate /home, /usr, /var, and /tmp partitions 121 | d-i partman-auto/choose_recipe select atomic 122 | d-i partman/default_filesystem string ext3 123 | 124 | # Or provide a recipe of your own... 125 | # The recipe format is documented in the file devel/partman-auto-recipe.txt. 126 | # If you have a way to get a recipe file into the d-i environment, you can 127 | # just point at it. 128 | #d-i partman-auto/expert_recipe_file string /hd-media/recipe 129 | 130 | # If not, you can put an entire recipe into the preconfiguration file in one 131 | # (logical) line. This example creates a small /boot partition, suitable 132 | # swap, and uses the rest of the space for the root partition: 133 | #d-i partman-auto/expert_recipe string \ 134 | # boot-root :: \ 135 | # 40 50 100 ext3 \ 136 | # $primary{ } $bootable{ } \ 137 | # method{ format } format{ } \ 138 | # use_filesystem{ } filesystem{ ext3 } \ 139 | # mountpoint{ /boot } \ 140 | # . \ 141 | # 500 10000 1000000000 ext3 \ 142 | # method{ format } format{ } \ 143 | # use_filesystem{ } filesystem{ ext3 } \ 144 | # mountpoint{ / } \ 145 | # . \ 146 | # 64 512 300% linux-swap \ 147 | # method{ swap } format{ } \ 148 | # . 149 | 150 | #The preseed line that "selects finish" needs to be in a certain order in your preseed, the example-preseed does not follow this. 151 | #http://ubuntuforums.org/archive/index.php/t-1504045.html 152 | 153 | # This makes partman automatically partition without confirmation, provided 154 | # that you told it what to do using one of the methods above. 155 | d-i partman/confirm_write_new_label boolean true 156 | d-i partman/confirm boolean true 157 | d-i partman/confirm_nooverwrite boolean true 158 | 159 | 160 | ### Base system installation 161 | # Select the initramfs generator used to generate the initrd for 2.6 kernels. 162 | #d-i base-installer/kernel/linux/initramfs-generators string yaird 163 | 164 | # The kernel image (meta) package to be installed; "none" can be used if no 165 | # kernel is to be installed. 166 | #d-i base-installer/kernel/image string linux-image-2.6-486 167 | 168 | ### Account setup 169 | # Skip creation of a root account (normal user account will be able to 170 | # use sudo). 171 | d-i passwd/root-login boolean false 172 | # Alternatively, to skip creation of a normal user account. 173 | #d-i passwd/make-user boolean false 174 | 175 | # Root password, either in clear text 176 | d-i passwd/root-password password vagrant 177 | d-i passwd/root-password-again password vagrant 178 | # or encrypted using an MD5 hash. 179 | #d-i passwd/root-password-crypted password [MD5 hash] 180 | 181 | # To create a normal user account. 182 | d-i passwd/user-fullname string Vagrant User 183 | d-i passwd/username string vagrant 184 | # Normal user's password, either in clear text 185 | d-i passwd/user-password password vagrant 186 | d-i passwd/user-password-again password vagrant 187 | # or encrypted using an MD5 hash. 188 | #d-i passwd/user-password-crypted password [MD5 hash] 189 | # Create the first user with the specified UID instead of the default. 190 | #d-i passwd/user-uid string 1010 191 | d-i user-setup/encrypt-home boolean false 192 | d-i user-setup/allow-password-weak boolean true 193 | 194 | # The user account will be added to some standard initial groups. To 195 | # override that, use this. 196 | d-i passwd/user-default-groups string audio cdrom video admin 197 | 198 | ### Apt setup 199 | # You can choose to install non-free and contrib software. 200 | #d-i apt-setup/non-free boolean true 201 | #d-i apt-setup/contrib boolean true 202 | # Uncomment this if you don't want to use a network mirror. 203 | #d-i apt-setup/use_mirror boolean false 204 | # Select which update services to use; define the mirrors to be used. 205 | # Values shown below are the normal defaults. 206 | #d-i apt-setup/services-select multiselect security, volatile 207 | #d-i apt-setup/security_host string security.debian.org 208 | #d-i apt-setup/volatile_host string volatile.debian.org 209 | 210 | 211 | # By default the installer requires that repositories be authenticated 212 | # using a known gpg key. This setting can be used to disable that 213 | # authentication. Warning: Insecure, not recommended. 214 | #d-i debian-installer/allow_unauthenticated string true 215 | 216 | ### Package selection 217 | tasksel tasksel/first multiselect standard 218 | # If the desktop task is selected, install the kde and xfce desktops 219 | # instead of the default gnome desktop. 220 | #tasksel tasksel/desktop multiselect kde, xfce 221 | 222 | # Individual additional packages to install 223 | d-i pkgsel/include string openssh-server ntp acpid sudo bzip2 rsync 224 | 225 | # Whether to upgrade packages after debootstrap. 226 | # Allowed values: none, safe-upgrade, full-upgrade 227 | d-i pkgsel/upgrade select none 228 | 229 | # Some versions of the installer can report back on what software you have 230 | # installed, and what software you use. The default is not to report back, 231 | # but sending reports helps the project determine what software is most 232 | # popular and include it on CDs. 233 | popularity-contest popularity-contest/participate boolean false 234 | 235 | ### Boot loader installation 236 | # Grub is the default boot loader (for x86). If you want lilo installed 237 | # instead, uncomment this: 238 | #d-i grub-installer/skip boolean true 239 | # To also skip installing lilo, and install no bootloader, uncomment this 240 | # too: 241 | #d-i lilo-installer/skip boolean true 242 | 243 | # This is fairly safe to set, it makes grub install automatically to the MBR 244 | # if no other operating system is detected on the machine. 245 | d-i grub-installer/only_debian boolean true 246 | 247 | # This one makes grub-installer install to the MBR if it also finds some other 248 | # OS, which is less safe as it might not be able to boot that other OS. 249 | d-i grub-installer/with_other_os boolean true 250 | 251 | # Alternatively, if you want to install to a location other than the mbr, 252 | # uncomment and edit these lines: 253 | #d-i grub-installer/only_debian boolean false 254 | #d-i grub-installer/with_other_os boolean false 255 | #d-i grub-installer/bootdev string (hd0,0) 256 | # To install grub to multiple disks: 257 | #d-i grub-installer/bootdev string (hd0,0) (hd1,0) (hd2,0) 258 | 259 | # Optional password for grub, either in clear text 260 | #d-i grub-installer/password password r00tme 261 | #d-i grub-installer/password-again password r00tme 262 | # or encrypted using an MD5 hash, see grub-md5-crypt(8). 263 | #d-i grub-installer/password-crypted password [MD5 hash] 264 | 265 | ### Finishing up the installation 266 | # During installations from serial console, the regular virtual consoles 267 | # (VT1-VT6) are normally disabled in /etc/inittab. Uncomment the next 268 | # line to prevent this. 269 | #d-i finish-install/keep-consoles boolean true 270 | 271 | # Avoid that last message about the install being complete. 272 | d-i finish-install/reboot_in_progress note 273 | 274 | # This will prevent the installer from ejecting the CD during the reboot, 275 | # which is useful in some situations. 276 | #d-i cdrom-detect/eject boolean false 277 | 278 | # This is how to make the installer shutdown when finished, but not 279 | # reboot into the installed system. 280 | #d-i debian-installer/exit/halt boolean true 281 | # This will power off the machine instead of just halting it. 282 | #d-i debian-installer/exit/poweroff boolean true 283 | 284 | ### Preseeding other packages 285 | # Depending on what software you choose to install, or if things go wrong 286 | # during the installation process, it's possible that other questions may 287 | # be asked. You can preseed those too, of course. To get a list of every 288 | # possible question that could be asked during an install, do an 289 | # installation, and then run these commands: 290 | # debconf-get-selections --installer > file 291 | # debconf-get-selections >> file 292 | 293 | 294 | #### Advanced options 295 | ### Running custom commands during the installation 296 | # d-i preseeding is inherently not secure. Nothing in the installer checks 297 | # for attempts at buffer overflows or other exploits of the values of a 298 | # preconfiguration file like this one. Only use preconfiguration files from 299 | # trusted locations! To drive that home, and because it's generally useful, 300 | # here's a way to run any shell command you'd like inside the installer, 301 | # automatically. 302 | 303 | # This first command is run as early as possible, just after 304 | # preseeding is read. 305 | # Prevent packaged version of VirtualBox Guest Additions being installed: 306 | d-i preseed/early_command string sed -i \ 307 | '/in-target/idiscover(){/sbin/discover|grep -v VirtualBox;}' \ 308 | /usr/lib/pre-pkgsel.d/20install-hwpackages 309 | 310 | # This command is run just before the install finishes, but when there is 311 | # still a usable /target directory. You can chroot to /target and use it 312 | # directly, or use the apt-install and in-target commands to easily install 313 | # packages and run commands in the target system. 314 | -------------------------------------------------------------------------------- /debian-7.8.0/template.json: -------------------------------------------------------------------------------- 1 | { 2 | "builders": [ 3 | { 4 | "type": "virtualbox-iso", 5 | "guest_os_type": "Debian_64", 6 | "disk_size": 10140, 7 | 8 | "iso_checksum": "a91fba5001cf0fbccb44a7ae38c63b6e", 9 | "iso_checksum_type": "md5", 10 | "iso_url": "http://cdimage.debian.org/mirror/cdimage/release/current/amd64/iso-cd/debian-7.8.0-amd64-netinst.iso", 11 | 12 | "ssh_username": "vagrant", 13 | "ssh_password": "vagrant", 14 | "ssh_wait_timeout": "60m", 15 | 16 | "headless": false, 17 | "http_directory": "debian-7.8.0/", 18 | 19 | "boot_wait": "10s", 20 | "boot_command": [ 21 | "", 22 | "install ", 23 | " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ", 24 | " debian-installer=en_US ", 25 | " auto ", 26 | " locale=en_US ", 27 | " kbd-chooser/method=us ", 28 | " netcfg/get_hostname=wheezy-xen ", 29 | " netcfg/get_domain=local ", 30 | " fb=false ", 31 | " debconf/frontend=noninteractive ", 32 | " console-setup/ask_detect=false ", 33 | " console-keymaps-at/keymap=us ", 34 | " keyboard-configuration/xkb-keymap=us ", 35 | " " 36 | ], 37 | 38 | "shutdown_command": "echo 'halt -p' > shutdown.sh; echo 'vagrant'|sudo -S sh 'shutdown.sh'", 39 | "vboxmanage": [ 40 | ["modifyvm", "{{.Name}}", "--memory", "2048"], 41 | ["modifyvm", "{{.Name}}", "--cpus", "1"] 42 | ] 43 | } 44 | ], 45 | "post-processors": [ 46 | { 47 | "type": "vagrant", 48 | "compression_level": 9, 49 | "output": "boxes/debian-7.8.0-amd64.box" 50 | } 51 | ], 52 | "provisioners": [ 53 | { 54 | "type": "shell", 55 | "execute_command": "echo 'vagrant' | sudo -S -E sh {{.Path}}", 56 | "override": { 57 | "virtualbox-iso": { 58 | "scripts": [ 59 | "scripts/base.sh", 60 | "scripts/base-debian.sh", 61 | "scripts/vagrant.sh", 62 | "scripts/virtualbox.sh" 63 | ] 64 | } 65 | } 66 | } 67 | ] 68 | } 69 | -------------------------------------------------------------------------------- /scripts/base-debian.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -ex 4 | 5 | BACKPORTS=http://http.us.debian.org/debian 6 | MIRROR=ftp.uk.debian.org 7 | 8 | ## backports good -- git 1.8 please 9 | grep wheezy-backports /etc/apt/sources.list || 10 | (echo "deb $BACKPORTS wheezy-backports main" >> /etc/apt/sources.list) 11 | 12 | sed -i "s/http.us.debian.org/$MIRROR/g" /etc/apt/sources.list 13 | apt-get update -y 14 | apt-get -y -t wheezy-backports install "git" 15 | 16 | # echo 'vagrant ALL=NOPASSWD:ALL' > /etc/sudoers.d/vagrant 17 | # echo 'UseDNS no' >> /etc/ssh/sshd_config 18 | 19 | # Remove 5s grub timeout to speed up booting 20 | cat < /etc/default/grub 21 | # If you change this file, run 'update-grub' afterwards to update 22 | # /boot/grub/grub.cfg. 23 | 24 | GRUB_DEFAULT=0 25 | GRUB_TIMEOUT=0 26 | GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` 27 | GRUB_CMDLINE_LINUX_DEFAULT="quiet" 28 | GRUB_CMDLINE_LINUX="debian-installer=en_US" 29 | EOF 30 | 31 | update-grub 32 | -------------------------------------------------------------------------------- /scripts/base-ubuntu.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -ex 4 | 5 | apt-get install -y git 6 | -------------------------------------------------------------------------------- /scripts/base-xenserver.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | useradd -G wheel --create-home -s /bin/bash vagrant 4 | 5 | sed -i -e 's/net.bridge.bridge-nf-call-iptables = 0/net.bridge.bridge-nf-call-iptables = 1/g' /etc/sysctl.conf 6 | sed -i -e 's/net.bridge.bridge-nf-call-arptables = 0/net.bridge.bridge-nf-call-arptables = 1/g' /etc/sysctl.conf 7 | /opt/xensource/libexec/xen-cmdline --set-xen dom0_mem=400M,max:400M 8 | -------------------------------------------------------------------------------- /scripts/base.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -ex 4 | 5 | apt-get update -y 6 | apt-get upgrade -y 7 | -------------------------------------------------------------------------------- /scripts/cleanup.sh: -------------------------------------------------------------------------------- 1 | rm -rf /tmp/hotfixes 2 | 3 | xe host-management-disable 4 | IFS=","; for pif in $(xe pif-list params=uuid --minimal); do 5 | xe pif-unplug uuid=$pif 6 | xe pif-forget uuid=$pif 7 | done 8 | 9 | . /etc/xensource-inventory 10 | xe pif-scan host-uuid=${INSTALLATION_UUID} 11 | PIF=$(xe pif-list device=eth0 params=uuid --minimal) 12 | xe pif-reconfigure-ip uuid=${PIF} mode=dhcp 13 | xe pif-plug uuid=${PIF} 14 | 15 | ifconfig eth0 up 16 | dhclient eth0 17 | -------------------------------------------------------------------------------- /scripts/finish.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -ex 4 | 5 | apt-get -y autoremove 6 | apt-get -y clean 7 | 8 | rm -f /var/lib/dhcp/* # clean up dhcp leases 9 | rm -f ~vagrant/*.sh # clean up leftover scripts 10 | reboot 11 | -------------------------------------------------------------------------------- /scripts/mirage.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -ex 4 | 5 | sudo apt-get install -y libssl-dev pkg-config # required by many mirage apps 6 | opam install mirage --yes # install mirage 7 | -------------------------------------------------------------------------------- /scripts/networking.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -ex 4 | 5 | apt-get install -y dnsmasq avahi-daemon # networking 6 | 7 | cat <> /etc/dnsmasq.conf 11 | -------------------------------------------------------------------------------- /scripts/opam.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -ex 4 | 5 | rm -rf ~/.config ~/bin ~/.opam 6 | sudo apt-get install -y ocaml ocaml-native-compilers camlp4-extra # ocaml 7 | 8 | DISTRO=$(cut -f 1 -d ' ' /etc/issue) 9 | if [ "$DISTRO" = "Debian" ] ; then 10 | ## can't get 0install to work on Debian 7.8.0 11 | wget http://download.opensuse.org/repositories/home:ocaml/Debian_7.0/Release.key 12 | sudo apt-key add - < Release.key 13 | echo 'deb http://download.opensuse.org/repositories/home:/ocaml/Debian_7.0/ /' |\ 14 | sudo tee -a /etc/apt/sources.list.d/opam.list > /dev/null 15 | sudo apt-get update 16 | sudo apt-get install -y opam 17 | 18 | else # not-Debian 19 | mkdir ~/bin 20 | export PATH=$HOME/bin:$PATH 21 | sudo apt-get install -y aspcud curl zeroinstall-injector # 0install 22 | 0install add opam http://tools.ocaml.org/opam.xml # opam 23 | 24 | fi 25 | 26 | opam init --verbose --auto-setup --yes 27 | 28 | if [ "$DISTRO" = "Debian" ] ; then 29 | opam switch 4.02.1 # Debian still on ocaml-3.12.1 ... 30 | fi 31 | 32 | eval $(opam config env) 33 | rm -f Release.key 34 | -------------------------------------------------------------------------------- /scripts/packages.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -ex 4 | 5 | apt-get update -y 6 | apt-get upgrade -y 7 | 8 | apt-get install -y linux-headers-$(uname -r) build-essential m4 # dev environment 9 | apt-get install -y ssh # ssh and scp 10 | apt-get install -y tcpdump # for debugging 11 | apt-get install -y ntp # sanity 12 | apt-get install -y nfs-common nfs-kernel-server # file sharing 13 | -------------------------------------------------------------------------------- /scripts/reboot.sh: -------------------------------------------------------------------------------- 1 | reboot 2 | sleep 60 3 | -------------------------------------------------------------------------------- /scripts/vagrant.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -ex 4 | 5 | date > /etc/vagrant_box_build_time 6 | 7 | useradd -G sudo --create-home -s /bin/bash vagrant || true 8 | 9 | mkdir -pm 700 /home/vagrant/.ssh 10 | wget --no-check-certificate \ 11 | 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' \ 12 | -O /home/vagrant/.ssh/authorized_keys 13 | chmod 0600 /home/vagrant/.ssh/authorized_keys 14 | chown -R vagrant /home/vagrant/.ssh 15 | 16 | echo 'vagrant:vagrant' | chpasswd 17 | echo 'UseDNS no' >> /etc/ssh/sshd_config 18 | echo "vagrant ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers 19 | sed -i -e "s/Defaults requiretty/#Defaults requiretty/g" /etc/sudoers 20 | 21 | mkdir -p /vagrant || true 22 | 23 | echo 'Welcome to your Vagrant-built virtual machine.' > /var/run/motd || true 24 | -------------------------------------------------------------------------------- /scripts/virtualbox.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -ex 4 | 5 | if [ -f .vbox_version ] ; then 6 | # remove old VirtualBox support if installed 7 | if [ -f /etc/init.d/virtualbox-ose-guest-utils ] ; then 8 | /etc/init.d/virtualbox-ose-guest-utils stop 9 | fi 10 | 11 | rmmod vboxguest || true 12 | aptitude -y purge \ 13 | virtualbox-ose-guest-x11 \ 14 | virtualbox-ose-guest-dkms \ 15 | virtualbox-ose-guest-utils 16 | 17 | apt-get install -y dkms # for dynamic compiles 18 | apt-get -y install --no-install-recommends libdbus-1-3 # reqd for autostart 19 | 20 | # Install the VirtualBox guest additions 21 | mount -o loop VBoxGuestAdditions.iso /mnt 22 | ( yes | sh /mnt/VBoxLinuxAdditions.run ) || true 23 | umount /mnt 24 | rm -f VBoxGuestAdditions.iso 25 | 26 | # Start the newly build driver 27 | /etc/init.d/vboxadd start 28 | fi 29 | -------------------------------------------------------------------------------- /scripts/xen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -ex 4 | 5 | HOST=$(uname -n) 6 | case $HOST in 7 | wheezy-xen ) XENPKG=xen-hypervisor-4.1-amd64 ;; 8 | default ) XENPKG=xen-hypervisor-4.4-amd64 ;; 9 | esac 10 | 11 | apt-get install -y $XENPKG bridge-utils xen-tools 12 | 13 | dpkg-divert --divert /etc/grub.d/08_linux_xen --rename /etc/grub.d/20_linux_xen 14 | 15 | update-grub 16 | 17 | echo >> /etc/network/interfaces <", 22 | "", 23 | "", 24 | "/install/vmlinuz", 25 | " auto", 26 | " console-setup/ask_detect=false", 27 | " console-setup/layoutcode=us", 28 | " console-setup/modelcode=pc105", 29 | " debconf/frontend=noninteractive", 30 | " debian-installer=en_US", 31 | " fb=false", 32 | " initrd=/install/initrd.gz", 33 | " kbd-chooser/method=us", 34 | " keyboard-configuration/layout=USA", 35 | " keyboard-configuration/variant=USA", 36 | " locale=en_US", 37 | " netcfg/get_hostname=trustytahr-xen", 38 | " netcfg/get_domain=local", 39 | " noapic", 40 | " hostname={{.Name}}", 41 | " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg", 42 | " -- ", 43 | "" 44 | ], 45 | 46 | "shutdown_command": "echo 'vagrant' | sudo -S -E shutdown -P now", 47 | "hard_drive_interface": "sata", 48 | "vboxmanage": [ 49 | ["modifyvm", "{{.Name}}", "--memory", "2048"], 50 | ["modifyvm", "{{.Name}}", "--cpus", "1"] 51 | ] 52 | } 53 | ], 54 | "post-processors": [ 55 | { 56 | "type": "vagrant", 57 | "compression_level": 9, 58 | "output": "boxes/ubuntu-14.04-amd64.box" 59 | } 60 | ], 61 | "provisioners": [ 62 | { 63 | "type": "shell", 64 | "execute_command": "echo 'vagrant' | sudo -S -E sh {{.Path}}", 65 | "override": { 66 | "virtualbox-iso": { 67 | "scripts": [ 68 | "scripts/base.sh", 69 | "scripts/base-ubuntu.sh", 70 | "scripts/vagrant.sh", 71 | "scripts/virtualbox.sh", 72 | "scripts/zerodisk.sh" 73 | ] 74 | } 75 | } 76 | } 77 | ] 78 | } 79 | -------------------------------------------------------------------------------- /ubuntu-14.10/Vagrantfile: -------------------------------------------------------------------------------- 1 | # -*- mode: ruby -*- 2 | 3 | VAGRANTFILE_API_VERSION = "2" 4 | 5 | Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| 6 | 7 | config.vm.box = "ubuntu-14.10-xen" 8 | 9 | # config.vm.network :forwarded_port, guest: 80, host: 8080 10 | # config.vm.network :private_network, ip: "192.168.77.2" 11 | 12 | # config.vm.synced_folder "/tmp/mirage-vagrant-vms", "/host", type: "nfs" 13 | config.vm.synced_folder ".", "/vagrant", disabled: true 14 | 15 | config.vm.provider :virtualbox do |vb| 16 | vb.gui = false 17 | end 18 | 19 | config.vm.provision "shell", path: "../scripts/packages.sh" 20 | config.vm.provision "shell", path: "../scripts/xen.sh" 21 | config.vm.provision "shell", path: "../scripts/networking.sh" 22 | config.vm.provision "shell", path: "../scripts/opam.sh", privileged: false 23 | config.vm.provision "shell", path: "../scripts/mirage.sh", privileged: false 24 | config.vm.provision "shell", path: "../scripts/finish.sh" 25 | 26 | end 27 | -------------------------------------------------------------------------------- /ubuntu-14.10/preseed.cfg: -------------------------------------------------------------------------------- 1 | choose-mirror-bin mirror/http/proxy string 2 | 3 | d-i base-installer/kernel/override-image string linux-server 4 | 5 | 6 | # HTTP mirror configuration. 7 | d-i mirror/country string United Kingdom 8 | d-i mirror/protocol string http 9 | d-i mirror/http/hostname string GB.archive.ubuntu.com 10 | d-i mirror/http/directory string /ubuntu 11 | d-i mirror/http/mirror select GB.archive.ubuntu.com 12 | 13 | d-i clock-setup/utc boolean true 14 | d-i clock-setup/utc-auto boolean true 15 | 16 | d-i finish-install/reboot_in_progress note 17 | 18 | d-i grub-installer/only_debian boolean true 19 | d-i grub-installer/with_other_os boolean true 20 | 21 | d-i partman-auto-lvm/guided_size string max 22 | d-i partman-auto/choose_recipe select atomic 23 | d-i partman-auto/method string lvm 24 | d-i partman-lvm/confirm boolean true 25 | d-i partman-lvm/confirm boolean true 26 | d-i partman-lvm/confirm_nooverwrite boolean true 27 | d-i partman-lvm/device_remove_lvm boolean true 28 | 29 | d-i partman/choose_partition select finish 30 | d-i partman/confirm boolean true 31 | d-i partman/confirm_nooverwrite boolean true 32 | d-i partman/confirm_write_new_label boolean true 33 | 34 | d-i passwd/user-fullname string vagrant 35 | d-i passwd/user-uid string 900 36 | d-i passwd/user-password password vagrant 37 | d-i passwd/user-password-again password vagrant 38 | d-i passwd/username string vagrant 39 | 40 | d-i pkgsel/include string openssh-server 41 | d-i pkgsel/install-language-support boolean false 42 | d-i pkgsel/update-policy select unattended-upgrades 43 | d-i pkgsel/upgrade select full-upgrade 44 | 45 | d-i time/zone string UTC 46 | 47 | d-i user-setup/allow-password-weak boolean true 48 | d-i user-setup/encrypt-home boolean false 49 | 50 | tasksel tasksel/first multiselect standard, ubuntu-server 51 | -------------------------------------------------------------------------------- /ubuntu-14.10/template.json: -------------------------------------------------------------------------------- 1 | { 2 | "builders": [ 3 | { 4 | "type": "virtualbox-iso", 5 | "guest_os_type": "Ubuntu_64", 6 | "disk_size": 10140, 7 | 8 | "iso_checksum": "91bd1cfba65417bfa04567e4f64b5c55", 9 | "iso_checksum_type": "md5", 10 | "iso_url": "http://releases.ubuntu.com/14.10/ubuntu-14.10-server-amd64.iso", 11 | 12 | "ssh_username": "vagrant", 13 | "ssh_password": "vagrant", 14 | "ssh_wait_timeout": "60m", 15 | 16 | "headless": false, 17 | "http_directory": "ubuntu-14.10/", 18 | 19 | "boot_wait": "10s", 20 | "boot_command": [ 21 | "", 22 | "", 23 | "", 24 | "/install/vmlinuz", 25 | " auto", 26 | " console-setup/ask_detect=false", 27 | " console-setup/layoutcode=us", 28 | " console-setup/modelcode=pc105", 29 | " debconf/frontend=noninteractive", 30 | " debian-installer=en_US", 31 | " fb=false", 32 | " initrd=/install/initrd.gz", 33 | " kbd-chooser/method=us", 34 | " keyboard-configuration/layout=USA", 35 | " keyboard-configuration/variant=USA", 36 | " locale=en_US", 37 | " netcfg/get_hostname=utopicunicorn-xen", 38 | " netcfg/get_domain=local", 39 | " noapic", 40 | " hostname={{.Name}}", 41 | " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg", 42 | " -- ", 43 | "" 44 | ], 45 | 46 | "shutdown_command": "echo 'vagrant' | sudo -S -E shutdown -P now", 47 | "hard_drive_interface": "sata", 48 | "vboxmanage": [ 49 | ["modifyvm", "{{.Name}}", "--memory", "2048"], 50 | ["modifyvm", "{{.Name}}", "--cpus", "1"] 51 | ] 52 | } 53 | ], 54 | "post-processors": [ 55 | { 56 | "type": "vagrant", 57 | "compression_level": 9, 58 | "output": "boxes/ubuntu-14.10-amd64.box" 59 | } 60 | ], 61 | "provisioners": [ 62 | { 63 | "type": "shell", 64 | "execute_command": "echo 'vagrant' | sudo -S -E sh {{.Path}}", 65 | "override": { 66 | "virtualbox-iso": { 67 | "scripts": [ 68 | "scripts/base.sh", 69 | "scripts/base-ubuntu.sh", 70 | "scripts/vagrant.sh", 71 | "scripts/virtualbox.sh", 72 | "scripts/zerodisk.sh" 73 | ] 74 | } 75 | } 76 | } 77 | ] 78 | } 79 | -------------------------------------------------------------------------------- /xenserver-6.5.0/Vagrantfile: -------------------------------------------------------------------------------- 1 | # -*- mode: ruby -*- 2 | 3 | VAGRANTFILE_API_VERSION = "2" 4 | 5 | Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| 6 | 7 | config.vm.box = "xenserver-6.5.0-xen" 8 | 9 | # disable mounting of vagrant folder as its not supported on xenserver 10 | config.vm.synced_folder ".", "/vagrant", disabled: true 11 | 12 | # disable checking for vbguest versions as its not supported on xenserver 13 | if Vagrant.has_plugin?("vagrant-vbguest") 14 | config.vbguest.auto_update = false 15 | end 16 | 17 | config.vm.network :private_network, :auto_config => false , :ip => "192.168.56.10" 18 | 19 | config.vm.provider "virtualbox" do |vb| 20 | vb.gui = false 21 | vb.customize ["modifyvm", :id, "--memory", 2048] 22 | vb.customize [ "modifyvm", :id, "--nicpromisc2", "allow-all" ] 23 | end 24 | 25 | end 26 | -------------------------------------------------------------------------------- /xenserver-6.5.0/answerfile: -------------------------------------------------------------------------------- 1 | 2 | 3 | sda 4 | us 5 | 6 | password 7 | bridge 8 | 9 | Europe/London 10 | ntp 11 | 0.uk.pool.ntp.org 12 | 1.uk.pool.ntp.org 13 | 2.uk.pool.ntp.org 14 | 15 | -------------------------------------------------------------------------------- /xenserver-6.5.0/template.json: -------------------------------------------------------------------------------- 1 | { 2 | "builders": [ 3 | { 4 | "type": "virtualbox-iso", 5 | "guest_os_type": "RedHat_64", 6 | "disk_size": 51200, 7 | 8 | "iso_checksum": "b6a5ce472a0010f5847669e624f06326", 9 | "iso_checksum_type": "md5", 10 | "iso_url": "http://downloadns.citrix.com.edgesuite.net/akdlm/10175/XenServer-6.5.0-xenserver.org-install-cd.iso", 11 | 12 | "ssh_username": "root", 13 | "ssh_password": "password", 14 | "ssh_wait_timeout": "10000s", 15 | 16 | "headless": false, 17 | "http_directory": "xenserver-6.5.0/", 18 | 19 | "boot_wait": "5s", 20 | "boot_command": [ 21 | "menu.c32", 22 | "", 23 | "", 24 | "", 25 | "answerfile=http://{{ .HTTPIP }}:{{ .HTTPPort }}/answerfile install ", 26 | "--- /install.img" 27 | ], 28 | 29 | "shutdown_command": "/sbin/shutdown -hP now", 30 | "vboxmanage": [ 31 | ["modifyvm", "{{.Name}}", "--memory", "2048"], 32 | ["modifyvm", "{{.Name}}", "--cpus", "1"] 33 | ], 34 | 35 | "guest_additions_mode": "disable", 36 | "guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso" 37 | } 38 | ], 39 | "post-processors": [ 40 | { 41 | "type": "vagrant", 42 | "compression_level": 9, 43 | "output": "boxes/xenserver-6.5.0-amd64.box" 44 | } 45 | ], 46 | "provisioners": [ 47 | { 48 | "type": "shell", 49 | "scripts": [ 50 | "scripts/base-xenserver.sh", 51 | "scripts/vagrant.sh", 52 | "scripts/cleanup.sh", 53 | "scripts/zerodisk.sh" 54 | ] 55 | } 56 | ] 57 | } 58 | --------------------------------------------------------------------------------