blob: 5d983e16490464fb25a9bcf47231fc48aac31540 [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
Jonathan Hart5815d9e2015-03-26 17:38:24 -07009# TODO erlang, quagga, wireshark
10sudo apt-get install -y git openjdk-8-jdk maven unzip curl make gcc wget autoconf openssl libssl0.9.8 libssl-dev libncurses5 libncurses5-dev lxc
Jonathan Hart53433b52015-03-26 17:23:34 -070011sudo update-alternatives --set java /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
12sudo update-alternatives --set javac /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
13
14sudo lxc-create --name onos1 -t download -- --dist ubuntu --release trusty --arch amd64
15
16sudo sh -c "echo lxc.network.ipv4=10.0.3.11 >> /var/lib/lxc/onos1/config"
17sudo sh -c "echo lxc.start.auto=1 >> /var/lib/lxc/onos1/config"
18
19sudo lxc-start --name onos1 --daemon
20sudo lxc-attach --name onos1 -- useradd -m sdn -s /bin/bash
21sudo lxc-attach --name onos1 -- /bin/bash -c "echo sdn:rocks | chpasswd"
22sudo lxc-attach --name onos1 -- /bin/bash -c "echo \"sdn ALL=(ALL) NOPASSWD:ALL\" > /etc/sudoers.d/sdn"
23sudo lxc-attach --name onos1 -- apt-get update
24sudo lxc-attach --name onos1 -- apt-get install openssh-server
25sudo lxc-attach --name onos1 -- apt-get install software-properties-common -y
26sudo lxc-attach --name onos1 -- add-apt-repository ppa:webupd8team/java -y
27sudo lxc-attach --name onos1 -- apt-get update
28sudo lxc-attach --name onos1 -- apt-get install oracle-java8-installer oracle-java8-set-default -y
29sudo lxc-stop --name onos1