-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathVagrantfile
83 lines (68 loc) · 3.47 KB
/
Vagrantfile
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# -*- mode: ruby -*-
# vi: set ft=ruby :
# install mininet + firefox
# install xterm (DEBUG ONLY)
# install ffmpeg (required to play video)
$RUN_PROBE = <<SCRIPT
service vboxguest enable
service vboxservice enable
# pwd
apt-get update
apt-get install -y firefox
apt-get install -y ffmpeg
apt-get install -y python2
apt-get install -y net-tools
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 2
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1
git clone git://github.com/mininet/mininet
# cd mininet && git tag && git checkout 2.3.0d6 && cd util && rm install.sh && wget https://gist.githubusercontent.com/janev94/c443075986ec344359904c9ceba93f2b/raw/99c9146940450beb155a31cb5b30c38643466b46/install.sh && chmod u+x install.sh && cd ../..
echo `pwd`
export LC_ALL=C
# Cannot use -a flag on install.sh as pox requires python-scapy package which is no longer supported in 20.04
sudo mininet/util/install.sh -fnv
apt-get install -y nginx
apt-get install -y iperf3
# Create virtual envrionment for plotting results
# apt-get install -y python3-venv
# apt-get install -y virtualenv
# cd /vagrant && virtualenv plotter -p python3 --always-copy && plotter/bin/pip install -r deps/requirements.txt
apt-get install -y python3-pip
cd /vagrant && pip3 install -r deps/requirements.txt
#DNS does not work on some machines, unless some traffic has gone out already
#ping -c 3 google.com
SCRIPT
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/focal64"
config.vm.box_version = "20201103.0.0"
# enable X11 forwarding
config.ssh.forward_agent = true
config.ssh.forward_x11 = true
config.vm.provider :virtualbox do |v|
v.customize ["modifyvm", :id, "--memory", "16384"]
v.customize ["modifyvm", :id, "--cpus", "4"]
v.customize ["modifyvm", :id, "--hwvirtex", "on"]
v.customize ["modifyvm", :id, "--nestedpaging", "on"]
v.customize ["modifyvm", :id, "--largepages", "on"]
v.customize ["modifyvm", :id, "--acpi", "on"]
v.customize ["modifyvm", :id, "--apic", "on"]
v.customize ["modifyvm", :id, "--ioapic", "on"]
v.customize ["modifyvm", :id, "--x2apic", "on"]
v.customize ["modifyvm", :id, "--biosapic", "x2apic"]
v.customize ["modifyvm", :id, "--hpet", "on"]
v.customize ["modifyvm", :id, "--rtcuseutc", "on"]
v.customize ["modifyvm", :id, "--paravirtprovider", "kvm"]
v.customize ["modifyvm", :id, "--nictype1", "virtio"]
v.customize ["modifyvm", :id, "--nictype2", "virtio"]
v.customize ["modifyvm", :id, "--cableconnected1", "on"]
v.customize ["modifyvm", :id, "--audio", "none"]
v.customize ["modifyvm", :id, "--usb", "off"]
v.customize ["modifyvm", :id, "--usbehci", "off"]
v.customize ["modifyvm", :id, "--usbxhci", "off"]
v.customize ["modifyvm", :id, "--usbcardreader", "off"]
# v.customize ["modifyvm", :id, "--accelerate2dvideo", "on"]
# v.customize ["modifyvm", :id, "--accelerate3d", "on"]
v.customize ["modifyvm", :id, "--vram", "256"]
# v.customize ["modifyvm", :id, "--graphicscontroller", "VBoxSVGA"]
end
config.vm.provision "shell", privileged: true, inline: $RUN_PROBE
end