blob: bfb49bc4f377ab6885d86bb793a7322212b12528 [file] [log] [blame]
#!/bin/bash
# vm-setup.sh
#
# This script installs ONOS dependencies and installs a desktop environment on a Miniet VM.
ONOS_USER=mininet
ONOS_USER_HOME=/home/${ONOS_USER}
sudo apt-get update
# -------------- Bufferbloat Install ----------
cd ~
git clone https://bitbucket.org/huangty/cs144_bufferbloat.git
sudo apt-get -y install screen
sudo apt-get -y install python-matplotlib
# -------------- BGP-attack Install -----------
git clone https://bitbucket.org/jvimal/bgp.git
cd bgp
./install.sh
cd ~
# ------------- DHCP demo Install ------------
git clone https://bitbucket.org/lantz/cs144-dhcp.git
cd cs144-dhcp
# TODO fix this
#sudo ./dhcp.py --check-required
cd ~
# -------------- Setup Desktop ----------------
sudo apt-get install -y xorg lxde
#TODO: add backgrounds folder
#TODO: change background
# Remove wallpaper, change background color, and disable screensaver
sudo sed -i 's/wallpaper_mode=1/wallpaper_mode=0/g' /usr/share/lxde/pcmanfm/LXDE.conf
sudo sed -i 's/desktop_bg=#000000/desktop_bg=#104187/g' /usr/share/lxde/pcmanfm/LXDE.conf
sudo sed -i '/screensaver/d' /etc/xdg/lxsession/LXDE/autostart
DESKTOP=${ONOS_USER_HOME}/Desktop
mkdir -p ${DESKTOP}
#cat > ${DESKTOP}/Eclipse << EOF
#[Desktop Entry]
#Encoding=UTF-8
#Type=Application
#Name=Eclipse
#Name[en_US]=Eclipse
#Icon=/opt/eclipse/icon.xpm
#Exec=/usr/bin/eclipse
#Comment[en_US]=
#EOF
cat > ${DESKTOP}/Terminal << EOF
[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=Terminal
Name[en_US]=Terminal
Icon=konsole
Exec=/usr/bin/x-terminal-emulator
Comment[en_US]=
EOF
#TODO
cat > ${DESKTOP}/Docs << EOF
[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=ONOS Docs
Name[en_US]=ONOS Docs
Icon=internet-web-browser
Exec=/usr/bin/chromium-browser http://docs.onos.onlab.us
Comment[en_US]=
EOF
cat > ${DESKTOP}/Wireshark << EOF
[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=Wireshark
Name[en_US]=Wireshark
Icon=wireshark
Exec=/usr/bin/wireshark
Comment[en_US]=
EOF
# ------------- Install Other Tools -------------
sudo apt-get install -y wireshark
# Enable root-less wireshark and add mininet
echo "Enabling wireshark group"
echo "wireshark-common wireshark-common/install-setuid boolean true" | sudo debconf-set-selections
sudo dpkg-reconfigure -f noninteractive wireshark-common
sudo usermod -a -G wireshark mininet