Brian O'Connor | 5abe3db | 2014-08-05 02:08:34 -0700 | [diff] [blame] | 1 | #!/bin/bash |
Brian O'Connor | 37f0cc7 | 2014-06-06 20:03:05 -0700 | [diff] [blame] | 2 | # vm-setup.sh |
| 3 | # |
| 4 | # This script installs ONOS dependencies and installs a desktop environment on a Miniet VM. |
| 5 | |
| 6 | ONOS_USER=mininet |
| 7 | ONOS_USER_HOME=/home/${ONOS_USER} |
| 8 | |
Brian O'Connor | 37f0cc7 | 2014-06-06 20:03:05 -0700 | [diff] [blame] | 9 | sudo apt-get update |
| 10 | |
Brian O'Connor | 3ca8402 | 2014-08-11 19:46:54 -0700 | [diff] [blame^] | 11 | # -------------- Bufferbloat Install ---------- |
Brian O'Connor | 10d941e | 2014-06-12 19:55:09 -0700 | [diff] [blame] | 12 | |
Brian O'Connor | 3ca8402 | 2014-08-11 19:46:54 -0700 | [diff] [blame^] | 13 | cd ~ |
| 14 | git clone https://bitbucket.org/huangty/cs144_bufferbloat.git |
| 15 | sudo apt-get -y install screen |
| 16 | sudo apt-get -y install python-matplotlib |
Brian O'Connor | 10d941e | 2014-06-12 19:55:09 -0700 | [diff] [blame] | 17 | |
Brian O'Connor | 3ca8402 | 2014-08-11 19:46:54 -0700 | [diff] [blame^] | 18 | # -------------- BGP-attack Install ----------- |
Brian O'Connor | 10d941e | 2014-06-12 19:55:09 -0700 | [diff] [blame] | 19 | |
Brian O'Connor | 3ca8402 | 2014-08-11 19:46:54 -0700 | [diff] [blame^] | 20 | git clone https://bitbucket.org/jvimal/bgp.git |
| 21 | cd bgp |
| 22 | ./install.sh |
| 23 | cd ~ |
| 24 | |
| 25 | # ------------- DHCP demo Install ------------ |
| 26 | |
| 27 | git clone https://bitbucket.org/lantz/cs144-dhcp.git |
| 28 | cd cs144-dhcp |
| 29 | # TODO fix this |
| 30 | #sudo ./dhcp.py --check-required |
| 31 | cd ~ |
Brian O'Connor | 37f0cc7 | 2014-06-06 20:03:05 -0700 | [diff] [blame] | 32 | |
| 33 | # -------------- Setup Desktop ---------------- |
| 34 | sudo apt-get install -y xorg lxde |
| 35 | |
| 36 | #TODO: add backgrounds folder |
| 37 | #TODO: change background |
| 38 | # Remove wallpaper, change background color, and disable screensaver |
| 39 | sudo sed -i 's/wallpaper_mode=1/wallpaper_mode=0/g' /usr/share/lxde/pcmanfm/LXDE.conf |
| 40 | sudo sed -i 's/desktop_bg=#000000/desktop_bg=#104187/g' /usr/share/lxde/pcmanfm/LXDE.conf |
| 41 | sudo sed -i '/screensaver/d' /etc/xdg/lxsession/LXDE/autostart |
| 42 | |
| 43 | DESKTOP=${ONOS_USER_HOME}/Desktop |
| 44 | |
| 45 | mkdir -p ${DESKTOP} |
| 46 | |
Brian O'Connor | 3ca8402 | 2014-08-11 19:46:54 -0700 | [diff] [blame^] | 47 | #cat > ${DESKTOP}/Eclipse << EOF |
| 48 | #[Desktop Entry] |
| 49 | #Encoding=UTF-8 |
| 50 | #Type=Application |
| 51 | #Name=Eclipse |
| 52 | #Name[en_US]=Eclipse |
| 53 | #Icon=/opt/eclipse/icon.xpm |
| 54 | #Exec=/usr/bin/eclipse |
| 55 | #Comment[en_US]= |
| 56 | #EOF |
Brian O'Connor | 37f0cc7 | 2014-06-06 20:03:05 -0700 | [diff] [blame] | 57 | |
| 58 | cat > ${DESKTOP}/Terminal << EOF |
| 59 | [Desktop Entry] |
| 60 | Encoding=UTF-8 |
| 61 | Type=Application |
| 62 | Name=Terminal |
| 63 | Name[en_US]=Terminal |
| 64 | Icon=konsole |
| 65 | Exec=/usr/bin/x-terminal-emulator |
| 66 | Comment[en_US]= |
| 67 | EOF |
| 68 | |
Brian O'Connor | 3ca8402 | 2014-08-11 19:46:54 -0700 | [diff] [blame^] | 69 | #TODO |
Brian O'Connor | 37f0cc7 | 2014-06-06 20:03:05 -0700 | [diff] [blame] | 70 | cat > ${DESKTOP}/Docs << EOF |
| 71 | [Desktop Entry] |
| 72 | Encoding=UTF-8 |
| 73 | Type=Application |
| 74 | Name=ONOS Docs |
| 75 | Name[en_US]=ONOS Docs |
| 76 | Icon=internet-web-browser |
| 77 | Exec=/usr/bin/chromium-browser http://docs.onos.onlab.us |
| 78 | Comment[en_US]= |
| 79 | EOF |
| 80 | |
| 81 | cat > ${DESKTOP}/Wireshark << EOF |
| 82 | [Desktop Entry] |
| 83 | Encoding=UTF-8 |
| 84 | Type=Application |
| 85 | Name=Wireshark |
| 86 | Name[en_US]=Wireshark |
| 87 | Icon=wireshark |
| 88 | Exec=/usr/bin/wireshark |
| 89 | Comment[en_US]= |
| 90 | EOF |
| 91 | |
| 92 | # ------------- Install Other Tools ------------- |
| 93 | sudo apt-get install -y wireshark |
| 94 | # Enable root-less wireshark and add mininet |
| 95 | echo "Enabling wireshark group" |
| 96 | echo "wireshark-common wireshark-common/install-setuid boolean true" | sudo debconf-set-selections |
| 97 | sudo dpkg-reconfigure -f noninteractive wireshark-common |
| 98 | sudo usermod -a -G wireshark mininet |
| 99 | |