blob: 3afcb008d55670d9ffeae737431415a164e60bb4 [file] [log] [blame]
Jonathan Hart2af01a02014-12-01 21:38:50 -08001#!/bin/bash
2# vm-setup.sh
3#
4# This script installs ONOS dependencies and installs a desktop environment on a Miniet VM.
5
6
7export CURRENT_USER=sdnip
8export USER_HOME=/home/${CURRENT_USER}
9
Jonathan Hart2af01a02014-12-01 21:38:50 -080010# -------------- Setup keys -------------------
11
12mkdir -p ~/.ssh
13ssh-keygen -t dsa -P "" -f .ssh/id_dsa
14cp .ssh/id_dsa.pub .ssh/authorized_keys
15
16# -------------- Setup Desktop ---------------
17
18DESKTOP=${USER_HOME}/Desktop
19
20mkdir -p ${DESKTOP}
21
22cat > ${DESKTOP}/ONOS << EOF
23[Desktop Entry]
24Encoding=UTF-8
25Type=Application
26Name=ONOS
27Name[en_US]=ONOS
28Icon=konsole
29Exec=/usr/bin/lxterminal -e '/opt/onos/apache-karaf-3.0.2/bin/client -u karaf'
30Comment[en_US]=
31EOF
32
Jonathan Harteb3f0542014-12-02 16:27:40 -080033cat > "${DESKTOP}/SDN-IP Mininet" << EOF
Jonathan Hart2af01a02014-12-01 21:38:50 -080034[Desktop Entry]
35Encoding=UTF-8
36Type=Application
Jonathan Harteb3f0542014-12-02 16:27:40 -080037Name=SDN-IP Mininet
38Name[en_US]=SDN-IP Mininet
Jonathan Hart2af01a02014-12-01 21:38:50 -080039Icon=konsole
Jonathan Hartcc03dc72014-12-02 00:08:54 -080040Exec=/usr/bin/lxterminal -e 'sudo mn --custom /home/sdnip/sdnip/tutorial.py --topo sdnip --controller remote --nolistenport'
Jonathan Hart2af01a02014-12-01 21:38:50 -080041Comment[en_US]=
42EOF
43
44cat > ${DESKTOP}/Tutorial << EOF
45[Desktop Entry]
46Encoding=UTF-8
47Type=Application
48Name=SDN-IP Tutorial
49Name[en_US]=SDN-IP Tutorial
50Icon=internet-web-browser
51Exec=/usr/bin/chromium-browser https://wiki.onosproject.org/display/ONOS/SDN-IP+Tutorial
52Comment[en_US]=
53EOF
54
55cat > ${DESKTOP}/GUI << EOF
56[Desktop Entry]
57Encoding=UTF-8
58Type=Application
59Name=ONOS GUI
60Name[en_US]=ONOS GUI
61Icon=internet-web-browser
62Exec=/usr/bin/chromium-browser http://localhost:8181/onos/ui/index.html#topo
63Comment[en_US]=
64EOF
65
66cat > ${DESKTOP}/Wireshark << EOF
67[Desktop Entry]
68Encoding=UTF-8
69Type=Application
70Name=Wireshark
71Name[en_US]=Wireshark
72Icon=wireshark
73Exec=/usr/bin/wireshark
74Comment[en_US]=
75EOF
76
77cat > ${DESKTOP}/Reset << EOF
78[Desktop Entry]
79Encoding=UTF-8
80Type=Application
81Name=Reset
82Name[en_US]=Reset
83Icon=konsole
84Exec=/usr/bin/lxterminal -t 'Resetting; please wait' -e 'sudo service onos restart'
85Comment[en_US]=
86EOF
Jonathan Hart60d31562014-12-01 21:48:08 -080087
Marc De Leenheerb75cb132015-01-16 10:06:02 -080088
89echo "sudo service onos start > /dev/null 2>&1" >> ~/.profile