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