Vnx-install

Installing on Ubuntu 10.04/9.10
This section describes the procedure for installing VNX over Ubuntu 10.04 or 9.10. Open a root shell window and follow these steps: 

Install all packages required (basic development, virtualization, perl libraries and auxiliar packages): apt-get update apt-get install build-essential qemu-kvm libvirt-bin vlan xterm bridge-utils \ screen virt-manager virt-viewer libxml-checker-perl \ libxml-parser-perl libnetaddr-ip-perl libnet-pcap-perl libnet-ipv6addr-perl \ liberror-perl libexception-class-perl uml-utilities libxml-libxml-perl \ libxml2-dev libgnutls-dev libdevmapper-dev libterm-readline-perl-perl libnet-telnet-perl libnet-ip-perl libnet-telnet-cisco-perl libreadonly-perl

If you use 64 bits version of Ubuntu, install 32 bits compatibility libraries: apt-get install ia32-libs

Install libvirt 0.8.5: /etc/init.d/libvirt-bin stop wget http://libvirt.org/sources/libvirt-0.8.5.tar.gz tar xfvz libvirt-0.8.5.tar.gz  cd libvirt-0.8.5 ./configure --without-xen --prefix=/usr && make && make install /etc/init.d/libvirt-bin start

NOTE: VNX should work with libvirt versions from 0.7.5 to 0.8.5 (it has been mainly tested with 0.7.5 and 0.8.5). Note that, although libvirt 0.7.5 is available as a package in Ubuntu 10.04, it has some problems related with the Apparmor profiles configured for libvirt. If you disable Apparmor (with "/etc/init.d/apparmor stop"), VNX will work with libvirt 0.7.5 installed as package, however we recommend to download and compile version 0.8.5 as described above, in order to maintain Apparmor in your system. Install Sys::Virt perl module:  For Ubuntu 10.04, just install the libsys-virt-perl package apt-get install libsys-virt-perl

For Ubuntu 9.10, as Sys::Virt library is not available as a package, install it manually: wget http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.2.3.tar.gz tar xfvz Sys-Virt-0.2.3.tar.gz cd Sys-Virt-0.2.3 perl Makefile.PL make install 

Install VNX:</li> wget -N http://www.dit.upm.es/vnx/download/vnx-0.14b.tgz tar xfvz vnx-0.14b.tgz cd vnx-0.14b ./install_vnx

Download root file systems from http://idefix.dit.upm.es/download/vnx/filesystems and copy them to /usr/share/vnx/filesystems directory:</li> cd /usr/share/vnx/filesystems wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.04-v01.qcow2.bz2 bunzip2 root_fs_ubuntu-10.04-v01.qcow2.bz2 ln -s root_fs_ubuntu-10.04-v01.qcow2 root_fs_ubuntu wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.04-gui-v01.qcow2.bz2 bunzip2 root_fs_ubuntu-10.04-gui-v01.qcow2.bz2 ln -s root_fs_ubuntu-10.04-gui-v01.qcow2 root_fs_ubuntu-gui wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-v01.qcow2.bz2 bunzip2 root_fs_freebsd-v01.qcow2.bz2 ln -s root_fs_freebsd-v01.qcow2 root_fs_freebsd wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-gui-v01.qcow2.bz2 bunzip2 root_fs_freebsd-gui-v01.qcow2.bz2 ln -s root_fs_freebsd-gui-v01.qcow2 root_fs_freebsd-gui
 * 1) ubuntu server
 * 1) ubuntu with gui
 * 1) freebsd server
 * 1) freebsd gui
 * 1) winxp and win7
 * 2) Sorry! Unfortunately for legal reasons we cannot distribute windows XP
 * 3) or Windows 7 root filesystems. See VNX documentation for detailed recipes
 * 4) to create these root fylesystems from scratch

Additionally, if you plan to use VNUML root filesystem:</li> cd /usr/share/vnx/filesystem wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_tutorial-0.6.0.bz2 bunzip2 root_fs_tutorial-0.6.0.bz2 ln -s root_fs_tutorial-0.6.0 root_fs_tutorial cd /usr/share/vnx/kernels wget -N http://jungla.dit.upm.es/~vnx/download/kernels/linux-2.6.18.1-bb2-xt-4m chmod +x linux-2.6.18.1-bb2-xt-4m ln -s linux-2.6.18.1-bb2-xt-4m linux
 * 1) VNUML root_fs_tutorial and kernel

</ul>

NOTE for Ubuntu 10.04.1: It seems that an additional package has to be installed: apt-get install kvm-pxe

Installing on Fedora 11 (Not completed yet)
Follow tis steps to install VNX over Fedora 11: 

 Instalar VNUML sobre Fedora 11 siguiendo la receta en http://www.dit.upm.es/vnumlwiki/index.php/Fedora11</li>

 Instalar paquetes y librerías necesarias:</li> yum install qemu-kvm libvirt virt-manager virt-viewer perl-XML-LibXML perl-Sys-Virt yum -y install bridge-utils readline-devel perl-Module-Build screen expat-devel libpcap-devel yum -y install perl-Net-Pcap perl-NetAddr-IP perl-Net-IPv6Addr perl-XML-DOM perl-Exception-Class yum -y install perl-TermReadKey perl-Error perl-CPAN uml_utilities xterm tunctl

Install XML::Checker perl library:</li> perl -MCPAN -e shell install XML::Checker Add symbolic link for kvm:</li> ln -s /usr/bin/qemu-kvm /usr/bin/kvm

Instalar VNX:</li> wget -N http://idefix.dit.upm.es/download/vnx/vnx-0.12b.tgz tar xfvz vnx-0.12b.tgz cd vnx-0.12b ./install-vnx

Deshabilitar el firewall o, alternativamente, configurar los interfaces tipo "tun" como confiables (Sistema->Firewall->Interfaces Confiables").</li> </ul>

Additional install steps for Dynamips support
apt-get install dynamips dynagen
 * Install Dynamips and Dynagen:


 * Create a file /etc/init.d/dynamips (taken from http://7200emu.hacki.at/viewtopic.php?t=2198):
 * 1) !/bin/sh
 * 2) Start/stop the dynamips program as a daemon.
 * 3) BEGIN INIT INFO
 * 4) Provides:          dynamips
 * 5) Default-Start:     2 3 4 5
 * 6) Default-Stop:      0 1 6
 * 7) Short-Description: Cisco hardware emulator daemon
 * 8) END INIT INFO
 * 1) END INIT INFO

DAEMON=/usr/bin/dynamips NAME=dynamips PORT=7200 PIDFILE=/var/run/$NAME.pid LOGFILE=/var/log/$NAME.log DESC="Cisco Emulator" SCRIPTNAME=/etc/init.d/$NAME

test -f $DAEMON || exit 0

. /lib/lsb/init-functions

case "$1" in start) log_daemon_msg "Starting $DESC " "$NAME"        start-stop-daemon --start --chdir /tmp --background --make-pidfile --pidfile $PIDFILE --name $NAME --startas $DAEMON -- -H $PORT -l $LOGFILE        log_end_msg $?        ;; stop)   log_daemon_msg "Stopping $DESC " "$NAME" start-stop-daemon --stop --quiet --pidfile $PIDFILE --name $NAME log_end_msg $? ;; restart) log_daemon_msg "Restarting $DESC " "$NAME"       start-stop-daemon --stop --retry 5 --quiet --pidfile $PIDFILE --name $NAME        start-stop-daemon --start --chdir /tmp --background --make-pidfile --pidfile $PIDFILE --name $NAME --startas $DAEMON -- -H $PORT -l $LOGFILE        log_end_msg $?        ;; status) status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $? #status $NAME #RETVAL=$? ;;        exit 2 ;; esac exit 0
 * )     log_action_msg "Usage: $SCRIPTNAME {start|stop|restart|status}"

chmod +x /etc/init.d/dynamips update-rc.d dynamips defaults
 * Set execution permissions for the script and add it to system start-up:

/etc/init.d/dynamips start dynagen /usr/share/vnx/examples/R.net
 * Calculate the idle-pc value for your computer following the procedure in http://dynagen.org/tutorial.htm:

Additional install steps for Olive support
Several additional steps are needed to support Olive (Juniper) routers in VNX scenarios:



Download old qemu bios from 0.10.6 version and copy it to /usr/share/qemu directory:</li> wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.10.6/qemu-kvm-0.10.6.tar.gz tar xfvz qemu-kvm-0.10.6.tar.gz cp qemu-kvm-0.10.6/pc-bios/bios.bin /usr/share/qemu-kvm/bios-0.10.6.bin

</ul>