blob: f45e95f17a1d6962f836e7c99c854242d15801b1 [file] [log] [blame]
Jonathan Hart53433b52015-03-26 17:23:34 -07001#!/bin/bash
2# vm-setup.sh
3#
4# This script sets up the VM ready to run ONOS and tutorials, including installing an LXC cluster
5# for ONOS to run in.
6
7sudo apt-get update
8
9sudo apt-get install -y git openjdk-8-jdk maven unzip quagga curl erlang make gcc wget autoconf openssl libssl0.9.8 libssl-dev libncurses5 libncurses5-dev wireshark
10sudo update-alternatives --set java /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
11sudo update-alternatives --set javac /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
12
13sudo lxc-create --name onos1 -t download -- --dist ubuntu --release trusty --arch amd64
14
15sudo sh -c "echo lxc.network.ipv4=10.0.3.11 >> /var/lib/lxc/onos1/config"
16sudo sh -c "echo lxc.start.auto=1 >> /var/lib/lxc/onos1/config"
17
18sudo lxc-start --name onos1 --daemon
19sudo lxc-attach --name onos1 -- useradd -m sdn -s /bin/bash
20sudo lxc-attach --name onos1 -- /bin/bash -c "echo sdn:rocks | chpasswd"
21sudo lxc-attach --name onos1 -- /bin/bash -c "echo \"sdn ALL=(ALL) NOPASSWD:ALL\" > /etc/sudoers.d/sdn"
22sudo lxc-attach --name onos1 -- apt-get update
23sudo lxc-attach --name onos1 -- apt-get install openssh-server
24sudo lxc-attach --name onos1 -- apt-get install software-properties-common -y
25sudo lxc-attach --name onos1 -- add-apt-repository ppa:webupd8team/java -y
26sudo lxc-attach --name onos1 -- apt-get update
27sudo lxc-attach --name onos1 -- apt-get install oracle-java8-installer oracle-java8-set-default -y
28sudo lxc-stop --name onos1