Statistics
| Branch: | Tag: | Revision:

mininet / util / vm / install-mininet-vm.sh @ 400bbbac

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