carlosmscabral | f40ecd1 | 2013-02-01 18:15:58 -0200 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | # This script is intended to install Mininet into |
| 4 | # a brand-new Ubuntu virtual machine, |
| 5 | # to create a fully usable "tutorial" VM. |
| 6 | set -e |
| 7 | echo `whoami` ALL=NOPASSWD: ALL | sudo tee -a /etc/sudoers |
| 8 | sudo sed -i -e 's/Default/#Default/' /etc/sudoers |
| 9 | sudo sed -i -e 's/ubuntu/mininet-vm/' /etc/hostname |
| 10 | sudo sed -i -e 's/ubuntu/mininet-vm/g' /etc/hosts |
| 11 | sudo hostname `cat /etc/hostname` |
| 12 | sudo sed -i -e 's/quiet splash/text/' /etc/default/grub |
| 13 | sudo update-grub |
| 14 | sudo sed -i -e 's/us.archive.ubuntu.com/mirrors.kernel.org/' \ |
| 15 | /etc/apt/sources.list |
| 16 | sudo apt-get update |
| 17 | # Clean up vmware easy install junk if present |
| 18 | if [ -e /etc/issue.backup ]; then |
| 19 | sudo mv /etc/issue.backup /etc/issue |
| 20 | fi |
| 21 | if [ -e /etc/rc.local.backup ]; then |
| 22 | sudo mv /etc/rc.local.backup /etc/rc.local |
| 23 | fi |
| 24 | # Install Mininet |
| 25 | sudo apt-get -y install git-core openssh-server |
| 26 | git clone git://github.com/mininet/mininet |
| 27 | cd mininet |
| 28 | cd |
| 29 | time mininet/util/install.sh |
| 30 | # Ignoring this since NOX classic is deprecated |
| 31 | #if ! grep NOX_CORE_DIR .bashrc; then |
| 32 | # echo "export NOX_CORE_DIR=~/noxcore/build/src/" >> .bashrc |
| 33 | #fi |
| 34 | echo <<EOF |
| 35 | You may need to reboot and then: |
| 36 | sudo dpkg-reconfigure openvswitch-datapath-dkms |
| 37 | sudo service openvswitch-switch start |
| 38 | EOF |
| 39 | |
| 40 | |