Jonathan Hart | 53433b5 | 2015-03-26 17:23:34 -0700 | [diff] [blame] | 1 | #!/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 | |
| 7 | sudo apt-get update |
| 8 | |
| 9 | sudo 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 |
| 10 | sudo update-alternatives --set java /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java |
| 11 | sudo update-alternatives --set javac /usr/lib/jvm/java-8-openjdk-amd64/bin/javac |
| 12 | |
| 13 | sudo lxc-create --name onos1 -t download -- --dist ubuntu --release trusty --arch amd64 |
| 14 | |
| 15 | sudo sh -c "echo lxc.network.ipv4=10.0.3.11 >> /var/lib/lxc/onos1/config" |
| 16 | sudo sh -c "echo lxc.start.auto=1 >> /var/lib/lxc/onos1/config" |
| 17 | |
| 18 | sudo lxc-start --name onos1 --daemon |
| 19 | sudo lxc-attach --name onos1 -- useradd -m sdn -s /bin/bash |
| 20 | sudo lxc-attach --name onos1 -- /bin/bash -c "echo sdn:rocks | chpasswd" |
| 21 | sudo lxc-attach --name onos1 -- /bin/bash -c "echo \"sdn ALL=(ALL) NOPASSWD:ALL\" > /etc/sudoers.d/sdn" |
| 22 | sudo lxc-attach --name onos1 -- apt-get update |
| 23 | sudo lxc-attach --name onos1 -- apt-get install openssh-server |
| 24 | sudo lxc-attach --name onos1 -- apt-get install software-properties-common -y |
| 25 | sudo lxc-attach --name onos1 -- add-apt-repository ppa:webupd8team/java -y |
| 26 | sudo lxc-attach --name onos1 -- apt-get update |
| 27 | sudo lxc-attach --name onos1 -- apt-get install oracle-java8-installer oracle-java8-set-default -y |
| 28 | sudo lxc-stop --name onos1 |