summaryrefslogtreecommitdiffstats
path: root/vagrant/Vagrantfile
blob: 58fa2b0a9dd8c8f60812bfecb2b58dc19e6bb781 (plain)
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
41
42
43
44
45
46
47
48
# -*- mode: ruby -*-
# vi: set ft=ruby :
#
# Tails: The Amnesic Incognito Live System
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

require_relative 'lib/tails_build_settings'

ENV['VAGRANT_DEFAULT_PROVIDER'] = 'libvirt'

Vagrant.configure("2") do |config|
  config.vm.box = 'tails-builder-amd64-jessie-20160226'
  config.vm.box_url = "http://dl.amnesia.boum.org/tails/project/vagrant/#{config.vm.box}.box"
  config.vm.box_download_checksum_type = "sha256"
  config.vm.box_download_checksum = 'a63298b7cae7cbc2ad3e2c01763a11b29ee8ac879398e007ae22857da5b2c6de'
  config.vm.provision "shell", inline: <<-EOF
    sudo http_proxy='#{ENV['http_proxy']}' /vagrant/provision/setup-tails-builder
  EOF
  config.vm.synced_folder '.', '/vagrant', type: '9p', readonly: true
  config.vm.synced_folder '../', '/amnesia.git', type: '9p', readonly: true
  config.vm.provider :libvirt do |domain|
    domain.default_prefix = config.vm.box
    domain.driver = 'kvm'
    domain.management_network_guest_ipv6 = 'no'
    domain.connect_via_ssh = false
    domain.machine_arch = 'x86_64'
    domain.machine_type = 'q35'
    domain.cpu_mode = 'host-passthrough'
    domain.emulator_path = '/usr/bin/qemu-system-x86_64'
    domain.memory = ENV['TAILS_RAM_BUILD'] ? VM_MEMORY_FOR_RAM_BUILDS :
                                             VM_MEMORY_FOR_DISK_BUILDS
    cpus = ENV['TAILS_BUILD_CPUS']
    domain.cpus = cpus unless cpus.nil?
    domain.storage :file, :size => '15G', :allow_existing => true, :cache => 'none'
  end
end