Statistics
| Branch: | Tag: | Revision:

mininet / util / vm / install-mininet-vm.sh @ 9aaf87c1

History | View | Annotate | Download (1.23 KB)

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 sed -i -e 's/\/archive.ubuntu.com/\/mirrors.kernel.org/' \
17
	/etc/apt/sources.list
18
sudo apt-get update
19
# Clean up vmware easy install junk if present
20
if [ -e /etc/issue.backup ]; then
21
    sudo mv /etc/issue.backup /etc/issue
22
fi
23
if [ -e /etc/rc.local.backup ]; then
24
    sudo mv /etc/rc.local.backup /etc/rc.local
25
fi
26
# Install Mininet
27
sudo apt-get -y install git-core openssh-server
28
git clone git://github.com/mininet/mininet
29
cd mininet
30
cd
31
time mininet/util/install.sh
32
# Finalize VM
33
time mininet/util/install.sh -tc
34
# Ignoring this since NOX classic is deprecated
35
#if ! grep NOX_CORE_DIR .bashrc; then
36
#  echo "export NOX_CORE_DIR=~/noxcore/build/src/" >> .bashrc
37
#fi
38
echo "Done preparing Mininet VM."
39