Skip to content

Commit ad9f14f

Browse files
committed
Add VM README
1 parent 40973b3 commit ad9f14f

File tree

3 files changed

+31
-5
lines changed

3 files changed

+31
-5
lines changed

util/vm/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
*.log
22
.vagrant
3+
*.ova

util/vm/README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Scripts to build the tutorial VM
2+
3+
## Requirements
4+
5+
- [Vagrant](https://www.vagrantup.com/) (tested v2.2.5)
6+
- [VirtualBox](https://www.virtualbox.org/wiki/Downloads) (tested with v5.2.32)
7+
8+
## Steps to build
9+
10+
If you want to provision and use the VM locally on your machine:
11+
12+
cd util/vm
13+
vagrant up
14+
15+
Otherwise, if you want to export the VM in `.ova` format for distribution to
16+
tutorial attendees:
17+
18+
cd util/vm
19+
./build-vm.sh
20+
21+
This script will:
22+
23+
1. provision the VM using Vagrant;
24+
2. reduce VM disk size;
25+
3. generate a file named `ngsdn-tutorial.ova`.
26+
27+
Use credentials `sdn`/`rocks` to log in the Ubuntu system.
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@
22

33
set -xe
44

5-
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
6-
75
function wait_vm_shutdown {
86
set +x
97
while vboxmanage showvminfo $1 | grep -c "running (since"; do
10-
echo "Waiting for VM to shutdown..."
11-
sleep 1
8+
echo "Waiting for VM to shutdown..."
9+
sleep 1
1210
done
1311
sleep 2
1412
set -x
@@ -18,7 +16,7 @@ function wait_vm_shutdown {
1816
vagrant up
1917

2018
VB_UUID=$(cat .vagrant/machines/default/virtualbox/id)
21-
VBoxManage snapshot ${VB_UUID} take "pre-cleanup"
19+
VBoxManage snapshot "${VB_UUID}" take "pre-cleanup"
2220

2321
# Cleanup
2422
vagrant ssh -c 'bash /vagrant/cleanup.sh'

0 commit comments

Comments
 (0)