Difference between revisions of "Vnx-install"

From VNUML-WIKI
Jump to: navigation, search
(Installation over Ubuntu 10.04/9.10)
 
(84 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{Title|VNX (Virtual Networks over X virtualization) v0.14 beta}}
 
{{Title|VNX (Virtual Networks over X virtualization) v0.14 beta}}
  
== Installation ==
+
== Installation over Ubuntu 10.04/9.10 ==
 
 
=== 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:
 
This section describes the procedure for installing VNX over Ubuntu 10.04 or 9.10. Open a root shell window and follow these steps:
Line 10: Line 8:
 
<li>Install all packages required (basic development, virtualization, perl libraries and auxiliar packages):</li>
 
<li>Install all packages required (basic development, virtualization, perl libraries and auxiliar packages):</li>
 
  apt-get update
 
  apt-get update
  apt-get install build-essential qemu-kvm libvirt-bin vlan xterm bridge-utils \
+
  apt-get install build-essential qemu-kvm libvirt-bin vlan xterm \
  screen virt-manager virt-viewer libxml-checker-perl \
+
  bridge-utils  screen virt-manager virt-viewer libxml-checker-perl \
libxml-parser-perl libnetaddr-ip-perl libnet-pcap-perl libnet-ipv6addr-perl \
+
  libxml-parser-perl libnetaddr-ip-perl libnet-pcap-perl \
liberror-perl libexception-class-perl uml-utilities libxml-libxml-perl \
+
  libnet-ipv6addr-perl liberror-perl libexception-class-perl \
libxml2-dev libgnutls-dev libdevmapper-dev libterm-readline-perl-perl  
+
  uml-utilities libxml-libxml-perl libxml2-dev libgnutls-dev \
 
+
  libdevmapper-dev libterm-readline-perl-perl libnet-telnet-perl \
Note: for Ubuntu 9.04 change "qemu-kvm" package by "qemu kvm"
+
  libnet-ip-perl libreadonly-perl libmath-round-perl libappconfig-perl \
 +
  libdbi-perl graphviz libnl-dev genisoimage gnome-terminal libfile-homedir-perl
  
 +
<!--Note: for Ubuntu 9.04 change "qemu-kvm" package by "qemu kvm" -->
 
<li>If you use 64 bits version of Ubuntu, install 32 bits compatibility libraries:</li>
 
<li>If you use 64 bits version of Ubuntu, install 32 bits compatibility libraries:</li>
 
   apt-get install ia32-libs
 
   apt-get install ia32-libs
  
<li>Install libvirt 0.7.5:</li>
+
<li>Install libvirt 0.8.5:</li>
 
   /etc/init.d/libvirt-bin stop
 
   /etc/init.d/libvirt-bin stop
   wget http://libvirt.org/sources/libvirt-0.7.5.tar.gz
+
   wget http://libvirt.org/sources/libvirt-0.8.5.tar.gz
   tar xfvz libvirt-0.7.5.tar.gz
+
   tar xfvz libvirt-0.8.5.tar.gz
   cd libvirt-0.7.5
+
   cd libvirt-0.8.5
 
   ./configure --without-xen --prefix=/usr && make && make install
 
   ./configure --without-xen --prefix=/usr && make && make install
 
   /etc/init.d/libvirt-bin start
 
   /etc/init.d/libvirt-bin start
  
'''NOTE''': By now, libvirt 0.7.5 is the only version of libvirt known to work with VNX.
+
'''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.
 
 
'''NOTE2''': libvirt 0.7.5 is available as a package in Ubuntu 10.04. However 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 it as described above, in order to maintain Apparmor in your system.
 
 
   
 
   
 
<li>Install Sys::Virt perl module:</li>
 
<li>Install Sys::Virt perl module:</li>
Line 49: Line 47:
  
 
<li>Install VNX:</li>
 
<li>Install VNX:</li>
  wget -N http://www.dit.upm.es/vnx/download/vnx-0.14b.tgz
+
mkdir /tmp/vnx-update
  tar xfvz vnx-0.14b.tgz
+
cd /tmp/vnx-update
  cd vnx-0.14b
+
  wget -N http://idefix.dit.upm.es/download/vnx/vnx-latest.tgz
 +
  tar xfvz vnx-latest.tgz
 +
  cd vnx-*
 
  ./install_vnx
 
  ./install_vnx
 +
 +
<li>Create the VNX config file (/etc/vnx.conf). You just can move the sample config file:</li>
 +
mv /etc/vnx.conf.sample /etc/vnx.conf
  
 
<li>Download root file systems from http://idefix.dit.upm.es/download/vnx/filesystems and copy them to /usr/share/vnx/filesystems directory:</li>
 
<li>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/filesystem
+
  cd /usr/share/vnx/filesystems
 +
 
  # ubuntu server
 
  # ubuntu server
  wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.04-v01.qcow2.bz2
+
  wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.10-v02.qcow2.bz2
  bunzip2 root_fs_ubuntu-10.04-v01.qcow2.bz2
+
  bunzip2 root_fs_ubuntu-10.10-v02.qcow2.bz2
  ln -s root_fs_ubuntu-10.04-v01.qcow2.bz2 root_fs_ubuntu
+
  ln -s root_fs_ubuntu-10.10-v02.qcow2 root_fs_ubuntu
 +
 
  # ubuntu with gui
 
  # ubuntu with gui
  wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.04-gui-v01.qcow2.bz2
+
  wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.10-gui-v01.qcow2.bz2
  bunzip2 root_fs_ubuntu-gui-10.04-v01.qcow2.bz2
+
  bunzip2 root_fs_ubuntu-10.10-gui-v01.qcow2.bz2
  ln -s root_fs_ubuntu-10.04-gui-v01.qcow2.bz2 root_fs_ubuntu-gui
+
ln -s root_fs_ubuntu-10.10-gui-v01.qcow2 root_fs_ubuntu-gui
  ...
+
 +
# freebsd server
 +
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-8.1-v01.qcow2.bz2
 +
bunzip2 root_fs_freebsd-8.1-v01.qcow2.bz2
 +
  ln -s root_fs_freebsd-8.1-v01.qcow2 root_fs_freebsd
 +
 +
# freebsd gui
 +
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-8.1-gui-v01.qcow2.bz2
 +
bunzip2 root_fs_freebsd-8.1-gui-v01.qcow2.bz2
 +
ln -s root_fs_freebsd-8.1-gui-v01.qcow2 root_fs_freebsd-gui
 +
   
 +
# winxp and win7
 +
# Sorry! Unfortunately for legal reasons we cannot distribute windows XP
 +
# or Windows 7 root filesystems. See VNX documentation for detailed recipes
 +
# to create these root fylesystems from scratch
 +
 
 +
<li>Additionally, if you plan to use VNUML root filesystem:</li>
 +
# VNUML root_fs_tutorial and kernel
 +
cd /usr/share/vnx/filesystems
 +
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
 +
 
 
</ul>
 
</ul>
  
Line 71: Line 102:
  
  
=== Installing on Fedora 11 ===
+
=== Additional install steps for Dynamips support ===
  
Follow tis steps to install VNX over Fedora 11:
+
* Install Dynamips and Dynagen:
<ul>
+
apt-get install dynamips dynagen
 +
 
 +
* Create a file /etc/init.d/dynamips (taken from http://7200emu.hacki.at/viewtopic.php?t=2198):
 +
<pre>
 +
#!/bin/sh
 +
# Start/stop the dynamips program as a daemon.
 +
#
 +
### BEGIN INIT INFO
 +
# Provides:          dynamips
 +
# Default-Start:    2 3 4 5
 +
# Default-Stop:      0 1 6
 +
# Short-Description: Cisco hardware emulator daemon
 +
### 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
  
<li> Instalar VNUML sobre Fedora 11 siguiendo la receta en http://www.dit.upm.es/vnumlwiki/index.php/Fedora11</li>
 
  
<li> Instalar paquetes y librerías necesarias:</li>
+
case "$1" in
  yum install qemu-kvm libvirt virt-manager virt-viewer perl-XML-LibXML perl-Sys-Virt
+
start) log_daemon_msg "Starting $DESC " "$NAME"
yum -y install bridge-utils readline-devel perl-Module-Build screen expat-devel libpcap-devel 
+
        start-stop-daemon --start --chdir /tmp --background --make-pidfile --pidfile $PIDFILE --name $NAME --startas $DAEMON -- -H $PORT -l $LOGFILE
yum -y install perl-Net-Pcap perl-NetAddr-IP perl-Net-IPv6Addr perl-XML-DOM perl-Exception-Class
+
        log_end_msg $?
yum -y install perl-TermReadKey perl-Error perl-CPAN uml_utilities xterm tunctl
+
        ;;
 +
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=$?
 +
        ;;
 +
*)      log_action_msg "Usage: $SCRIPTNAME {start|stop|restart|status}"
 +
        exit 2
 +
        ;;
 +
esac
 +
exit 0
  
<li>Install XML::Checker perl library:</li>
+
</pre>
perl -MCPAN -e shell
 
install XML::Checker
 
<li>Add symbolic link for kvm:</li>
 
ln -s /usr/bin/qemu-kvm /usr/bin/kvm
 
  
<li>Instalar VNX:</li>
+
* Set execution permissions for the script and add it to system start-up:
  wget -N http://idefix.dit.upm.es/download/vnx/vnx-0.12b.tgz
+
  chmod +x /etc/init.d/dynamips
  tar xfvz vnx-0.12b.tgz
+
  update-rc.d dynamips defaults
cd vnx-0.12b
+
  /etc/init.d/dynamips start
  ./install-vnx
 
  
<li>Deshabilitar el firewall o, alternativamente, configurar los interfaces tipo "tun" como confiables (Sistema->Firewall->Interfaces Confiables").</li>
+
* Download and install cisco IOS image:
</ul>
+
  cd /usr/share/vnx/filesystems
 +
  # Cisco image
 +
  wget ... c3640-js-mz.124-19.image
 +
  ln -s c3640-js-mz.124-19.image c3640
  
== Testing VNX with example scenarios ==
+
* Calculate the idle-pc value for your computer following the procedure in http://dynagen.org/tutorial.htm:
 +
dynagen /usr/share/vnx/examples/R.net
 +
console R    # type 'no' to exit the config wizard and wait
 +
              # for the router to completely start
 +
idle-pc get R
 +
Once you know the idle-pc value for your system, include it in /etc/vnx.conf file.
  
Several example scenarios are distributed together with VNX (see /usr/share/vnx/examples directory).
+
=== Additional install steps for Olive support ===
  
Con la distribución provisional de VNX se proporcionan dos nuevos escenarios de ejemplo para mostrar las capacidades para crear máquinas virtuales basadas en Windows XP:
+
Several additional steps are needed to support Olive (Juniper) routers in VNX scenarios:
* '''root_fs_XXX.xml''',
 
* '''simple-XXX.xml''': simple scenarios made of one virtual machine without network interfaces.
 
* '''tutorial_root1-xp.xml''', basado en el escenario del tutorial de VNUML (http://www.dit.upm.es/vnumlwiki/index.php/Tutorial) y compuesto por dos máquinas virtuales Linux (uml1 y uml3) y tres Windows XP (uml2, uml4 y uml5).
 
  
To test the scenarios:
 
 
<ul>
 
<ul>
<li>Open a root shell from the graphical console of the host machine. If you are not sat in front of host's console you can access it using ssh with X-forwarding activated. For example, from a Unix machine you can use:</li>
 
  ssh -X <host-addr>
 
In this case, it is recommended to test that X-forwarding is working by launching a "xterm" or "xeyes" application and seeing that the application window is correctly launched.
 
  
Es importante además que la conectividad entre la máquina cliente y el servidor donde se ejecuta VNX sea buena, ya que el acceso a las consolas de las máquinas virtuales se hace impracticable en caso contrario.
+
<!-- Ya no hace falta desde que se usa <qemu:commandline>
  
</ul>
+
<li>Install a patched version of libvirt 0.8.5 with support to define the bios used by a virtual machine:</li>
  
=== Simple scenarios ===
 
 
<ul>
 
<ul>
<li>Start simple scenarios by means of:</li>
+
<li>Copy the following content to a file named libvirt-0.8.5-biosfile.patch (based on http://www.mail-archive.com/libvir-list@redhat.com/msg15952.html):</li>
vnx -f /usr/share/vnx/examples/simple_xp.xml -v -u root --create
+
<pre>
Just after the execution, you will see the console of the Windows XP machine starting. Once the machine has completely started, the autoconfiguration daemon will configure it (the name and network interfaces are configured in general; only the name in the simple example) and restart it for the changes to take effect.
+
diff -crB libvirt-0.8.5.orig/src/conf/domain_conf.c libvirt-0.8.5/src/conf/domain_conf.c
 +
*** libvirt-0.8.5.orig/src/conf/domain_conf.c 2010-11-22 11:38:08.000000000 +0100
 +
--- libvirt-0.8.5/src/conf/domain_conf.c 2010-11-22 11:47:41.000000000 +0100
 +
***************
 +
*** 4267,4272 ****
 +
--- 4267,4274 ----
 +
      if (node)
 +
          def->mem.hugepage_backed = 1;
 +
 
 +
+    def->biosfile = virXPathString("string(./biosfile[1])", ctxt);
 +
+
 +
      /* Extract other memory tunables */
 +
      if (virXPathULong("string(./memtune/hard_limit)", ctxt,
 +
                        &def->mem.hard_limit) < 0)
 +
diff -crB libvirt-0.8.5.orig/src/conf/domain_conf.h libvirt-0.8.5/src/conf/domain_conf.h
 +
*** libvirt-0.8.5.orig/src/conf/domain_conf.h 2010-11-22 11:38:08.000000000 +0100
 +
--- libvirt-0.8.5/src/conf/domain_conf.h 2010-11-22 11:40:18.000000000 +0100
 +
***************
 +
*** 885,890 ****
 +
--- 885,891 ----
 +
          unsigned long min_guarantee;
 +
          unsigned long swap_hard_limit;
 +
      } mem;
 +
+    char *biosfile;
 +
      unsigned short vcpus;
 +
      unsigned short maxvcpus;
 +
      int cpumasklen;
 +
diff -crB libvirt-0.8.5.orig/src/qemu/qemu_conf.c libvirt-0.8.5/src/qemu/qemu_conf.c
 +
*** libvirt-0.8.5.orig/src/qemu/qemu_conf.c 2010-11-22 11:38:08.000000000 +0100
 +
--- libvirt-0.8.5/src/qemu/qemu_conf.c 2010-11-22 11:41:05.000000000 +0100
 +
***************
 +
*** 3984,3989 ****
 +
--- 3984,3995 ----
 +
      ADD_ARG_LIT(emulator);
 +
      ADD_ARG_LIT("-S");
 +
 
 +
+    if(def->biosfile)
 +
+    {
 +
+        ADD_ARG_LIT("-bios");
 +
+        ADD_ARG_LIT(def->biosfile);
 +
+    }
 +
+
 +
      /* This should *never* be NULL, since we always provide
 +
      * a machine in the capabilities data for QEMU. So this
 +
      * check is just here as a safety in case the unexpected
 +
</pre>
  
After the restart, the virtual machine will be available for interacting with it.
+
<li>Install libvirt 0.8.5 with that patch applied:</li>
 +
service 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
 +
patch -p1 -i ../libvirt-0.8.5-biosfile.patch
 +
./configure --without-xen --prefix=/usr && make && make install
 +
service libvirt-bin start
  
Note: virt-viewer console application "captures" the mouse when interacting with the virtual machines. You have to type "Ctrl-Alt" to release the mouse.
+
</ul>
 +
-->
 +
<li>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
  
<li>To stop the scenario preserving the changes made:</li>
+
<!-- Not needed, it seems to work without downloading this drivers
  vnx -f /usr/share/vnx/examples/simple_xp.xml -v -u root --shutdown
+
<li>Download i82559 ROM from the latest qemu versions (Ubuntu 10.04 does not include that ROM in qemu-kvm package):</li>
 
+
  wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.12.5/qemu-kvm-0.12.5.tar.gz
<li>To stop the scenario discarding the changes made:</li>
+
tar xfvz qemu-kvm-0.12.5.tar.gz
vnx -f /usr/share/vnx/examples/simple_xp.xml -v -u root --destroy
+
cp qemu-kvm-0.12.5/pc-bios/pxe-i82559er.bin /usr/share/qemu-kvm/
 +
-->
 
</ul>
 
</ul>
  
=== Tutorial scenarios ===
+
== Installation over Fedora 11 (Draft) ==
  
 +
Follow this steps to install VNX over Fedora 11:
 
<ul>
 
<ul>
  
<li>To start the tutorial scenario with linux and XP machines just type:</li>
+
<li>Install packages:</li>
  vnx -f tutorial_root1_xp.xml -v -u root --create
+
  yum -y groupinstall "Development Tools"
 +
yum install qemu-kvm libvirt virt-manager virt-viewer perl-XML-LibXML
 +
yum install perl-XML-DOM perl-NetAddr-IP perl-Readonly perl-TermReadKey
 +
yum install perl-Net-Pcap perl-Net-IPv6Addr perl-Net-Telnet perl-Error
 +
yum install perl-Exception-Class perl-ExtUtils-MakeMaker tunctl screen wget
 +
yum install libxml2-devel gnutls-devel device-mapper-devel uml_utilities
 +
yum install roxterm xterm graphviz perl-AppConfig
  
<li>Once the scenario has completely started (remenber that the XP machines have to be restarted for the autoconfiguration to complete), you can test the network connectivity, for example, accesing '''uml1''' machine and tracing to '''uml5''':
+
<li>Install libvirt 0.8.5:</li>
  traceroute -n 10.0.2.2
+
  /etc/init.d/libvirtd 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/libvirtd start
  
<li>Para parar y rearrancar una máquina concreta sin perder las modificaciones realizadas:
+
<li>Install SysVirt manually:</li>
  vnx -d examples/tutorial_root1_xp.xml -v -u root -M uml4
+
wget http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.2.4.tar.gz
  vnx -t examples/tutorial_root1_xp.xml -v -u root -M uml4
+
tar xfvz Sys-Virt-0.2.4.tar.gz
 +
cd Sys-Virt-0.2.4
 +
perl Makefile.PL
 +
make install
 +
<!--
 +
<li> Instalar VNUML sobre Fedora 11 siguiendo la receta en http://www.dit.upm.es/vnumlwiki/index.php/Fedora11</li>
 +
 
 +
<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
 +
 
 +
<li>Install XML::Checker perl library:</li>
 +
perl -MCPAN -e shell
 +
install XML::Checker
 +
-->
 +
<li>Add symbolic link for kvm:</li>
 +
ln -s /usr/bin/qemu-kvm /usr/bin/kvm
 +
 
 +
<li>Install VNX:</li>
 +
mkdir /tmp/vnx-update
 +
cd /tmp/vnx-update
 +
wget -N http://idefix.dit.upm.es/download/vnx/vnx-latest.tgz
 +
tar xfvz vnx-latest.tgz
 +
cd vnx-*
 +
./install_vnx
  
<li>Para parar y rearrancar una máquina concreta creando una copia nueva desde el rootfs original:
+
<li>Create the VNX config file (/etc/vnx.conf). You just can move the sample config file:</li>
  vnx -P examples/tutorial_root1_xp.xml -v -u root -M uml4
+
mv /etc/vnx.conf.samble /etc/vnx.conf
  vnx -t examples/tutorial_root1_xp.xml -v -u root -M uml4
+
 
 +
<li>Disable host firewall or, alternatively, configure "tun" type network interfaces as trusted interfaces (System->Firewall->Trusted Interfaces).</li>
 +
 
 +
<li>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
 +
 +
# ubuntu server
 +
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.10-v01.qcow2.bz2
 +
bunzip2 root_fs_ubuntu-10.10-v01.qcow2.bz2
 +
ln -s root_fs_ubuntu-10.10-v01.qcow2 root_fs_ubuntu
 +
 +
# ubuntu with gui
 +
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.10-gui-v01.qcow2.bz2
 +
bunzip2 root_fs_ubuntu-10.10-gui-v01.qcow2.bz2
 +
ln -s root_fs_ubuntu-10.10-gui-v01.qcow2 root_fs_ubuntu-gui
 +
 +
# freebsd server
 +
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-8.1-v01.qcow2.bz2
 +
bunzip2 root_fs_freebsd-8.1-v01.qcow2.bz2
 +
ln -s root_fs_freebsd-8.1-v01.qcow2 root_fs_freebsd
 +
 +
# freebsd gui
 +
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-8.1-gui-v01.qcow2.bz2
 +
bunzip2 root_fs_freebsd-8.1-gui-v01.qcow2.bz2
 +
ln -s root_fs_freebsd-8.1-gui-v01.qcow2 root_fs_freebsd-gui
 +
 +
# winxp and win7
 +
# Sorry! Unfortunately for legal reasons we cannot distribute windows XP
 +
# or Windows 7 root filesystems. See VNX documentation for detailed recipes
 +
# to create these root fylesystems from scratch
  
 
</ul>
 
</ul>
  
== Troubleshooting ==
+
=== Additional install steps for Dynamips support ===
  
Comprobaciones:
+
* Install Dynamips and Dynagen:
<ul>
+
wget http://downloads.sourceforge.net/project/dyna-gen/dynamips%20Linux%20RPM/0.2.8-RC2/dynamips-0.2.8RC2-1.i386.rpm
 +
rpm -i dynamips-0.2.8RC2-1.i386.rpm
 +
wget http://downloads.sourceforge.net/project/dyna-gen/dynagen%20source%20_%20Linux/dynagen%200.11.0/dynagen-0.11.0-1.fc9.noarch.rpm
 +
rpm -i dynagen-0.11.0-1.fc9.noarch.rpm
  
<li>Comprobar que el procesador tiene las '''extensiones de virtualización''':</li>
+
* Set execution permissions for the script and add it to system start-up:
  egrep '(vmx|svm)' --color=always /proc/cpuinfo
+
  chkconfig --add dynamips
Si aparece la la palabra vmx (para Intel) o svm (para AMD) coloreada, es que el procesador tiene soporte de virtualización.
+
/etc/init.d/dynamips start
  
<li>Comprobar que '''KVM''' funciona con:</li>
+
* Download and install cisco IOS image:
   modprobe kvm
+
  cd /usr/share/vnx/filesystems
   modprobe kvm_intel
+
  # Cisco image
 +
   wget ... c3640-js-mz.124-19.image
 +
   ln -s c3640-js-mz.124-19.image c3640
  
  <ul>
+
* Calculate the idle-pc value for your computer following the procedure in http://dynagen.org/tutorial.htm:
  <li>Arrancar con consola SDL</li>
+
dynagen /usr/share/vnx/examples/R.net
  kvm -sdl -hda /usr/share/vnuml/filesystems/linux-0.2.img -m 256   
+
console R    # type 'no' to exit the config wizard and wait
  <li>Arrancar con consola VNC:</li>
+
              # for the router to completely start
  echo "Type 'vncviewer ${DISPLAY%.0}' to access vnc console"; kvm -vnc ${DISPLAY#*localhost} -hda /usr/share/vnuml/filesystems/linux-0.2.img -m 256
+
idle-pc get R
  </ul>
+
Once you know the idle-pc value for your system, include it in /etc/vnx.conf file.
  
<li>Nota: si al ejecutar el comando kvm devuelve el mensaje de error:</li>
+
=== Additional install steps for Olive support ===
open /dev/kvm: No such file or directory.
 
Could not initialize KVM, will disable KVM support"
 
es que el sistema operativo no detecta el soporte de virtualización. Si se ha comprobado que el procesador soporta virtualización, puede ser que ésta esté deshabilitada en la BIOS.
 
  
<li>Comprobar que '''libvirt+KVM''' funciona:</li>
+
Several additional steps are needed to support Olive (Juniper) routers in VNX scenarios:
  
 
<ul>
 
<ul>
<li>Arrancando máquina virtual linux:</li>
+
 
  cd /usr/share/vnuml/examples/
+
<li>Download old qemu bios from 0.10.6 version and copy it to /usr/share/qemu directory:</li>
  virsh create root_fs_linux.xml
+
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.10.6/qemu-kvm-0.10.6.tar.gz
  virt-viewer Linux
+
  tar xfvz qemu-kvm-0.10.6.tar.gz
<li>Arrancando máquina virtual Windows XP:</li>
+
  cp qemu-kvm-0.10.6/pc-bios/bios.bin /usr/share/qemu/bios-0.10.6.bin
  cd /usr/share/vnuml/examples/
+
 
  virsh create root_fs_winxp.xml
 
  virt-viewer WinXP
 
<li>Para parar las máquinas utilizar:</li>
 
  virsh shutdown Linux
 
  virsh shutdown WinXP
 
<li>En caso de problemas relacionados con la configuración de red:</li>
 
  killall dnsmasq
 
  virsh net-start default
 
<li>En caso de que una máquina virtual creada con libvirt no arranque, se pueden consultar la causa en el fichero de trazas:</li>
 
  cat /var/log/libvirt/qemu/Linux.log
 
  cat /var/log/libvirt/qemu/WinXP.log
 
<li>El estado de las máquinas virtuales creadas con libvirt se puede ver desde la consola gráfica:</li>
 
virt-manager
 
o desde la shell de libvirt:
 
virsh list
 
 
</ul>
 
</ul>
  
<li> Comprobar funcionamiento '''VNUML''' básico:</li>
 
  cd /usr/share/vnuml/examples
 
Editar tutorial_root2.xml y añadir "<mem>64M</mem>" entre <filesystem...> y <kernel...>
 
  vnumlparser.pl -t tutorial_root2.xml -v -u root -Z
 
  
</ul>
 
  
=== Errores conocidos ===
 
  
<ul>
 
<li>Ubuntu 9.10: si al arrancar máquinas virtuales da el error:</li>
 
libvirt error code: 38, message: monitor socket did not show up.: Connection refused
 
y en el log (/var/log/libvirt/qemu/*.log) se ve al final el mensaje:
 
qemu: could not open disk image /root/.vnuml/simulations/simple/vms/host1/fs/root_cow_fs
 
hay que rearrancar el demonio de libvirt mediante:
 
/etc/init.d/libvirt-bin restart
 
ver https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/503376
 
  
</ul>
 
  
  

Latest revision as of 18:17, 10 May 2011

VNX (Virtual Networks over X virtualization) v0.14 beta

Installation over 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 libreadonly-perl libmath-round-perl libappconfig-perl \
      libdbi-perl graphviz libnl-dev genisoimage gnome-terminal libfile-homedir-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:
  • Install VNX:
  • mkdir /tmp/vnx-update
    cd /tmp/vnx-update
    wget -N http://idefix.dit.upm.es/download/vnx/vnx-latest.tgz
    tar xfvz vnx-latest.tgz
    cd vnx-*
    ./install_vnx
    
  • Create the VNX config file (/etc/vnx.conf). You just can move the sample config file:
  • mv /etc/vnx.conf.sample /etc/vnx.conf
    
  • Download root file systems from http://idefix.dit.upm.es/download/vnx/filesystems and copy them to /usr/share/vnx/filesystems directory:
  • cd /usr/share/vnx/filesystems
    
    # ubuntu server
    wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.10-v02.qcow2.bz2
    bunzip2 root_fs_ubuntu-10.10-v02.qcow2.bz2
    ln -s root_fs_ubuntu-10.10-v02.qcow2 root_fs_ubuntu
    
    # ubuntu with gui
    wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.10-gui-v01.qcow2.bz2
    bunzip2 root_fs_ubuntu-10.10-gui-v01.qcow2.bz2
    ln -s root_fs_ubuntu-10.10-gui-v01.qcow2 root_fs_ubuntu-gui
    
    # freebsd server
    wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-8.1-v01.qcow2.bz2
    bunzip2 root_fs_freebsd-8.1-v01.qcow2.bz2
    ln -s root_fs_freebsd-8.1-v01.qcow2 root_fs_freebsd
    
    # freebsd gui
    wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-8.1-gui-v01.qcow2.bz2
    bunzip2 root_fs_freebsd-8.1-gui-v01.qcow2.bz2
    ln -s root_fs_freebsd-8.1-gui-v01.qcow2 root_fs_freebsd-gui
    
    # winxp and win7
    # Sorry! Unfortunately for legal reasons we cannot distribute windows XP
    # or Windows 7 root filesystems. See VNX documentation for detailed recipes
    # to create these root fylesystems from scratch
    
  • Additionally, if you plan to use VNUML root filesystem:
  • # VNUML root_fs_tutorial and kernel
    cd /usr/share/vnx/filesystems
    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
    

NOTE for Ubuntu 10.04.1: It seems that an additional package has to be installed:

apt-get install kvm-pxe


Additional install steps for Dynamips support

  • Install Dynamips and Dynagen:
apt-get install dynamips dynagen
#!/bin/sh
# Start/stop the dynamips program as a daemon.
#
### BEGIN INIT INFO
# Provides:          dynamips
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Cisco hardware emulator daemon
### 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=$?
        ;; 
*)      log_action_msg "Usage: $SCRIPTNAME {start|stop|restart|status}"
        exit 2
        ;;
esac
exit 0

  • Set execution permissions for the script and add it to system start-up:
chmod +x /etc/init.d/dynamips
update-rc.d dynamips defaults
/etc/init.d/dynamips start
  • Download and install cisco IOS image:
 cd /usr/share/vnx/filesystems
 # Cisco image
 wget ... c3640-js-mz.124-19.image
 ln -s c3640-js-mz.124-19.image c3640
dynagen /usr/share/vnx/examples/R.net
console R     # type 'no' to exit the config wizard and wait 
              # for the router to completely start 
idle-pc get R

Once you know the idle-pc value for your system, include it in /etc/vnx.conf file.

Additional install steps for Olive support

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

Installation over Fedora 11 (Draft)

Follow this steps to install VNX over Fedora 11:

Additional install steps for Dynamips support

  • Install Dynamips and Dynagen:
wget http://downloads.sourceforge.net/project/dyna-gen/dynamips%20Linux%20RPM/0.2.8-RC2/dynamips-0.2.8RC2-1.i386.rpm
rpm -i dynamips-0.2.8RC2-1.i386.rpm
wget http://downloads.sourceforge.net/project/dyna-gen/dynagen%20source%20_%20Linux/dynagen%200.11.0/dynagen-0.11.0-1.fc9.noarch.rpm
rpm -i dynagen-0.11.0-1.fc9.noarch.rpm
  • Set execution permissions for the script and add it to system start-up:
chkconfig --add dynamips
/etc/init.d/dynamips start
  • Download and install cisco IOS image:
 cd /usr/share/vnx/filesystems
 # Cisco image
 wget ... c3640-js-mz.124-19.image
 ln -s c3640-js-mz.124-19.image c3640
dynagen /usr/share/vnx/examples/R.net
console R     # type 'no' to exit the config wizard and wait 
              # for the router to completely start 
idle-pc get R

Once you know the idle-pc value for your system, include it in /etc/vnx.conf file.

Additional install steps for Olive support

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