https://web.dit.upm.es/vnumlwiki/api.php?action=feedcontributions&user=David&feedformat=atomVNUML-WIKI - User contributions [en]2024-03-28T08:20:10ZUser contributionsMediaWiki 1.30.0https://web.dit.upm.es/vnumlwiki/index.php?title=Installation_1.8&diff=4153Installation 1.82015-01-07T00:17:13Z<p>David: </p>
<hr />
<div>{{Title|Installing VNUML 1.8}}<br />
<br />
<big><br />
Authors:<br />
'''Ferm&iacute;n Gal&aacute;n (galan at dit.upm.es)'''<br />
'''David Fern&aacute;ndez (david at dit.upm.es)'''<br />
'''version 1.8, April 5th, 2010'''<br />
</big><br />
<br />
__TOC__<br />
<br />
<br />
== Introduction ==<br />
<br />
There are two ways of installing VNUML:<br />
<br />
<ul><br />
<br />
<li>From APT package in deb-based distribution (Debian, Ubuntu, Kubuntu, MEPIS,...).</li><br />
<li>From source .tgz</li><br />
</ul><br />
<br />
The recommended installation procedure is the former, due to it is much easier than the later (for example, dependencies are calculated and installed automaticly). However, this manual describes also the source based installation for users not using .deb based distributions (like Fedora or SuSE).<br />
<br />
Note the installation prefix in both cases is different: /usr/share for the .deb package and /usr/local/share for the source .tgz installation (except if you use a differente PREFIX when <code>./configure</code>).<br />
<br />
UML simulations generally consume a lot of physical host resources (CPU, disk storage, RAM, etc). As a minimum, you need a standard Pentium III 500 Mhz with 128 Mb RAM to perform the tutorial included in the documentation. However, at least 256 Mb (better 512 Mb) and a faster CPU are recomended to execute more complex scenarios.<br />
<br />
Note this document describes how to install the VNUML tool itself: kernels and filesystem files need to be download and installed separatelly (fortunallely, installing then is as simple as move a file to the right place, see [[Reference_1.8#<kernel>|<kernel>]] and [[Reference_1.8#<filesystem>|<filesystem>]] tags in [[Reference_1.8|VNUML Language Reference]] document for details).<br />
<br />
<span style="color:red"><strong>Warning when upgrading root filesystem for COW-based existing simulations:</strong></span> if you use a symlink that points to the actual filesystem (tipically root_fs_tutorial -> root_fs_tutorial-X.Y.Z), note that upgrading the actual filesystem (root_fs_tutorial-X.Y.Z) will corrupt previously created COW based simulations. Therefore, it is advisable to [[Usermanual_1.8#Purging_an_Scenario|purge]] (vnulmparser.pl -P) that simulations before (or event removing directly their directory under ~/.vnuml/simulations to be sure).<br />
<br />
== Installing from .deb package ==<br />
<br />
<p>An APT respository has been set up for VNUML related packages. The installation<br />
procedure is as follows:</p><br />
<br />
<ol><br />
<li>Add the following line to the /etc/apt/sources.list file:</li><br />
<br />
<pre class="box"><br />
deb http://www.dit.upm.es/~vnuml/debian binary/<br />
</pre><br />
<br />
<li>Update package list:</li><br />
<br />
<pre class="box"><br />
apt-get update<br />
</pre><br />
<br />
<li>(Optional) If you want to consider testing version of VNUML, add also to/etc/apt/sources.list file:</li><br />
<br />
<pre class="box"><br />
deb http://www.dit.upm.es/~vnuml/debian-testing binary/<br />
</pre><br />
<br />
<li>Install VNUML along the packages it depends on</li><br />
<br />
<pre class="box"><br />
apt-get install vnuml<br />
</pre><br />
<br />
</ol><br />
<br />
<p>In addition, although they are not mandatory packages to work with<br />
VNUML, it is <strong>strongly</strong> recommended you install the following:</p><br />
<br />
<pre class="box"><br />
apt-get install vlan xterm bridge-utils screen<br />
</pre><br />
<br />
<p>That's all! :)</p><br />
<br />
<span style="color:red"><strong>Note for Ubuntu 10.04:</strong></span> tun module used to manage tuntap interfaces is now integrated in the kernel, so loading the module with "modprobe tun" is no longer needed. However, the vnumlparser always tries to load the module, giving the following error:<br />
<br />
host> /sbin/modprobe tun<br />
FATAL: Could not load /lib/modules/2.6.32-16-generic/modules.dep: No such file or directory<br />
<br />
To solve the problem, just edit /usr/bin/vnumlparser.pl and change the following line in "mode_t" function:<br />
<br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
<br />
by:<br />
<br />
if (! -e "/dev/net/tun") {<br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
}<br />
<br />
== Installing from source .tgz ==<br />
<br />
VNUML 1.8 source package includes an easy to use installer thanks to Tony Prug and Casey T. Deccio contributions.<br />
<br />
The most of the cases, all you need to install VNUML is untar the package in your GNU/Linux box (the package is quite distribution agnostic, but specific issues for [[#mandrake_specific_issues|Mandrake]] can be found later in this document) and perform the following operations. An Internet connection is needed, in order the installation scripts connect to CPAN (and other places) to get Perl modules and other libraries.<br />
<br />
<pre class="box"><br />
./configure<br />
make<br />
make install<br />
</pre> <br />
<br />
(The lastest command needs root privileges in the host)<br />
<br />
Several options can be configured using <code>configure</code> script (for example, the installation prefix). The <code>./configure --help</code> give the list of the available options.<br />
<br />
Host kernel needs to include tun and loop support in order to work properly. Skas support is also very desirable. 8012q is also required if you plan to use the VLAN features of VNUML.<br />
<br />
Please read the INSTALL file that comes with the package in order to get futher<br />
information and details.<br />
<br />
=== Libxml and expat installation ===<br />
<br />
VNUML needs libxml2 and expat2 to work. By default, the VNUML install program doesn't perform special actions about it, assuming the libraries are installed in your system (for example, as RPM or .deb packages). This is the recomended procedure.<br />
<br />
However, if you want VNUML installer to install libxml2 and/or expat2 being installed from the source (downloading the packages through Internet) use <code>--with-libxml=yes</code> and/or <code>--with-expat=yes</code> ./configure options, respectively.<br />
<br />
=== External Perl modules ===<br />
<br />
The VNUML tool requires some external Perl modules to work. By default, the installer (./configure) check if the required modules are installed. If not, the installer will report the user about the missing modules, in order he can install them before running again the installer.<br />
<br />
The list of required modules is (newest versions can be found in [http://search.cpan.org CPAN]):<br />
<br />
<ul><br />
<br />
<li>Error</li><br />
<li>Exception::Class</li> <br />
<li>XML::DOM, XML::Checker (these modules usually require some others: XML::RegExp, XML::Parser, XML::Parser::PerlSAX)</li><br />
<li>NetAddr::IP</li><br />
<li>Net::Pcap</li><br />
<li>IO::Socket</li><br />
<li>Term::ReadKey</li><br />
<li>Net::IPv6Addr (this module usually requires some others: Math::Base85, Net::IPv4Addr)<br />
<li>File::Glob</li> <br />
<!-- These two modules appear in the old documentation, but I think it only<br />
the modification in 1.6.0 makes them unecessary<br />
<!--li>Module::Build</li--><br />
<!--li>LWP</li--> <br />
</ul><br />
<br />
<!--p>Some required Perl modules can be found in VNUML web page local storage (note that the they may be old of date, we recommend you to find always the newest stable version of this modules in [http://search.cpan.org/ CPAN]):</p--><br />
<!--ul><br />
<li>XML-Parser ([http://www.dit.upm.es/vnuml/download/perl-modules/XML-Parser-2.31.tar.gz 2.31]])</li><br />
<li>XML-RegExp ([http://www.dit.upm.es/vnuml/download/perl-modules/XML-RegExp-0.03.tar.gz 0.03]])</li><br />
<li>libxml-perl ([http://www.dit.upm.es/vnuml/download/perl-modules/libxml-perl-0.07.tar.gz 0.07])</li><br />
<li>XML-DOM ([http://www.dit.upm.es/vnuml/download/perl-modules/XML-DOM-1.42.tar.gz 1.42])</li><br />
<li>XML-Checker ([http://www.dit.upm.es/vnuml/download/perl-modules/XML-Checker-0.13.tar.gz 0.13])</li><br />
<li>TermReadKey ([http://www.dit.upm.es/vnuml/download/perl-modules/TermReadKey-2.21.tar.gz 2.21])</li><br />
<li>Math-Base85 ([href="http://www.dit.upm.es/vnuml/download/perl-modules/Math-Base85-0.2.tar.gz 0.2])</li><br />
<li>Net-IPv4Addr ([http://www.dit.upm.es/vnuml/download/perl-modules/Net-IPv4Addr-0.10.tar.gz 0.10])</li><br />
<li>Net-IPv6Addr ([http://www.dit.upm.es/vnuml/download/perl-modules/Net-IPv6Addr-0.2.tar.gz 0.2])</li><br />
<li>Exception-Class ([http://www.dit.upm.es/vnuml/download/perl-modules/Exception-Class-1.20.tar.gz 1.20])</li><br />
</ul--><br />
<br />
If you find some required module is missing in the list before, please, [mailto:vnuml-at-dit.upm.es tell us] in order to add it.<br />
<br />
Perl modules are distributed as .tar.gz files. The standarized way to install them is the following:<br />
<br />
<ol><br />
<li>Uncompress the file.</li><br />
<li>Execute &#39;perl Makefile.PL&#39;. This checks dependencies and tell you if another required module have to be installed previously.</li><br />
<br />
<li>Execute &#39;make&#39;.</li><br />
<br />
<li>Execute &#39;make test&#39;. Note that (curiously!) not getting 100% success doesn&#39;t mean always that the module is not going to work.</li><br />
<br />
<li>Install the module with &#39;make install&#39; (root privilegies are needed).</li><br />
<br />
</ol><br />
<br />
In addition to manual installation, the VNUML installer can automate the missing modules installation using <code>--with-build_modules=yes</code> configure option. This is done throught the CPAN public repository and requires an Internet connection.<br />
<br />
=== Required binaries ===<br />
<br />
The vnumlparser.pl program needs some external binaries in order to work. The parser is able to check if the required binaries are in the command path (configure your PATH enviroment variable properly!) and report to the user if some required binary is missing.<br />
<br />
The most of this binaries are common things, like cp, mv, rm, find and the like. However, some others may be difficult to find, in particular the following:<br />
<br />
<ul><br />
<li><strong>brctl</strong> (only if you plan tu use virtual bridge based virtual networks). It can be found in the bridge-utils package (Debian .deb or SuSE .rpm)<br />
</li><br />
<br />
<li><strong>vconfig</strong> (only if you plan tu use VLAN features). It can be found in the vlan package (Debian .deb or SuSE .rpm)<br />
</li><br />
<br />
<li><strong>tunctl, uml_mconsole, uml_switch</strong>. In Debian, it can be found in the uml-utilities package (just use 'apt-get install uml-utilities' to install). In other distribution you can use the RPM in the [http://user-mode-linux.sourceforge.net/dl-sf.html UML download page] or compile from the sources .tar.bz2 at the same URL (we recommend you the second option). <br />
</li><br />
<br />
</ul><br />
<br />
== Installing offline ==<br />
<br />
The University of Koblenz-Landau has developed a VNUML offile installed that can be very useful if you don't have Internet access at installation time. You can find it in [http://www.uni-koblenz.de/~vnuml/down.en.php their download page].<br />
<br />
== General Troubleshooting ==<br />
<br />
<ul><br />
<br />
<li>(Installation from source package)<br />
The usual './configure ; make ; make install' may fail in the last step if<br />
the perl-devel package is not installed. In particular, the problem seems<br />
not finding the /usr/lib/perl5/5.8.3/i386-linux-thread-multi/CORE/config.h<br />
file, that is included in that package.<br />
</li><br />
<br />
<li>(Installation from source package)<br />
In order to compile the UML tools you maybe need install previously the readline-devel and ncurses-devel packages (at least in SuSE 9.0 and Mandrake 10.0, see this [http://sourceforge.net/tracker/index.php?func=detail&aid=1173967&group_id=113582&atid=665579 bug report] for details).<br />
</li><br />
<br />
<li> <br />
The installation procedure of VNUML may create new users and/or group. To avoid permission problems accesing some resources (for example, socket files), it is recommended logging completely out and logging back in (see [https://lists.dit.upm.es/pipermail/vnuml-devel/2005-July/000227.html this posting] in the vnuml-devel list for some more detail).<br />
</li><br />
<br />
<li><br />
There are problem reports using UML kernel linux-um-2.6.18.1-bb2-xt-4m (a 32 bits kernel) on some 64 bits hosts. The recommendation is to use at least a 2.6.27-7 or newer for 64 bits hosts. This problems were reported in Ubuntu 8.04 64 bits (that uses a 2.6.24 kernel) but they seem not being related with the distribution but with the host kernel version (see [https://lists.dit.upm.es/pipermail/vnuml-users/2008-November/000787.html this thread] for details). Thanks to Gerson Rodriguez for the bug report and proposed solution.<br />
</li><br />
<br />
</ul><br />
<br />
== Mandrake specific issues ==<br />
<br />
From [https://lists.dit.upm.es/pipermail/vnuml-users/2004-November/000115.html].<br />
<br />
<ul><br />
<br />
<li>perl-devel RPM package seems not being installed in the default Mandrake 10.0 installation</li><br />
<br />
<li><br />
The libreadline4-devel RPM package (required to compile UML tools) seems not being installed in the default Mandrake 10.0 installation).<br />
</li><br />
<br />
<li><br />
The /dev/net/tun device file only seems to exist when tun module is loaded.<br />
So, you need to 'modprobe tun' before running vnumparser.pl in order to<br />
avoid the '/dev/net/tun is not a valid character device file' error message.<br />
</li><br />
<br />
</ul><br />
<br />
== Contributed software ==<br />
<br />
The contrib/ directory in the source package after untaring contains contributed software that can be used with VNUML. For example, the contrib/uml_router is a uml_switch modification for traffic capture. Each contribution has its own README or INSTALL file, with installation steps and brief how-to descriptions (if you find this information insufficient the [https://lists.dit.upm.es/mailman/listinfo/vnuml-users vnuml-user] maillist is the right place to ask for :)<br />
<br />
We strongly recommend you to review the contrib/ directory. Maybe you find something useful!</div>Davidhttps://web.dit.upm.es/vnumlwiki/index.php?title=Main_Page&diff=4152Main Page2012-02-12T23:58:58Z<p>David: </p>
<hr />
<div>== IMPORTANT NOTICE ==<br />
<br />
VNUML project development and maintenance effort has been abandoned in favour of the new version of the tool named:<br />
* '''Virtual Networks over Linux (VNX)'''. <br />
See VNX web site for more details: http://www.dit.upm.es/vnx<br />
<br />
== Welcome to Virtual Network User-Mode-Linux (VNUML) web server ==<br />
<br />
VNUML (Virtual Network User Mode Linux) is an open-source general purpose virtualization tool designed to quickly define and test complex network simulation scenarios based on the [http://user-mode-linux.sourceforge.net/ User Mode Linux (UML)] virtualization software. VNUML is a useful tool that can be used to simulate general Linux based network scenarios. It is aimed to help in testing network applications and services over complex testbeds made of several nodes (even tenths) and networks inside one Linux machine, without involving the investment and management complexity needed to create them using real equipment.<br />
<br />
Since its development at the end of 2002, VNUML has been widely used in several fields related with networking and computer science. Routing architectures (such as the IPv6 IX developed in the [http://www.euro6ix.org Euro6IX IST research project]), IP multimedia service platforms and logical security are some of its research and development application (see [[References | references]] sections for some more details). Additionally, VNUML is widely used in higher education (technical universities and colleges) in order to build training laboratories for students.<br />
<br />
VNUML tool is made of two main components: the VNUML language used for describing simulations in XML; and the interpreter of the language (vnuml command), that builds and manages the scenario hiding all UML complex details to the user.<br />
<br />
VNUML has been originally developed by the [http://www.dit.upm.es Departamento de Ingeniería de Sistemas Telemáticos (DIT)] of the [http://www.upm.es Universidad Politécnica de Madrid (UPM)] in Spain. From January 2008, VNUML development is being partially supported by the Business Oriented Infrastructure (BOI) research initiative within the Bussiness Support Systems (BSS) unit at [http://www.tid.es Telefónica I+D].<br />
<br />
This software is released under GNU Public Licence. Since July 2004 the project is partially hosted at [http://sourceforge.net SourceForge.net]. Visit the [http://sourceforge.net/projects/vnuml VNUML site at SourceForge].<br />
<br />
<br />
<!--div align="center">[[Image:banner.jpg]]</div--><br />
<br />
<html><br />
<table width="60%" align="center"><br />
<tr><br />
<td align="left"><a href="http://www.dit.upm.es" alt="DIT logo"><br />
<img src="http://www.dit.upm.es/vnumlwiki/images/d/d8/Dit.jpg"><br />
</a><br />
</td><br />
<td align="right"><a href="http://www.tid.es" alt="TID logo"><br />
<img src="http://www.dit.upm.es/vnumlwiki/images/4/4c/Tid-boi.jpg"><br />
</td><br />
</tr><br />
</table><br />
</html><br />
<br />
== VNUML News ==<br />
<br />
'''Nov 18th, 2009''' -- New VNUML Virtual appliance (2.2-rc2) has been contributed by Borja Garnelo and Héctor Rodríguez. More information [[Download#Additional_downloads|here]]. <br />
<br />
'''May 22nd, 2009''' -- New stable releases: VNUML (1.8.9), UML kernel (2.6.28.10-1m) and root_fs_tutorial (0.6.0). You can find them in the [[download]] page.<br />
<br />
'''March 19th, 2009''' -- New EDIV release [https://sourceforge.net/project/showfiles.php?group_id=113582&package_id=293383&release_id=669125 (0.9.4)].<br />
<br />
'''March 11th, 2009''' -- New VNUML stable release, fixing a problem in 1.8.7 ([http://sourceforge.net/project/showfiles.php?group_id=113582&package_id=123470&release_id=667292 1.8.7.1]).<br />
<br />
'''March 8th, 2009''' -- New VNUML stable release: [https://sourceforge.net/project/showfiles.php?group_id=113582&package_id=123470&release_id=666734 1.8.7].<br />
<br />
'''February 19th, 2009''' -- New EDIV release [http://sourceforge.net/project/showfiles.php?group_id=113582&package_id=293383&release_id=662345 (0.9.3)].<br />
<br />
'''November 30th, 2008''' -- New VNUML stable release: [https://sourceforge.net/project/showfiles.php?group_id=113582&package_id=123470&release_id=643984 1.8.5].<br />
<br />
'''November 6th, 2008''' -- New EDIV release [http://sourceforge.net/project/showfiles.php?group_id=113582&package_id=293383&release_id=638717 (0.9.2)]<br />
<br />
[[All News]]</div>Davidhttps://web.dit.upm.es/vnumlwiki/index.php?title=Main_Page&diff=4151Main Page2012-02-12T23:58:01Z<p>David: /* IMPORTANT */</p>
<hr />
<div>== IMPORTANT ==<br />
<br />
VNUML project development and maintenance effort has been abandoned in favour of the new version of the tool named:<br />
* '''Virtual Networks over Linux (VNX)'''. <br />
See VNX web site for more details: http://www.dit.upm.es/vnx<br />
<br />
== Welcome to Virtual Network User-Mode-Linux (VNUML) web server ==<br />
<br />
VNUML (Virtual Network User Mode Linux) is an open-source general purpose virtualization tool designed to quickly define and test complex network simulation scenarios based on the [http://user-mode-linux.sourceforge.net/ User Mode Linux (UML)] virtualization software. VNUML is a useful tool that can be used to simulate general Linux based network scenarios. It is aimed to help in testing network applications and services over complex testbeds made of several nodes (even tenths) and networks inside one Linux machine, without involving the investment and management complexity needed to create them using real equipment.<br />
<br />
Since its development at the end of 2002, VNUML has been widely used in several fields related with networking and computer science. Routing architectures (such as the IPv6 IX developed in the [http://www.euro6ix.org Euro6IX IST research project]), IP multimedia service platforms and logical security are some of its research and development application (see [[References | references]] sections for some more details). Additionally, VNUML is widely used in higher education (technical universities and colleges) in order to build training laboratories for students.<br />
<br />
VNUML tool is made of two main components: the VNUML language used for describing simulations in XML; and the interpreter of the language (vnuml command), that builds and manages the scenario hiding all UML complex details to the user.<br />
<br />
VNUML has been originally developed by the [http://www.dit.upm.es Departamento de Ingeniería de Sistemas Telemáticos (DIT)] of the [http://www.upm.es Universidad Politécnica de Madrid (UPM)] in Spain. From January 2008, VNUML development is being partially supported by the Business Oriented Infrastructure (BOI) research initiative within the Bussiness Support Systems (BSS) unit at [http://www.tid.es Telefónica I+D].<br />
<br />
This software is released under GNU Public Licence. Since July 2004 the project is partially hosted at [http://sourceforge.net SourceForge.net]. Visit the [http://sourceforge.net/projects/vnuml VNUML site at SourceForge].<br />
<br />
<br />
<!--div align="center">[[Image:banner.jpg]]</div--><br />
<br />
<html><br />
<table width="60%" align="center"><br />
<tr><br />
<td align="left"><a href="http://www.dit.upm.es" alt="DIT logo"><br />
<img src="http://www.dit.upm.es/vnumlwiki/images/d/d8/Dit.jpg"><br />
</a><br />
</td><br />
<td align="right"><a href="http://www.tid.es" alt="TID logo"><br />
<img src="http://www.dit.upm.es/vnumlwiki/images/4/4c/Tid-boi.jpg"><br />
</td><br />
</tr><br />
</table><br />
</html><br />
<br />
== VNUML News ==<br />
<br />
'''Nov 18th, 2009''' -- New VNUML Virtual appliance (2.2-rc2) has been contributed by Borja Garnelo and Héctor Rodríguez. More information [[Download#Additional_downloads|here]]. <br />
<br />
'''May 22nd, 2009''' -- New stable releases: VNUML (1.8.9), UML kernel (2.6.28.10-1m) and root_fs_tutorial (0.6.0). You can find them in the [[download]] page.<br />
<br />
'''March 19th, 2009''' -- New EDIV release [https://sourceforge.net/project/showfiles.php?group_id=113582&package_id=293383&release_id=669125 (0.9.4)].<br />
<br />
'''March 11th, 2009''' -- New VNUML stable release, fixing a problem in 1.8.7 ([http://sourceforge.net/project/showfiles.php?group_id=113582&package_id=123470&release_id=667292 1.8.7.1]).<br />
<br />
'''March 8th, 2009''' -- New VNUML stable release: [https://sourceforge.net/project/showfiles.php?group_id=113582&package_id=123470&release_id=666734 1.8.7].<br />
<br />
'''February 19th, 2009''' -- New EDIV release [http://sourceforge.net/project/showfiles.php?group_id=113582&package_id=293383&release_id=662345 (0.9.3)].<br />
<br />
'''November 30th, 2008''' -- New VNUML stable release: [https://sourceforge.net/project/showfiles.php?group_id=113582&package_id=123470&release_id=643984 1.8.5].<br />
<br />
'''November 6th, 2008''' -- New EDIV release [http://sourceforge.net/project/showfiles.php?group_id=113582&package_id=293383&release_id=638717 (0.9.2)]<br />
<br />
[[All News]]</div>Davidhttps://web.dit.upm.es/vnumlwiki/index.php?title=Main_Page&diff=4150Main Page2012-02-12T23:53:38Z<p>David: </p>
<hr />
<div>== IMPORTANT ==<br />
<br />
VNUML project development and maintenance effort has been abandoned in favour of the new version of the tool named Virtual Networks over Linux (VNX). See VNX web site for more details:<br />
<br />
http://www.dit.upm.es/vnx <br />
<br />
<br />
== Welcome to Virtual Network User-Mode-Linux (VNUML) web server ==<br />
<br />
VNUML (Virtual Network User Mode Linux) is an open-source general purpose virtualization tool designed to quickly define and test complex network simulation scenarios based on the [http://user-mode-linux.sourceforge.net/ User Mode Linux (UML)] virtualization software. VNUML is a useful tool that can be used to simulate general Linux based network scenarios. It is aimed to help in testing network applications and services over complex testbeds made of several nodes (even tenths) and networks inside one Linux machine, without involving the investment and management complexity needed to create them using real equipment.<br />
<br />
Since its development at the end of 2002, VNUML has been widely used in several fields related with networking and computer science. Routing architectures (such as the IPv6 IX developed in the [http://www.euro6ix.org Euro6IX IST research project]), IP multimedia service platforms and logical security are some of its research and development application (see [[References | references]] sections for some more details). Additionally, VNUML is widely used in higher education (technical universities and colleges) in order to build training laboratories for students.<br />
<br />
VNUML tool is made of two main components: the VNUML language used for describing simulations in XML; and the interpreter of the language (vnuml command), that builds and manages the scenario hiding all UML complex details to the user.<br />
<br />
VNUML has been originally developed by the [http://www.dit.upm.es Departamento de Ingeniería de Sistemas Telemáticos (DIT)] of the [http://www.upm.es Universidad Politécnica de Madrid (UPM)] in Spain. From January 2008, VNUML development is being partially supported by the Business Oriented Infrastructure (BOI) research initiative within the Bussiness Support Systems (BSS) unit at [http://www.tid.es Telefónica I+D].<br />
<br />
This software is released under GNU Public Licence. Since July 2004 the project is partially hosted at [http://sourceforge.net SourceForge.net]. Visit the [http://sourceforge.net/projects/vnuml VNUML site at SourceForge].<br />
<br />
<br />
<!--div align="center">[[Image:banner.jpg]]</div--><br />
<br />
<html><br />
<table width="60%" align="center"><br />
<tr><br />
<td align="left"><a href="http://www.dit.upm.es" alt="DIT logo"><br />
<img src="http://www.dit.upm.es/vnumlwiki/images/d/d8/Dit.jpg"><br />
</a><br />
</td><br />
<td align="right"><a href="http://www.tid.es" alt="TID logo"><br />
<img src="http://www.dit.upm.es/vnumlwiki/images/4/4c/Tid-boi.jpg"><br />
</td><br />
</tr><br />
</table><br />
</html><br />
<br />
== VNUML News ==<br />
<br />
'''Nov 18th, 2009''' -- New VNUML Virtual appliance (2.2-rc2) has been contributed by Borja Garnelo and Héctor Rodríguez. More information [[Download#Additional_downloads|here]]. <br />
<br />
'''May 22nd, 2009''' -- New stable releases: VNUML (1.8.9), UML kernel (2.6.28.10-1m) and root_fs_tutorial (0.6.0). You can find them in the [[download]] page.<br />
<br />
'''March 19th, 2009''' -- New EDIV release [https://sourceforge.net/project/showfiles.php?group_id=113582&package_id=293383&release_id=669125 (0.9.4)].<br />
<br />
'''March 11th, 2009''' -- New VNUML stable release, fixing a problem in 1.8.7 ([http://sourceforge.net/project/showfiles.php?group_id=113582&package_id=123470&release_id=667292 1.8.7.1]).<br />
<br />
'''March 8th, 2009''' -- New VNUML stable release: [https://sourceforge.net/project/showfiles.php?group_id=113582&package_id=123470&release_id=666734 1.8.7].<br />
<br />
'''February 19th, 2009''' -- New EDIV release [http://sourceforge.net/project/showfiles.php?group_id=113582&package_id=293383&release_id=662345 (0.9.3)].<br />
<br />
'''November 30th, 2008''' -- New VNUML stable release: [https://sourceforge.net/project/showfiles.php?group_id=113582&package_id=123470&release_id=643984 1.8.5].<br />
<br />
'''November 6th, 2008''' -- New EDIV release [http://sourceforge.net/project/showfiles.php?group_id=113582&package_id=293383&release_id=638717 (0.9.2)]<br />
<br />
[[All News]]</div>Davidhttps://web.dit.upm.es/vnumlwiki/index.php?title=VNX&diff=4149VNX2011-11-29T10:36:30Z<p>David: </p>
<hr />
<div><br />
{{Title|VNX Project}}<br />
<br />
Virtual Networks over Linux project information has been moved to a new wiki:<br />
<br />
http://www.dit.upm.es/vnx<br />
<br />
<!--<br />
<br />
'''VNX (Virtualization over X)''' is the new release of the '''VNUML''' tool. VNX brings important new functionalities that overcome the most important limitations VNUML tool has:<br />
* Integration of new virtualization platforms to allow virtual machines running other operating systems (Windows, FreeBSD, etc) apart from Linux. In this sense:<br />
** VNX uses [http://libvirt.org libvirt] to interact with the virtualization capabilities, allowing the use of most of the virtualization platforms available for Linux (KVM, Xen, etc)<br />
** Integrates [http://www.ipflow.utc.fr/blog/ Dynamips] to allow limited emulation of CISCO routers<br />
* Restart of individual virtual machines<br />
* Autoconfiguration and command execution capabilities for several operating systems: Linux, FreeBSD and Windows (XP and 7).<br />
<br />
== Information for users ==<br />
* [[vnx-install|VNX Installation Guide]]<br />
* [[vnx-examples|Example scenarios]]<br />
* [[vnx-troubleshooting|Troubleshooting]]<br />
* Rootfilesystem creation How-to's:<br />
** [[vnx-rootfswinxp|How to create a Windows XP rootfilesystem for VNX]]<br />
** [[vnx-rootfswin7|How to create a Windows 7 rootfilesystem for VNX]]<br />
** [[vnx-rootfsubuntu|How to create a Ubuntu rootfilesytem for VNX]]<br />
** [[vnx-rootfsfreebsd|How to create a FreeBSD rootfilesytem for VNX]]<br />
** [[vnx-rootfsolive|How to create an Olive (juniper router) rootfilesystem for VNX]]<br />
** [[vnx-rootfsfedora|How to create a Fedora rootfilesytem for VNX]]<br />
<br />
== Downloading VNX ==<br />
<br />
You can download VNX from http://idefix.dit.upm.es/download/vnx<br />
<br />
VNX Root filesystems are temporarily hosted in http://idefix.dit.upm.es/download/vnx/filesystems<br />
--></div>Davidhttps://web.dit.upm.es/vnumlwiki/index.php?title=VNX&diff=4148VNX2011-11-29T10:33:37Z<p>David: </p>
<hr />
<div>#REDIRECT [http://www.dit.upm.es/vnx]<br />
<br />
{{Title|VNX Project Documentation}}<br />
<br />
'''VNX (Virtualization over X)''' is the new release of the '''VNUML''' tool. VNX brings important new functionalities that overcome the most important limitations VNUML tool has:<br />
* Integration of new virtualization platforms to allow virtual machines running other operating systems (Windows, FreeBSD, etc) apart from Linux. In this sense:<br />
** VNX uses [http://libvirt.org libvirt] to interact with the virtualization capabilities, allowing the use of most of the virtualization platforms available for Linux (KVM, Xen, etc)<br />
** Integrates [http://www.ipflow.utc.fr/blog/ Dynamips] to allow limited emulation of CISCO routers<br />
* Restart of individual virtual machines<br />
* Autoconfiguration and command execution capabilities for several operating systems: Linux, FreeBSD and Windows (XP and 7).<br />
<br />
== Information for users ==<br />
* [[vnx-install|VNX Installation Guide]]<br />
* [[vnx-examples|Example scenarios]]<br />
* [[vnx-troubleshooting|Troubleshooting]]<br />
* Rootfilesystem creation How-to's:<br />
** [[vnx-rootfswinxp|How to create a Windows XP rootfilesystem for VNX]]<br />
** [[vnx-rootfswin7|How to create a Windows 7 rootfilesystem for VNX]]<br />
** [[vnx-rootfsubuntu|How to create a Ubuntu rootfilesytem for VNX]]<br />
** [[vnx-rootfsfreebsd|How to create a FreeBSD rootfilesytem for VNX]]<br />
** [[vnx-rootfsolive|How to create an Olive (juniper router) rootfilesystem for VNX]]<br />
** [[vnx-rootfsfedora|How to create a Fedora rootfilesytem for VNX]]<br />
<br />
== Downloading VNX ==<br />
<br />
You can download VNX from http://idefix.dit.upm.es/download/vnx<br />
<br />
VNX Root filesystems are temporarily hosted in http://idefix.dit.upm.es/download/vnx/filesystems</div>Davidhttps://web.dit.upm.es/vnumlwiki/index.php?title=PluginsDummyCode&diff=4147PluginsDummyCode2011-08-20T00:13:02Z<p>David: </p>
<hr />
<div><pre><br />
# Dummy.pm<br />
#<br />
# This file is a sample for VNUML extension plugins. It can be used<br />
# as a template to implement custom user plugins. Note that, in order<br />
# to conform the VNUML plugins API, the modules has to implement all<br />
# the methods.<br />
<br />
package dummy;<br />
<br />
@ISA = qw(Exporter);<br />
@EXPORT = qw(createPlugin<br />
bootingCreateFiles<br />
bootingCommands<br />
execCreateFiles<br />
execCommands<br />
shutdownCommand<br />
finalizePlugin);<br />
<br />
use strict;<br />
<br />
# createPlugin<br />
#<br />
# To be called always, just before starting procesing the scenario specification<br />
#<br />
# Arguments:<br />
# - the operation mode ("t","x","d" or "P")<br />
# - the plugin configuration file<br />
#<br />
# Returns:<br />
# - an error message or 0 if all is ok<br />
#<br />
sub createPlugin {<br />
<br />
my $self = shift; <br />
my $mode = shift;<br />
my $conf = shift;<br />
<br />
# Sample code<br />
print "dummy plugin: creating in mode $mode with file $conf\n";<br />
<br />
# Example of error message returning:<br />
#<br />
# return "an error has occur in dummy plugin" <br />
#<br />
return 0;<br />
}<br />
<br />
# bootingCreateFiles<br />
#<br />
# To be called during "t" mode, for each vm in the scenario<br />
#<br />
# Arguments:<br />
# - vm name<br />
#<br />
# Returns:<br />
# - a hashname which kyes are absolute pathnames of files in vm filesystem and<br />
# values the the pathname of the file in the host filesystem. The file in the<br />
# host filesytesm is removed after VNUML processed it, so temporal files in <br />
# /tmp are preferable)<br />
#<br />
sub bootingCreateFiles {<br />
<br />
my $self = shift; <br />
my $vm = shift;<br />
<br />
my %files;<br />
<br />
# Sample code<br />
print "dummy plugin: booting create files for vm $vm\n";<br />
system("touch /tmp/boot1.$vm");<br />
system("touch /tmp/boot2.$vm");<br />
<br />
$files{"/etc/init.d/boot1"} = "/tmp/boot1.$vm";<br />
$files{"/etc/init.d/boot2"} = "/tmp/boot2.$vm";<br />
<br />
return %files;<br />
}<br />
<br />
# bootingCommands<br />
#<br />
# To be called during "t" mode, for each vm in the scenario<br />
#<br />
# Arguments:<br />
# - vm name<br />
# <br />
# Returns:<br />
# - list of commands to execute in the virtual machine at booting time<br />
#<br />
sub bootingCommands {<br />
<br />
my $self = shift; <br />
my $vm = shift;<br />
<br />
my @commands;<br />
<br />
# Sample code<br />
print "dummy plugin: booting commands for vm $vm\n";<br />
<br />
push (@commands,"sh /etc/init.d/boot1");<br />
push (@commands,"sh /etc/init.d/boot2");<br />
<br />
return @commands;<br />
<br />
}<br />
<br />
# execCreateFiles<br />
#<br />
# To be called during "x" mode, for each vm in the scenario<br />
#<br />
# Arguments:<br />
# - vm name<br />
# - seq command sequence<br />
#<br />
# Returns:<br />
# - a hashname which keys are absolute pathnames of files in vm filesystem and<br />
# values the the pathname of the file in the host filesystem. The file in the<br />
# host filesytesm is removed after VNUML processed it, so temporal files in <br />
# /tmp are preferable)<br />
#<br />
sub execCreateFiles {<br />
<br />
my $self = shift; <br />
my $vm = shift;<br />
my $seq = shift;<br />
<br />
my %files;<br />
<br />
# Sample code<br />
print "dummy plugin: exec create files for vm $vm and seq $seq\n";<br />
system("touch /tmp/exec1.$vm.$seq");<br />
system("touch /tmp/exec2.$vm.$seq");<br />
<br />
$files{"/etc/init.d/exec1.$seq"} = "/tmp/exec1.$vm.$seq";<br />
$files{"/etc/init.d/exec2.$seq"} = "/tmp/exec2.$vm.$seq";<br />
<br />
return %files;<br />
}<br />
<br />
# execCommands<br />
#<br />
# To be called during "x" mode, for each vm in the scenario<br />
#<br />
# Arguments:<br />
# - vm name<br />
# - seq command sequence<br />
# <br />
# Returns:<br />
# - list of commands to execute in the virtual machine after <exec> processing<br />
#<br />
sub execCommands {<br />
<br />
my $self = shift;<br />
my $vm = shift;<br />
my $seq = shift;<br />
<br />
my @commands;<br />
<br />
# Sample code<br />
print "dummy plugin: exec commands for vm $vm and seq $seq\n";<br />
<br />
push (@commands,"sh /etc/init.d/exec1.$seq");<br />
push (@commands,"sh /etc/init.d/exec2.$seq"); <br />
<br />
return @commands;<br />
}<br />
<br />
# shutdownCommand<br />
#<br />
# To be called during "d" mode, for each vm in the scenario<br />
#<br />
# Arguments:<br />
# - vm name<br />
# <br />
# Returns:<br />
# - list of commands to execute in the virtual machine at shutdown time<br />
#<br />
sub shutdownCommands {<br />
<br />
my $self = shift; <br />
my $vm = shift;<br />
<br />
my @commands;<br />
<br />
# Sample code<br />
print "dummy plugin: shutdown commands for vm $vm\n";<br />
<br />
push (@commands,"sh /etc/init.d/shutdown1");<br />
push (@commands,"sh /etc/init.d/shutdown2"); <br />
<br />
return @commands;<br />
<br />
}<br />
<br />
# finalizePlugin<br />
#<br />
# To be called always, just before ending the procesing the scenario specification<br />
#<br />
# Arguments:<br />
# - none<br />
#<br />
# Returns:<br />
# - none<br />
#<br />
sub finalizePlugin {<br />
<br />
my $self = shift; <br />
<br />
# Sample code<br />
print "dummy plugin: finishing\n"<br />
}<br />
<br />
1;<br />
</pre></div>Davidhttps://web.dit.upm.es/vnumlwiki/index.php?title=PluginsOspfCode&diff=4146PluginsOspfCode2011-07-21T08:51:08Z<p>David: Created page with "<pre> # Ospfd.pm # # The ospfd plugin package ospfd; @ISA = qw(Exporter); @EXPORT = qw(createPlugin bootingCreateFiles bootingCommands ex..."</p>
<hr />
<div><pre><br />
# Ospfd.pm<br />
#<br />
# The ospfd plugin<br />
<br />
package ospfd;<br />
<br />
@ISA = qw(Exporter);<br />
@EXPORT = qw(createPlugin<br />
bootingCreateFiles<br />
bootingCommands<br />
execCreateFiles<br />
execCommands<br />
shutdownCommand<br />
finalizePlugin);<br />
<br />
###########################################################<br />
# Modules import<br />
###########################################################<br />
<br />
use strict;<br />
use XML::DOM; # XML management library<br />
use File::Basename; # File management library<br />
<br />
use Switch;<br />
<br />
use Socket; # To resolve hostnames to IPs<br />
<br />
use XML::DOM::ValParser; # To check DTD<br />
<br />
<br />
###########################################################<br />
# Global variables <br />
###########################################################<br />
<br />
my $globalNode;<br />
my $valid_fail;<br />
<br />
###########################################################<br />
# Subroutines <br />
###########################################################<br />
<br />
###########################################################<br />
# Create plugin<br />
#<br />
# To be called always, just before starting procesing the scenario specification<br />
#<br />
# Arguments:<br />
# - the operation mode ("t","x","d" or "P")<br />
# - the plugin configuration file<br />
#<br />
# Returns:<br />
# - an error message or 0 if all is ok<br />
#<br />
#<br />
###########################################################<br />
<br />
sub createPlugin{<br />
<br />
my $self = shift; <br />
my $mode = shift;<br />
my $conf = shift;<br />
<br />
my $error;<br />
<br />
eval{<br />
$error = &checkConfigFile($conf);<br />
};<br />
<br />
if ($@){<br />
$error = $@;<br />
}<br />
return $error;<br />
}<br />
<br />
###########################################################<br />
# bootingCreateFiles<br />
#<br />
# To be called during "t" mode, for each vm in the scenario<br />
#<br />
# Arguments:<br />
# - vm name<br />
#<br />
# Returns:<br />
# - a hashname which keys are absolute pathnames of files in vm filesystem and<br />
# values the the pathname of the file in the host filesystem. The file in the<br />
# host filesytesm is removed after VNUML processed it, so temporal files in <br />
# /tmp are preferable)<br />
###########################################################<br />
<br />
sub bootingCreateFiles{<br />
<br />
my $self = shift;<br />
my $vm = shift;<br />
<br />
my %files;<br />
<br />
my $virtualmList=$globalNode->getElementsByTagName("vm");<br />
my $longitud = $virtualmList->getLength;<br />
<br />
for (my $m=0; $m<$longitud; $m++){<br />
<br />
my $virtualm = $virtualmList->item($m);<br />
my $virtualm_name = $virtualm->getAttribute("name");<br />
<br />
if ($virtualm_name eq $vm){<br />
my $zebra_file = "/tmp/$vm"."_zebra.conf";<br />
my $ospfd_file = "/tmp/$vm"."_ospfd.conf";<br />
<br />
my $zebraTagList = $virtualm->getElementsByTagName("zebra");<br />
my $zebraTag = $zebraTagList->item($0);<br />
my $zebra_hostname = $zebraTag->getAttribute("hostname");<br />
my $zebra_password = $zebraTag->getAttribute("password");<br />
<br />
chomp(my $date = `date`);<br />
<br />
open(ZEBRA, ">$zebra_file") or $files{"ERROR"} = "Cannot open $zebra_file file";<br />
print ZEBRA "! zebra.conf file generated by ospfd.pm VNUML plugin at $date\n";<br />
print ZEBRA "hostname $zebra_hostname\n";<br />
print ZEBRA "password $zebra_password\n";<br />
print ZEBRA "log file /var/log/zebra/zebra.log\n"; <br />
close (ZEBRA);<br />
<br />
open(OSPFD, ">$ospfd_file") or $files{"ERROR"} = "Cannot open $ospfd_file file";<br />
print OSPFD "! ospfd.conf file generated by ospfd.pm VNUML plugin at $date\n";<br />
print OSPFD "hostname $zebra_hostname\n";<br />
print OSPFD "password $zebra_password\n";<br />
print OSPFD "log file /var/log/zebra/ospfd.log\n!\n";<br />
print OSPFD "router ospf\n";<br />
<br />
my $networkTagList = $virtualm->getElementsByTagName("network");<br />
my $longitudNetwork = $networkTagList->getLength;<br />
for (my $n=0; $n<$longitudNetwork; $n++){<br />
my $networkTag = $networkTagList->item($n);<br />
my $ipTagList = $networkTag->getElementsByTagName("ip");<br />
<br />
my $ipTag = $ipTagList->item($0);<br />
my $ipMask = $ipTag->getAttribute("mask");<br />
my $ipData = $ipTag->getFirstChild->getData;<br />
<br />
my $areaTagList = $networkTag->getElementsByTagName("area");<br />
my $areaTag = $areaTagList->item($0);<br />
my $areaData = $areaTag->getFirstChild->getData;<br />
<br />
print OSPFD " network $ipData/$ipMask area $areaData\n";<br />
}<br />
print OSPFD "!\n"; <br />
close (OSPFD); <br />
<br />
$files{"/etc/quagga/zebra.conf"} = $zebra_file;<br />
$files{"/etc/quagga/ospfd.conf"} = $ospfd_file;<br />
}<br />
<br />
<br />
}<br />
<br />
return %files;<br />
}<br />
<br />
sub bootingCommands{<br />
<br />
<br />
}<br />
<br />
sub execVmsToUse {<br />
<br />
my $self = shift;<br />
my $seq = shift;<br />
<br />
# The plugin has nothing to do for VMs with sequences other than<br />
# start, restart or stop, so in that case it returns an empty list<br />
unless ($seq eq "start" || $seq eq "ospf-start" || $seq eq "restart" || $seq eq "ospf-restart" || $seq eq "stop" || $seq eq "ospf-stop" || $seq eq "redoconf" || $seq eq "ospf-redoconf") {<br />
return ();<br />
}<br />
<br />
my @vm_list = ();<br />
<br />
my $virtualmList=$globalNode->getElementsByTagName("vm");<br />
my $longitud = $virtualmList->getLength;<br />
<br />
for (my $m=0; $m<$longitud; $m++){<br />
<br />
my $virtualm = $virtualmList->item($m);<br />
push (@vm_list,$virtualm->getAttribute("name"));<br />
}<br />
<br />
return @vm_list;<br />
<br />
}<br />
###########################################################<br />
# execCreateFiles<br />
#<br />
# To be called during "x" mode, for each vm in the scenario<br />
#<br />
# Arguments:<br />
# - vm name<br />
# - seq command sequence<br />
#<br />
# Returns:<br />
# - a hashname which kyes are absolute pathnames of files in vm filesystem and<br />
# values the the pathname of the file in the host filesystem. The file in the<br />
# host filesytesm is removed after VNUML processed it, so temporal files in <br />
# /tmp are preferable)<br />
#<br />
###########################################################<br />
sub execCreateFiles{<br />
my $self = shift;<br />
my $vm = shift;<br />
my $seq = shift;<br />
<br />
my %files;<br />
<br />
if (($seq eq "redoconf") || ($seq eq "ospf-redoconf")){ <br />
<br />
<br />
my $virtualmList=$globalNode->getElementsByTagName("vm");<br />
my $longitud = $virtualmList->getLength;<br />
<br />
for (my $m=0; $m<$longitud; $m++){<br />
<br />
my $virtualm = $virtualmList->item($m);<br />
my $virtualm_name = $virtualm->getAttribute("name");<br />
<br />
if ($virtualm_name eq $vm){<br />
my $zebra_file = "/tmp/$vm"."_zebra.conf";<br />
my $ospfd_file = "/tmp/$vm"."_ospfd.conf";<br />
<br />
my $zebraTagList = $virtualm->getElementsByTagName("zebra");<br />
my $zebraTag = $zebraTagList->item($0);<br />
my $zebra_hostname = $zebraTag->getAttribute("hostname");<br />
my $zebra_password = $zebraTag->getAttribute("password");<br />
<br />
chomp(my $date = `date`);<br />
<br />
open(ZEBRA, ">$zebra_file") or $files{"ERROR"} = "Cannot open $zebra_file file";<br />
print ZEBRA "! zebra.conf file generated by ospfd.pm VNUML plugin at $date\n";<br />
print ZEBRA "hostname $zebra_hostname\n";<br />
print ZEBRA "password $zebra_password\n";<br />
print ZEBRA "log file /var/log/zebra/zebra.log\n"; <br />
close (ZEBRA);<br />
<br />
open(OSPFD, ">$ospfd_file") or $files{"ERROR"} = "Cannot open $ospfd_file file";<br />
print OSPFD "! ospfd.conf file generated by ospfd.pm VNUML plugin at $date\n";<br />
print OSPFD "hostname $zebra_hostname\n";<br />
print OSPFD "password $zebra_password\n";<br />
print OSPFD "log file /var/log/zebra/ospfd.log\n!\n";<br />
print OSPFD "router ospf\n";<br />
<br />
my $networkTagList = $virtualm->getElementsByTagName("network");<br />
my $longitudNetwork = $networkTagList->getLength;<br />
for (my $n=0; $n<$longitudNetwork; $n++){<br />
my $networkTag = $networkTagList->item($n);<br />
my $ipTagList = $networkTag->getElementsByTagName("ip");<br />
<br />
my $ipTag = $ipTagList->item($0);<br />
my $ipMask = $ipTag->getAttribute("mask");<br />
my $ipData = $ipTag->getFirstChild->getData;<br />
<br />
my $areaTagList = $networkTag->getElementsByTagName("area");<br />
my $areaTag = $areaTagList->item($0);<br />
my $areaData = $areaTag->getFirstChild->getData;<br />
<br />
print OSPFD " network $ipData/$ipMask area $areaData\n";<br />
}<br />
print OSPFD "!\n"; <br />
close (OSPFD); <br />
<br />
$files{"/etc/quagga/zebra.conf"} = $zebra_file;<br />
$files{"/etc/quagga/ospfd.conf"} = $ospfd_file;<br />
}<br />
}<br />
<br />
}<br />
return %files; <br />
<br />
}<br />
<br />
###########################################################<br />
# execCommands<br />
#<br />
# To be called during "x" mode, for each vm in the scenario<br />
#<br />
# Arguments:<br />
# - vm name<br />
# - seq command sequence<br />
# <br />
# Returns:<br />
# - list of commands to execute in the virtual machine after <exec> processing<br />
###########################################################<br />
<br />
sub execCommands{<br />
<br />
my $self = shift;<br />
my $vm = shift;<br />
my $seq = shift;<br />
<br />
my @commands;<br />
<br />
my $type;<br />
my $subtype;<br />
<br />
my $zebra_bin = "";<br />
my $ospfd_bin = "";<br />
<br />
<br />
my $virtualmList=$globalNode->getElementsByTagName("vm");<br />
my $longitud = $virtualmList->getLength;<br />
<br />
for (my $m=0; $m<$longitud; $m++){<br />
<br />
my $virtualm = $virtualmList->item($m);<br />
my $virtualm_name = $virtualm->getAttribute("name");<br />
<br />
if ( $vm eq $virtualm_name){<br />
$type = $virtualm->getAttribute("type");<br />
$subtype = $virtualm->getAttribute("subtype");<br />
my $zebraBinTagList = $virtualm->getElementsByTagName("zebra_bin");<br />
my $longitudZebra = $zebraBinTagList->getLength;<br />
if ($longitudZebra == 1){<br />
$zebra_bin = $zebraBinTagList->item($0)->getFirstChild->getData;<br />
}<br />
my $ospfdBinTagList = $virtualm->getElementsByTagName("ospfd_bin");<br />
my $longitudOspfd = $ospfdBinTagList->getLength;<br />
if ($longitudOspfd == 1){<br />
$ospfd_bin = $ospfdBinTagList->item($0)->getFirstChild->getData;<br />
}<br />
<br />
switch ($type) {<br />
case "quagga"{ <br />
switch ($subtype){<br />
case "lib-install"{<br />
<br />
if ($zebra_bin eq ""){<br />
$zebra_bin = "/usr/lib/quagga/zebra";<br />
}<br />
if ($ospfd_bin eq ""){<br />
$ospfd_bin = "/usr/lib/quagga/ospfd";<br />
}<br />
unshift (@commands, "");<br />
}<br />
case "sbin-install"{<br />
<br />
if ($zebra_bin eq ""){<br />
$zebra_bin = "/usr/sbin/zebra";<br />
}<br />
if ($ospfd_bin eq ""){<br />
$ospfd_bin = "/usr/sbin/ospfd";<br />
}<br />
unshift (@commands, "");<br />
<br />
} else {<br />
unshift (@commands, "Your choice $subtype is not a recognized subtype (yet)\n");<br />
}<br />
}<br />
} else {<br />
unshift (@commands, "Your choice $type is not a recognized type (yet)\n");<br />
}<br />
}<br />
<br />
if (($seq eq "start") || ($seq eq "ospf-start")){<br />
<br />
push (@commands, "$zebra_bin -d");<br />
push (@commands, "$ospfd_bin -d");<br />
<br />
<br />
}elsif(($seq eq "restart") || ($seq eq "ospf-restart")){<br />
<br />
push (@commands, "killall zebra");<br />
push (@commands, "killall ospfd");<br />
<br />
push (@commands, "$zebra_bin -d");<br />
push (@commands, "$ospfd_bin -d");<br />
<br />
}elsif(($seq eq "stop") || ($seq eq "ospf-stop")){<br />
<br />
push (@commands, "killall zebra");<br />
push (@commands, "killall ospfd");<br />
<br />
}<br />
}<br />
}<br />
<br />
return @commands; <br />
<br />
}<br />
<br />
sub finalizePlugin{<br />
<br />
<br />
}<br />
<br />
sub shutdownCommands{<br />
<br />
<br />
}<br />
<br />
<br />
#############################################################<br />
#<br />
# Checks existence and semantics in ospf conf file. <br />
# Currently this check consist in:<br />
#<br />
# 1. Configuration file exists.<br />
# 2. Check DTD.<br />
#<br />
#############################################################<br />
<br />
sub checkConfigFile{<br />
<br />
# 1. Configuration file exists.<br />
my $config_file = shift;<br />
open(FILEHANDLE, $config_file) or {<br />
return "cannot open config file $config_file\n",<br />
};<br />
close (FILEHANDLE);<br />
<br />
# 2. Check DTD<br />
my $parser = new XML::DOM::ValParser;<br />
my $dom_tree;<br />
$valid_fail = 0;<br />
eval {<br />
local $XML::Checker::FAIL = \&validation_fail;<br />
$dom_tree = $parser->parsefile($config_file);<br />
};<br />
<br />
if ($valid_fail) {<br />
return ("$config_file is not a well-formed OSPF plugin file\n");<br />
}<br />
<br />
$globalNode = $dom_tree->getElementsByTagName("ospf_conf")->item(0);<br />
<br />
return 0; <br />
}<br />
<br />
sub validation_fail {<br />
my $code = shift;<br />
# To set flag<br />
$valid_fail = 1;<br />
# To print error message<br />
XML::Checker::print_error ($code, @_);<br />
}<br />
<br />
1<br />
<br />
<br />
<br />
</pre></div>Davidhttps://web.dit.upm.es/vnumlwiki/index.php?title=Plugins&diff=4145Plugins2011-07-21T08:50:46Z<p>David: </p>
<hr />
<div>{{Title|VNUML Extension Plugins}}<br />
<br />
<span style="color:red"><strong>Under construction!</strong></span><br />
<br />
Since VNUML 1.9 an extension plugins mechanism has been developed, so new functionality can be added to create files and execute commands in the virtual machines. You can use the plugins included in the VNUML or develop your owns, using the VNUML plugins API.<br />
<br />
* [[PluginsAPI|Plugin API specification]]<br />
* [[PluginsHowto|Plugin development howto]]<br />
<br />
Plugins included in the VNUML package:<br />
<br />
* [[PluginOspfd|Ospfd]], to configure OSPF daemons in the virtual machines<br />
* [[PluginDhcp|Dhcp]], to provide DHCP capabilities in the virtual machines<br />
<br />
Plugins code:<br />
* [[PluginsDummyCode|Dummy]]<br />
* [[PluginsDhcpCode|DHCP]]<br />
* [[PluginsOspfCode|OSPF]]</div>Davidhttps://web.dit.upm.es/vnumlwiki/index.php?title=PluginsDummyCode&diff=4144PluginsDummyCode2011-07-21T08:50:21Z<p>David: </p>
<hr />
<div><pre><br />
# Dummy.pm<br />
#<br />
# This file is a sample for VNUML extension plugins. It can be used<br />
# as a template to implement custom user plugins. Note that, in order<br />
# to conform the VNUML plugins API, the modules has to implement all<br />
# the methods.<br />
<br />
package dummy;<br />
<br />
@ISA = qw(Exporter);<br />
@EXPORT = qw(createPlugin<br />
bootingCreateFiles<br />
bootingCommands<br />
execCreateFiles<br />
execCommands<br />
shutdownCommand<br />
finalizePlugin);<br />
<br />
use strict;<br />
<br />
# createPlugin<br />
#<br />
# To be called always, just before starting procesing the scenario specification<br />
#<br />
# Arguments:<br />
# - the operation mode ("t","x","d" or "P")<br />
# - the plugin configuration file<br />
#<br />
# Returns:<br />
# - an error message or 0 if all is ok<br />
#<br />
sub createPlugin {<br />
<br />
my $self = shift; <br />
my $mode = shift;<br />
my $conf = shift;<br />
<br />
# Sample code<br />
print "dummy plugin: creating in mode $mode with file $conf\n";<br />
<br />
# Example of error message returning:<br />
#<br />
# return "an error has occur in dummy plugin" <br />
#<br />
return 0;<br />
}<br />
<br />
# bootingCreateFiles<br />
#<br />
# To be called during "t" mode, for each vm in the scenario<br />
#<br />
# Arguments:<br />
# - vm name<br />
#<br />
# Returns:<br />
# - a hashname which kyes are absolute pathnames of files in vm filesystem and<br />
# values the the pathname of the file in the host filesystem. The file in the<br />
# host filesytesm is removed after VNUML processed it, so temporal files in <br />
# /tmp are preferable)<br />
#<br />
sub bootingCreateFiles {<br />
<br />
my $self = shift; <br />
my $vm = shift;<br />
<br />
my %files;<br />
<br />
# Sample code<br />
print "dummy plugin: booting create files for vm $vm\n";<br />
system("touch /tmp/boot1.$vm");<br />
system("touch /tmp/boot2.$vm");<br />
<br />
$files{"/etc/init.d/boot1"} = "/tmp/boot1.$vm";<br />
$files{"/etc/init.d/boot2"} = "/tmp/boot2.$vm";<br />
<br />
return %files;<br />
}<br />
<br />
# bootingCommands<br />
#<br />
# To be called during "t" mode, for each vm in the scenario<br />
#<br />
# Arguments:<br />
# - vm name<br />
# <br />
# Returns:<br />
# - list of commands to execute in the virtual machine at booting time<br />
#<br />
sub bootingCommands {<br />
<br />
my $self = shift; <br />
my $vm = shift;<br />
<br />
my @commands;<br />
<br />
# Sample code<br />
print "dummy plugin: booting commands for vm $vm\n";<br />
<br />
push (@commands,"sh /etc/init.d/boot1");<br />
push (@commands,"sh /etc/init.d/boot2");<br />
<br />
return @commands;<br />
<br />
}<br />
<br />
# execCreateFiles<br />
#<br />
# To be called during "x" mode, for each vm in the scenario<br />
#<br />
# Arguments:<br />
# - vm name<br />
# - seq command sequence<br />
#<br />
# Returns:<br />
# - a hashname which kyes are absolute pathnames of files in vm filesystem and<br />
# values the the pathname of the file in the host filesystem. The file in the<br />
# host filesytesm is removed after VNUML processed it, so temporal files in <br />
# /tmp are preferable)<br />
#<br />
sub execCreateFiles {<br />
<br />
my $self = shift; <br />
my $vm = shift;<br />
my $seq = shift;<br />
<br />
my %files;<br />
<br />
# Sample code<br />
print "dummy plugin: exec create files for vm $vm and seq $seq\n";<br />
system("touch /tmp/exec1.$vm.$seq");<br />
system("touch /tmp/exec2.$vm.$seq");<br />
<br />
$files{"/etc/init.d/exec1.$seq"} = "/tmp/exec1.$vm.$seq";<br />
$files{"/etc/init.d/exec2.$seq"} = "/tmp/exec2.$vm.$seq";<br />
<br />
return %files;<br />
}<br />
<br />
# execCommands<br />
#<br />
# To be called during "x" mode, for each vm in the scenario<br />
#<br />
# Arguments:<br />
# - vm name<br />
# - seq command sequence<br />
# <br />
# Returns:<br />
# - list of commands to execute in the virtual machine after <exec> processing<br />
#<br />
sub execCommands {<br />
<br />
my $self = shift;<br />
my $vm = shift;<br />
my $seq = shift;<br />
<br />
my @commands;<br />
<br />
# Sample code<br />
print "dummy plugin: exec commands for vm $vm and seq $seq\n";<br />
<br />
push (@commands,"sh /etc/init.d/exec1.$seq");<br />
push (@commands,"sh /etc/init.d/exec2.$seq"); <br />
<br />
return @commands;<br />
}<br />
<br />
# shutdownCommand<br />
#<br />
# To be called during "d" mode, for each vm in the scenario<br />
#<br />
# Arguments:<br />
# - vm name<br />
# <br />
# Returns:<br />
# - list of commands to execute in the virtual machine at shutdown time<br />
#<br />
sub shutdownCommands {<br />
<br />
my $self = shift; <br />
my $vm = shift;<br />
<br />
my @commands;<br />
<br />
# Sample code<br />
print "dummy plugin: shutdown commands for vm $vm\n";<br />
<br />
push (@commands,"sh /etc/init.d/shutdown1");<br />
push (@commands,"sh /etc/init.d/shutdown2"); <br />
<br />
return @commands;<br />
<br />
}<br />
<br />
# finalizePlugin<br />
#<br />
# To be called always, just before ending the procesing the scenario specification<br />
#<br />
# Arguments:<br />
# - none<br />
#<br />
# Returns:<br />
# - none<br />
#<br />
sub finalizePlugin {<br />
<br />
my $self = shift; <br />
<br />
# Sample code<br />
print "dummy plugin: finishing\n"<br />
}<br />
<br />
1;<br />
</pre></div>Davidhttps://web.dit.upm.es/vnumlwiki/index.php?title=PluginsDhcpCode&diff=4143PluginsDhcpCode2011-07-21T08:49:56Z<p>David: Created page with "<pre> # dhcp.pm # # The dhcp plugin package dhcp; @ISA = qw(Exporter); @EXPORT = qw(createPlugin bootingCreateFiles bootingCommands execC..."</p>
<hr />
<div><pre><br />
# dhcp.pm<br />
#<br />
# The dhcp plugin<br />
<br />
package dhcp;<br />
<br />
@ISA = qw(Exporter);<br />
@EXPORT = qw(createPlugin<br />
bootingCreateFiles<br />
bootingCommands<br />
execCreateFiles<br />
execCommands<br />
shutdownCommand<br />
finalizePlugin);<br />
<br />
###########################################################<br />
# Modules no import<br />
###########################################################<br />
use strict;<br />
use Net::Netmask;<br />
use XML::DOM; # XML management library<br />
use File::Basename; # File management library<br />
use Switch;<br />
use Socket; # To resolve hostnames to IPs<br />
use XML::DOM::ValParser; # To check DTD<br />
<br />
<br />
###########################################################<br />
# Global variables <br />
###########################################################<br />
<br />
my $globalNode;<br />
my $valid_fail;<br />
<br />
<br />
###########################################################<br />
# Subroutines<br />
###########################################################<br />
<br />
###########################################################<br />
# createPlugin<br />
#<br />
# To be called always, just before starting procesing the scenario specification<br />
#<br />
# Arguments:<br />
# - the operation mode ("t","x","d" or "P")<br />
# - the plugin configuration file<br />
#<br />
# Returns:<br />
# - an error message or 0 if all is ok<br />
#<br />
###########################################################<br />
<br />
sub createPlugin {<br />
<br />
my $self = shift;<br />
my $mode = shift;<br />
my $conf = shift;<br />
<br />
my $error;<br />
<br />
print "dhcp: $conf\n";<br />
eval {<br />
$error = &checkConfigFile($conf);<br />
};<br />
<br />
if ($@) {<br />
$error = $@;<br />
}<br />
return $error;<br />
}<br />
<br />
###########################################################<br />
# bootingCreateFiles<br />
#<br />
# To be called during "t" mode, for each vm in the scenario<br />
#<br />
# Arguments:<br />
# - vm name<br />
#<br />
# Returns:<br />
# - a hashname which keys are absolute pathnames of files in vm filesystem and<br />
# values the the pathname of the file in the host filesystem. The file in the<br />
# host filesytesm is removed after VNUML processed it, so temporal files in<br />
# /tmp are preferable)<br />
#<br />
###########################################################<br />
<br />
sub bootingCreateFiles {<br />
<br />
my $self = shift;<br />
my $vm = shift;<br />
<br />
my %files;<br />
my $type;<br />
<br />
my $virtualmList = $globalNode->getElementsByTagName("vm");<br />
my $longitud = $virtualmList->getLength;<br />
<br />
for ( my $m = 0 ; $m < $longitud ; $m++ ){<br />
<br />
my $virtualm = $virtualmList->item($m);<br />
my $virtualm_name = $virtualm->getAttribute("name");<br />
<br />
if ( $virtualm_name eq $vm ){<br />
<br />
$type = $virtualm->getAttribute("type");<br />
<br />
switch ($type) {<br />
<br />
case "dhcp3" {<br />
<br />
my $serverTagList = $virtualm->getElementsByTagName("server");<br />
my $numservers = $serverTagList->getLength;<br />
if ( $numservers == 1 ) {<br />
<br />
# open filehandle to create /etc/dhcp3/dhcpd.conf file<br />
my $server_file = "/tmp/$vm" . "_server.conf";<br />
chomp( my $date = `date` );<br />
open( SERVER, ">$server_file" ) or $files{"ERROR"} = "Cannot open $server_file file";<br />
<br />
# server.conf file defaults<br />
print SERVER "# server.conf file generated by dhcp.pm VNUML plugin at $date\n\n";<br />
print SERVER "ddns-update-style none;\n";<br />
print SERVER "default-lease-time 120;\n";<br />
print SERVER "max-lease-time 120;\n";<br />
#print SERVER "log-facility local7;\n\n";<br />
<br />
# extract configuration from subnet blocks in dhcp_conf.xml<br />
my $server = $serverTagList->item(0);<br />
my $subnetTagList = $server->getElementsByTagName("subnet");<br />
my $numsubnets = $subnetTagList->getLength;<br />
<br />
for ( my $ns=0; $ns < $numsubnets ; $ns++ ) {<br />
my $subnet = $subnetTagList->item($ns);<br />
my $ipTagList = $subnet->getElementsByTagName("ip");<br />
my $numip = $ipTagList->getLength;<br />
<br />
# subnet declaration<br />
my $ipTag = $ipTagList->item($0);<br />
my $subnetmask = $ipTag->getAttribute("mask");<br />
my $subnetbaseip = $ipTag->getFirstChild->getData;<br />
my $block = new Net::Netmask("$subnetbaseip"."/"."$subnetmask");<br />
<br />
my $baseip = $block->base();<br />
my $mask = $block->mask();<br />
print SERVER "subnet $baseip netmask $mask {\n";<br />
<br />
# extract ip ranges in subnet<br />
my $rangeTagList = $subnet->getElementsByTagName("range");<br />
my $numranges = $rangeTagList->getLength;<br />
<br />
for ( my $nr = 0; $nr < $numranges ; $nr++ ) {<br />
my $rangeTag = $rangeTagList->item($nr);<br />
my $firstTagList = $rangeTag->getElementsByTagName("first");<br />
my $firstTag = $firstTagList->item(0);<br />
my $firstip = $firstTag->getFirstChild->getData;<br />
my $lastTagList = $rangeTag->getElementsByTagName("last");<br />
my $lastTag = $lastTagList->item(0);<br />
my $lastip = $lastTag->getFirstChild->getData;<br />
print SERVER " range $firstip $lastip;\n";<br />
}<br />
<br />
# extract routers in subnet (if any)<br />
my $routerTagList = $subnet->getElementsByTagName("router");<br />
my $numrouters = $routerTagList->getLength;<br />
<br />
if ( $numrouters > 0 ) {<br />
print SERVER " option routers";<br />
for ( my $nr = 0; $nr < $numrouters ; $nr++ ) {<br />
if ( $nr > 0 ) {<br />
print SERVER ",";<br />
}<br />
my $routerTag = $routerTagList->item($nr);<br />
my $router = $routerTag->getFirstChild->getData;<br />
print SERVER " $router";<br />
}<br />
print SERVER ";\n";<br />
}<br />
<br />
# extract dns in subnet (if any)<br />
my $dnsTagList = $subnet->getElementsByTagName("dns");<br />
my $numdns = $dnsTagList->getLength;<br />
if ( $numdns > 0 ) {<br />
print SERVER " option domain-name-servers";<br />
for ( my $nd = 0; $nd < $numdns ; $nd++ ) {<br />
if ( $nd > 0 ) {<br />
print SERVER ",";<br />
}<br />
my $dnsTag = $dnsTagList->item($nd);<br />
my $dns = $dnsTag->getFirstChild->getData;<br />
print SERVER " $dns";<br />
}<br />
print SERVER ";\n";<br />
}<br />
<br />
# extract domain in subnet (if specified)<br />
my $domainTagList = $subnet->getElementsByTagName("domain");<br />
my $numdomains = $domainTagList->getLength;<br />
if ( $numdomains == 1 ) {<br />
my $domainTag = $domainTagList->item(0);<br />
my $domain = $domainTag->getFirstChild->getData;<br />
print SERVER " option domain-name \"$domain\";\n";<br />
}<br />
<br />
# end subnet declaration in configuration file<br />
print SERVER "}\n\n";<br />
<br />
# extract hosts in subnet (if any)<br />
my $hostTagList = $subnet->getElementsByTagName("host");<br />
my $numhosts = $hostTagList->getLength;<br />
for ( my $nh = 0; $nh < $numhosts ; $nh++ ) {<br />
my $hostTag = $hostTagList->item($nh);<br />
my $hostname = $hostTag->getAttribute("name");<br />
my $hostmac = $hostTag->getAttribute("mac");<br />
my $hostip = $hostTag->getAttribute("ip");<br />
<br />
# ignore unmatching host declarations<br />
if ( $block->match($hostip) ) {<br />
print SERVER "host $hostname {\n hardware ethernet $hostmac;\n fixed-address $hostip;\n}\n\n";<br />
}<br />
}<br />
<br />
}<br />
close(SERVER);<br />
$files{"/etc/dhcp3/dhcpd.conf"} = $server_file;<br />
}<br />
<br />
my $relayTagList = $virtualm->getElementsByTagName("relay");<br />
my $numrelays = $relayTagList->getLength;<br />
if ( $numrelays == 1 ) {<br />
<br />
# Build file /etc/default/dhcp3-relay.conf<br />
my $relay_file = "/tmp/$vm" . "_relay.conf";<br />
chomp( my $date = `date` );<br />
open( RELAY, ">$relay_file" ) or $files{"ERROR"} = "Cannot open $relay_file file";<br />
print RELAY "# relay.conf file generated by dhcp.pm VNUML plugin at $date\n";<br />
print RELAY "SERVERS=\"";<br />
my $relay = $relayTagList->item(0);<br />
my $toserverTagList = $relay->getElementsByTagName("toserver");<br />
my $numtoservers = $toserverTagList->getLength;<br />
<br />
for ( my $nt = 0; $nt < $numtoservers ; $nt++ ) {<br />
my $toserverTag = $toserverTagList->item($nt);<br />
my $toserverData = $toserverTag->getFirstChild->getData;<br />
print RELAY "$toserverData ";<br />
}<br />
<br />
print RELAY "\"\n";<br />
close(RELAY);<br />
$files{"/etc/default/dhcp3-relay"} = $relay_file;<br />
}<br />
<br />
my $clientTagList = $virtualm->getElementsByTagName("client");<br />
my $numclients = $clientTagList->getLength;<br />
if ( $numclients == 1 ) {<br />
# Build file /etc/dhcp3/dhclient.conf<br />
my $client_file = "/tmp/$vm" . "_client.conf";<br />
chomp( my $date = `date` );<br />
open( CLIENT, ">$client_file" ) or $files{"ERROR"} = "Cannot open $client_file file";<br />
print CLIENT "# Configuration file for /sbin/dhclient, which is included in Debian's dhcp3-client package.\n";<br />
print CLIENT "# client.conf file generated by dhcp.pm VNUML plugin at $date\n\n";<br />
print CLIENT "send host-name \"<hostname>\";\n";<br />
print CLIENT "request subnet-mask, broadcast-address, time-offset, routers, domain-name, domain-name-servers, domain-search, host-name, netbios-name-servers, netbios-scope, interface-mtu;\n";<br />
print CLIENT "retry 10;\n";<br />
close(CLIENT);<br />
$files{"/etc/dhcp3/dhclient.conf"} = $client_file;<br />
<br />
}<br />
}else{<br />
$files{"ERROR"} = "Your choice $type for $vm is not a recognized type (yet)\n";<br />
}<br />
}<br />
}<br />
}<br />
return %files;<br />
}<br />
<br />
###########################################################<br />
# bootingCommands<br />
#<br />
# To be called during "t" mode, for each vm in the scenario<br />
#<br />
# Arguments:<br />
# - vm name<br />
#<br />
# Returns:<br />
# - list of commands to execute in the virtual machine at booting time<br />
#<br />
###########################################################<br />
<br />
sub bootingCommands {<br />
<br />
}<br />
<br />
<br />
###########################################################<br />
# execVmsToUse<br />
#<br />
# To be called once during "x" mode<br />
#<br />
# Arguments:<br />
# - seq command sequence<br />
#<br />
# Returns:<br />
# - list of virtual machines where the command has effect<br />
#<br />
###########################################################<br />
<br />
sub execVmsToUse {<br />
<br />
my $self = shift;<br />
my $seq = shift;<br />
<br />
# Four lists are built, one is returned depending on the executed command<br />
my @vm_list = ();<br />
my @server_vm_list = ();<br />
my @relay_vm_list = ();<br />
my @client_vm_list = ();<br />
<br />
my $virtualmList=$globalNode->getElementsByTagName("vm");<br />
my $longitud = $virtualmList->getLength;<br />
<br />
<br />
for (my $m=0; $m<$longitud; $m++){<br />
<br />
my $virtualm = $virtualmList->item($m);<br />
my $virtualm_name = $virtualm->getAttribute("name");<br />
push (@vm_list,$virtualm_name);<br />
<br />
my $serverTagList = $virtualm->getElementsByTagName("server");<br />
my $numservers = $serverTagList->getLength;<br />
my $relayTagList = $virtualm->getElementsByTagName("relay");<br />
my $numrelays = $relayTagList->getLength;<br />
my $clientTagList = $virtualm->getElementsByTagName("client");<br />
my $numclients = $clientTagList->getLength;<br />
<br />
if ( $numservers == 1 ) {<br />
push (@server_vm_list,$virtualm_name);<br />
}<br />
if ( $numrelays == 1 ) {<br />
push (@relay_vm_list,$virtualm_name);<br />
}<br />
if (!($numclients == 0)) {<br />
push (@client_vm_list,$virtualm_name);<br />
}<br />
}<br />
<br />
if ($seq eq "start" || $seq eq "restart" || $seq eq "stop" || $seq eq "dhcp-start" || $seq eq "dhcp-restart" || $seq eq "dhcp-stop") {<br />
return @vm_list;<br />
}elsif ($seq eq "dhcp-server-start"|| $seq eq "dhcp-server-stop" || $seq eq "dhcp-server-restart" || $seq eq "dhcp-server-force-reload"){<br />
return @server_vm_list;<br />
}elsif ( $seq eq "dhcp-relay-start"|| $seq eq "dhcp-relay-restart"|| $seq eq "dhcp-relay-stop"|| $seq eq "dhcp-relay-force-reload"){<br />
return @relay_vm_list;<br />
}elsif ($seq eq "dhcp-client-start"||$seq eq "dhcp-client-restart"||$seq eq "dhcp-client-stop"){<br />
return @client_vm_list;<br />
}else{<br />
return ();<br />
}<br />
}<br />
<br />
<br />
<br />
<br />
###########################################################<br />
# execCreateFiles<br />
#<br />
# To be called during "x" mode, for each vm in the scenario<br />
#<br />
# Arguments:<br />
# - vm name<br />
# - seq command sequence<br />
#<br />
# Returns:<br />
# - a hashname which kyes are absolute pathnames of files in vm filesystem and<br />
# values the the pathname of the file in the host filesystem. The file in the<br />
# host filesytesm is removed after VNUML processed it, so temporal files in<br />
# /tmp are preferable)<br />
#<br />
###########################################################<br />
<br />
sub execCreateFiles {<br />
}<br />
<br />
<br />
###########################################################<br />
# execCommands<br />
#<br />
# To be called during "x" mode, for each vm in the scenario<br />
#<br />
# Arguments:<br />
# - vm name<br />
# - seq command sequence<br />
#<br />
# Returns:<br />
# - list of commands to execute in the virtual machine after <exec> processing<br />
###########################################################<br />
<br />
sub execCommands {<br />
<br />
my $self = shift;<br />
my $vm = shift;<br />
my $seq = shift;<br />
<br />
my @commands;<br />
<br />
my $type;<br />
<br />
my $virtualmList = $globalNode->getElementsByTagName("vm");<br />
my $longitud = $virtualmList->getLength;<br />
<br />
for (my $m=0 ; $m<$longitud ; $m++) {<br />
<br />
my $virtualm = $virtualmList->item($m);<br />
my $virtualm_name = $virtualm->getAttribute("name");<br />
<br />
if ( $vm eq $virtualm_name ) {<br />
<br />
$type = $virtualm->getAttribute("type");<br />
<br />
switch ($type) {<br />
<br />
case "dhcp3" {<br />
# recognized type<br />
}<br />
else {<br />
unshift( @commands, "Your choice $type for $vm is not a recognized type (yet)\n");<br />
}<br />
}<br />
<br />
my $serverTagList = $virtualm->getElementsByTagName("server");<br />
my $numservers = $serverTagList->getLength;<br />
my $relayTagList = $virtualm->getElementsByTagName("relay");<br />
my $numrelays = $relayTagList->getLength;<br />
my $clientTagList = $virtualm->getElementsByTagName("client");<br />
my $numclients = $clientTagList->getLength;<br />
<br />
switch ($seq){<br />
<br />
case ["start","dhcp-start"]{ <br />
# Start server, relay and clients in the virtual machine, if any<br />
unshift( @commands, "" );<br />
if ( $numservers == 1 ) {<br />
push( @commands, "/etc/init.d/dhcp3-server start" );<br />
}<br />
if ( $numrelays == 1 ) {<br />
push( @commands, "/etc/init.d/dhcp3-relay start" );<br />
}<br />
if (!($numclients == 0)) {<br />
unshift(@commands, "" );<br />
my $client = $clientTagList->item(0);<br />
my $ifTagList = $client->getElementsByTagName("if");<br />
my $numif = $ifTagList->getLength;<br />
for (my $ni=0; $ni<$numif ; $ni++) {<br />
my $ifTag = $ifTagList->item($ni);<br />
my $ifData = $ifTag->getFirstChild->getData;<br />
if (!($ifData == 0)) {<br />
push(@commands,"dhclient eth"."$ifData");<br />
}<br />
}<br />
}<br />
<br />
}<br />
case ["restart","dhcp-restart"]{<br />
# Restart server, relay and clients in the virtual machine, if any <br />
unshift( @commands, "" );<br />
if ( $numservers == 1 ) {<br />
push( @commands, "/etc/init.d/dhcp3-server restart" );<br />
}<br />
if ( $numrelays == 1 ) {<br />
push( @commands, "/etc/init.d/dhcp3-relay restart" );<br />
}<br />
if (!($numclients == 0)) {<br />
unshift(@commands, "" );<br />
my $client = $clientTagList->item(0);<br />
my $ifTagList = $client->getElementsByTagName("if");<br />
my $numif = $ifTagList->getLength;<br />
for (my $ni=0; $ni<$numif ; $ni++) {<br />
my $ifTag = $ifTagList->item($ni);<br />
my $ifData = $ifTag->getFirstChild->getData;<br />
if (!($ifData == 0)) {<br />
push(@commands,"dhclient -r");<br />
push(@commands,"killall dhclient");<br />
push(@commands,"dhclient eth"."$ifData");<br />
}<br />
}<br />
}<br />
<br />
}<br />
case ["stop","dhcp-stop"]{ <br />
# Stop server and relay in the virtual machine, if any<br />
unshift( @commands, "" );<br />
if ( $numservers == 1 ) {<br />
push( @commands, "/etc/init.d/dhcp3-server stop" );<br />
}<br />
if ( $numrelays == 1 ) {<br />
push( @commands, "/etc/init.d/dhcp3-relay stop" );<br />
}<br />
if (!($numclients == 0)) {<br />
unshift(@commands, "" );<br />
my $client = $clientTagList->item(0);<br />
my $ifTagList = $client->getElementsByTagName("if");<br />
my $numif = $ifTagList->getLength;<br />
for (my $ni=0; $ni<$numif ; $ni++) {<br />
my $ifTag = $ifTagList->item($ni);<br />
my $ifData = $ifTag->getFirstChild->getData;<br />
if (!($ifData == 0)) {<br />
push(@commands,"dhclient -r");<br />
push(@commands,"killall dhclient");<br />
}<br />
}<br />
}<br />
<br />
}<br />
case ("dhcp-server-start"){<br />
# Start the server in the virtual machine. Return error if there isn't any. <br />
if ( $numservers == 0 ) {<br />
unshift( @commands, "$vm is not configured as a dhcp server. Choose the appropriate virtual machine with flag -M name" );<br />
}<br />
else {<br />
unshift( @commands, "" );<br />
push( @commands, "/etc/init.d/dhcp3-server start" );<br />
}<br />
}<br />
case ("dhcp-relay-start"){<br />
# Start the relay in the virtual machine. Return error if there isn't any.<br />
if ( $numrelays == 0 ) {<br />
unshift( @commands, "$vm is not configured as a dhcp relay. Choose the appropriate virtual machine with flag -M name" );<br />
}<br />
else {<br />
unshift( @commands, "" );<br />
push( @commands, "/etc/init.d/dhcp3-relay start" );<br />
} <br />
}<br />
case ("dhcp-client-start"){<br />
# Start the clients in the virtual machine. Return error if there aren't any.<br />
if ( $numclients == 0 ) {<br />
unshift( @commands, "$vm is not configured as a dhcp client. Choose the appropriate virtual machine with flag -M name" );<br />
}<br />
else {<br />
unshift(@commands, "" );<br />
my $client = $clientTagList->item(0);<br />
my $ifTagList = $client->getElementsByTagName("if");<br />
my $numif = $ifTagList->getLength;<br />
for (my $ni=0; $ni<$numif ; $ni++) {<br />
my $ifTag = $ifTagList->item($ni);<br />
my $ifData = $ifTag->getFirstChild->getData;<br />
if (!($ifData == 0)) {<br />
push(@commands,"dhclient eth"."$ifData");<br />
}<br />
}<br />
<br />
}<br />
}<br />
case ("dhcp-server-restart"){<br />
# Restart the server in the virtual machine. Return error if there isn't any. <br />
if ( $numservers == 0 ) {<br />
unshift( @commands, "$vm is not configured as a dhcp server. Choose the appropriate virtual machine with flag -M name" );<br />
}<br />
else {<br />
unshift( @commands, "" );<br />
push( @commands, "/etc/init.d/dhcp3-server restart" );<br />
}<br />
}<br />
case ("dhcp-relay-restart"){<br />
# Restart the relay in the virtual machine. Return error if there isn't any.<br />
if ( $numrelays == 0 ) {<br />
unshift( @commands, "$vm is not configured as a dhcp relay. Choose the appropriate virtual machine with flag -M name" );<br />
}<br />
else {<br />
unshift( @commands, "" );<br />
push( @commands, "/etc/init.d/dhcp3-relay restart" );<br />
} <br />
}<br />
<br />
case ("dhcp-client-restart"){<br />
# Start the clients in the virtual machine. Return error if there aren't any.<br />
if ( $numclients == 0 ) {<br />
unshift( @commands, "$vm is not configured as a dhcp client. Choose the appropriate virtual machine with flag -M name" );<br />
}<br />
else {<br />
unshift(@commands, "" );<br />
my $client = $clientTagList->item(0);<br />
my $ifTagList = $client->getElementsByTagName("if");<br />
my $numif = $ifTagList->getLength;<br />
for (my $ni=0; $ni<$numif ; $ni++) {<br />
my $ifTag = $ifTagList->item($ni);<br />
my $ifData = $ifTag->getFirstChild->getData;<br />
if (!($ifData == 0)) {<br />
push(@commands,"dhclient -r");<br />
push(@commands,"killall dhclient");<br />
push(@commands,"dhclient eth"."$ifData");<br />
}<br />
}<br />
<br />
}<br />
}<br />
<br />
case ("dhcp-server-stop"){<br />
# Stop the server in the virtual machine. Return error if there isn't any. <br />
if ( $numservers == 0 ) {<br />
unshift( @commands, "$vm is not configured as a dhcp server. Choose the appropriate virtual machine with flag -M name" );<br />
}<br />
else {<br />
unshift( @commands, "" );<br />
push( @commands, "/etc/init.d/dhcp3-server stop" );<br />
}<br />
<br />
}<br />
case ("dhcp-relay-stop"){<br />
# Stop the relay in the virtual machine. Return error if there isn't any. <br />
if ( $numrelays == 0 ) {<br />
unshift( @commands, "$vm is not configured as a dhcp relay. Choose the appropriate virtual machine with flag -M name" );<br />
}<br />
else {<br />
unshift( @commands, "" );<br />
push( @commands, "/etc/init.d/dhcp3-relay stop" );<br />
}<br />
<br />
}<br />
<br />
case ("dhcp-client-stop"){<br />
# Start the clients in the virtual machine. Return error if there aren't any.<br />
if ( $numclients == 0 ) {<br />
unshift( @commands, "$vm is not configured as a dhcp client. Choose the appropriate virtual machine with flag -M name" );<br />
}<br />
else {<br />
unshift(@commands, "" );<br />
my $client = $clientTagList->item(0);<br />
my $ifTagList = $client->getElementsByTagName("if");<br />
my $numif = $ifTagList->getLength;<br />
for (my $ni=0; $ni<$numif ; $ni++) {<br />
my $ifTag = $ifTagList->item($ni);<br />
my $ifData = $ifTag->getFirstChild->getData;<br />
if (!($ifData == 0)) {<br />
push(@commands,"dhclient -r");<br />
push(@commands,"killall dhclient");<br />
}<br />
}<br />
<br />
}<br />
}<br />
<br />
case ("dhcp-server-force-reload"){<br />
# Force reload of the server in the virtual machine. Return error if there isn't any. <br />
if ( $numservers == 0 ) {<br />
unshift( @commands, "$vm is not configured as a dhcp server. Choose the appropriate virtual machine with flag -M name" );<br />
}<br />
else {<br />
unshift( @commands, "" );<br />
push( @commands, "/etc/init.d/dhcp3-server force-reload" );<br />
}<br />
<br />
}<br />
case ("dhcp-relay-force-reload"){<br />
# Force reload of the relay in the virtual machine. Return error if there isn't any. <br />
if ( $numservers == 0 ) {<br />
unshift( @commands, "$vm is not configured as a dhcp relay. Choose the appropriate virtual machine with flag -M name" );<br />
}<br />
else {<br />
unshift( @commands, "" );<br />
push( @commands, "/etc/init.d/dhcp3-relay force-reload" );<br />
}<br />
<br />
}else{<br />
unshift( @commands, "\nYour choice \"$seq\" is not a recognized command (yet).\nAvailable commands: start, stop, restart, dhcp-start, dhcp-stop, dhcp-restart, dhcp-server-start, dhcp-server-stop, dhcp-server-restart, dhcp-server-force-reload, dhcp-relay-start, dhcp-relay-stop, dhcp-relay-restart, dhcp-relay-force-reload, dhcp-client-start.\n" );<br />
}<br />
}<br />
return @commands;<br />
}<br />
}<br />
}<br />
<br />
<br />
<br />
<br />
<br />
###########################################################<br />
# shutdownCommands<br />
#<br />
# To be called during "d" mode, for each vm in the scenario<br />
#<br />
# Arguments:<br />
# - vm name<br />
#<br />
# Returns:<br />
# - list of commands to execute in the virtual machine at shutdown time<br />
#<br />
###########################################################<br />
<br />
sub shutdownCommands {<br />
<br />
my $self = shift;<br />
my $vm = shift;<br />
<br />
my @commands;<br />
<br />
my $type;<br />
<br />
my $virtualmList = $globalNode->getElementsByTagName("vm");<br />
my $longitud = $virtualmList->getLength;<br />
<br />
for ( my $m = 0 ; $m < $longitud ; $m++ ) {<br />
<br />
my $virtualm = $virtualmList->item($m);<br />
my $virtualm_name = $virtualm->getAttribute("name");<br />
<br />
if ( $vm eq $virtualm_name ) {<br />
$type = $virtualm->getAttribute("type");<br />
<br />
switch ($type) {<br />
<br />
case "dhcp3" {<br />
<br />
unshift( @commands, "" );<br />
my $serverTagList = $virtualm->getElementsByTagName("server");<br />
my $numservers = $serverTagList->getLength;<br />
<br />
if ( $numservers == 1 ) {<br />
push( @commands, "/etc/init.d/dhcp3-server stop" );<br />
}<br />
<br />
my $relayTagList = $virtualm->getElementsByTagName("relay");<br />
my $numrelays = $relayTagList->getLength;<br />
<br />
if ( $numrelays == 1 ) {<br />
push( @commands, "/etc/init.d/dhcp3-relay stop" );<br />
}<br />
}<br />
else {<br />
unshift( @commands,"Your choice $type for $vm is not a recognized type (yet)\n");<br />
}<br />
<br />
}<br />
}<br />
<br />
return @commands;<br />
<br />
}<br />
}<br />
<br />
#############################################################<br />
# finalizePlugin<br />
#<br />
# To be called always, just before ending the procesing the scenario specification<br />
#<br />
# Arguments:<br />
# - none<br />
#<br />
# Returns:<br />
# - none<br />
#<br />
#############################################################<br />
<br />
sub finalizePlugin {<br />
<br />
}<br />
<br />
#############################################################<br />
#<br />
# Checks existence and semantics in ospf conf file.<br />
# Currently this check consist in:<br />
#<br />
# 1. Configuration file exists.<br />
# 2. Check DTD.<br />
# 3. IP tag contains mask attribute and data.<br />
# 4. Area tag is unique and contains data.<br />
#<br />
#############################################################<br />
<br />
sub checkConfigFile {<br />
<br />
# 1. Configuration file exists.<br />
my $config_file = shift;<br />
open( FILEHANDLE, $config_file )<br />
or { return "cannot open config file $config_file\n", };<br />
close(FILEHANDLE);<br />
<br />
# 2. Check DTD<br />
my $parser = new XML::DOM::ValParser;<br />
my $dom_tree;<br />
$valid_fail = 0;<br />
#eval {<br />
local $XML::Checker::FAIL = \&validation_fail;<br />
$dom_tree = $parser->parsefile($config_file);<br />
#};<br />
<br />
if ($valid_fail) {<br />
return ("$config_file is not a well-formed DHCP plugin file\n");<br />
}<br />
<br />
$globalNode = $dom_tree->getElementsByTagName("dhcp_conf")->item(0);<br />
<br />
return 0;<br />
}<br />
<br />
sub validation_fail {<br />
my $code = shift;<br />
<br />
# To set flag<br />
$valid_fail = 1;<br />
<br />
# To print error message<br />
XML::Checker::print_error( $code, @_ );<br />
}<br />
<br />
1<br />
</pre></div>Davidhttps://web.dit.upm.es/vnumlwiki/index.php?title=Plugins&diff=4142Plugins2011-07-21T08:49:48Z<p>David: </p>
<hr />
<div>{{Title|VNUML Extension Plugins}}<br />
<br />
<span style="color:red"><strong>Under construction!</strong></span><br />
<br />
Since VNUML 1.9 an extension plugins mechanism has been developed, so new functionality can be added to create files and execute commands in the virtual machines. You can use the plugins included in the VNUML or develop your owns, using the VNUML plugins API.<br />
<br />
* [[PluginsAPI|Plugin API specification]]<br />
* [[PluginsHowto|Plugin development howto]]<br />
<br />
Plugins included in the VNUML package:<br />
<br />
* [[PluginOspfd|Ospfd]], to configure OSPF daemons in the virtual machines<br />
* [[PluginDhcp|Dhcp]], to provide DHCP capabilities in the virtual machines<br />
<br />
Plugins code:<br />
* [[PluginsDummyCode|Dummy]]<br />
* [[PluginsDhcpCode|DHCP]]</div>Davidhttps://web.dit.upm.es/vnumlwiki/index.php?title=PluginsDummyCode&diff=4141PluginsDummyCode2011-07-21T08:49:17Z<p>David: Blanked the page</p>
<hr />
<div></div>Davidhttps://web.dit.upm.es/vnumlwiki/index.php?title=PluginsDummyCode&diff=4140PluginsDummyCode2011-07-21T08:48:35Z<p>David: </p>
<hr />
<div><pre><br />
# dhcp.pm<br />
#<br />
# The dhcp plugin<br />
<br />
package dhcp;<br />
<br />
@ISA = qw(Exporter);<br />
@EXPORT = qw(createPlugin<br />
bootingCreateFiles<br />
bootingCommands<br />
execCreateFiles<br />
execCommands<br />
shutdownCommand<br />
finalizePlugin);<br />
<br />
###########################################################<br />
# Modules no import<br />
###########################################################<br />
use strict;<br />
use Net::Netmask;<br />
use XML::DOM; # XML management library<br />
use File::Basename; # File management library<br />
use Switch;<br />
use Socket; # To resolve hostnames to IPs<br />
use XML::DOM::ValParser; # To check DTD<br />
<br />
<br />
###########################################################<br />
# Global variables <br />
###########################################################<br />
<br />
my $globalNode;<br />
my $valid_fail;<br />
<br />
<br />
###########################################################<br />
# Subroutines<br />
###########################################################<br />
<br />
###########################################################<br />
# createPlugin<br />
#<br />
# To be called always, just before starting procesing the scenario specification<br />
#<br />
# Arguments:<br />
# - the operation mode ("t","x","d" or "P")<br />
# - the plugin configuration file<br />
#<br />
# Returns:<br />
# - an error message or 0 if all is ok<br />
#<br />
###########################################################<br />
<br />
sub createPlugin {<br />
<br />
my $self = shift;<br />
my $mode = shift;<br />
my $conf = shift;<br />
<br />
my $error;<br />
<br />
print "dhcp: $conf\n";<br />
eval {<br />
$error = &checkConfigFile($conf);<br />
};<br />
<br />
if ($@) {<br />
$error = $@;<br />
}<br />
return $error;<br />
}<br />
<br />
###########################################################<br />
# bootingCreateFiles<br />
#<br />
# To be called during "t" mode, for each vm in the scenario<br />
#<br />
# Arguments:<br />
# - vm name<br />
#<br />
# Returns:<br />
# - a hashname which keys are absolute pathnames of files in vm filesystem and<br />
# values the the pathname of the file in the host filesystem. The file in the<br />
# host filesytesm is removed after VNUML processed it, so temporal files in<br />
# /tmp are preferable)<br />
#<br />
###########################################################<br />
<br />
sub bootingCreateFiles {<br />
<br />
my $self = shift;<br />
my $vm = shift;<br />
<br />
my %files;<br />
my $type;<br />
<br />
my $virtualmList = $globalNode->getElementsByTagName("vm");<br />
my $longitud = $virtualmList->getLength;<br />
<br />
for ( my $m = 0 ; $m < $longitud ; $m++ ){<br />
<br />
my $virtualm = $virtualmList->item($m);<br />
my $virtualm_name = $virtualm->getAttribute("name");<br />
<br />
if ( $virtualm_name eq $vm ){<br />
<br />
$type = $virtualm->getAttribute("type");<br />
<br />
switch ($type) {<br />
<br />
case "dhcp3" {<br />
<br />
my $serverTagList = $virtualm->getElementsByTagName("server");<br />
my $numservers = $serverTagList->getLength;<br />
if ( $numservers == 1 ) {<br />
<br />
# open filehandle to create /etc/dhcp3/dhcpd.conf file<br />
my $server_file = "/tmp/$vm" . "_server.conf";<br />
chomp( my $date = `date` );<br />
open( SERVER, ">$server_file" ) or $files{"ERROR"} = "Cannot open $server_file file";<br />
<br />
# server.conf file defaults<br />
print SERVER "# server.conf file generated by dhcp.pm VNUML plugin at $date\n\n";<br />
print SERVER "ddns-update-style none;\n";<br />
print SERVER "default-lease-time 120;\n";<br />
print SERVER "max-lease-time 120;\n";<br />
#print SERVER "log-facility local7;\n\n";<br />
<br />
# extract configuration from subnet blocks in dhcp_conf.xml<br />
my $server = $serverTagList->item(0);<br />
my $subnetTagList = $server->getElementsByTagName("subnet");<br />
my $numsubnets = $subnetTagList->getLength;<br />
<br />
for ( my $ns=0; $ns < $numsubnets ; $ns++ ) {<br />
my $subnet = $subnetTagList->item($ns);<br />
my $ipTagList = $subnet->getElementsByTagName("ip");<br />
my $numip = $ipTagList->getLength;<br />
<br />
# subnet declaration<br />
my $ipTag = $ipTagList->item($0);<br />
my $subnetmask = $ipTag->getAttribute("mask");<br />
my $subnetbaseip = $ipTag->getFirstChild->getData;<br />
my $block = new Net::Netmask("$subnetbaseip"."/"."$subnetmask");<br />
<br />
my $baseip = $block->base();<br />
my $mask = $block->mask();<br />
print SERVER "subnet $baseip netmask $mask {\n";<br />
<br />
# extract ip ranges in subnet<br />
my $rangeTagList = $subnet->getElementsByTagName("range");<br />
my $numranges = $rangeTagList->getLength;<br />
<br />
for ( my $nr = 0; $nr < $numranges ; $nr++ ) {<br />
my $rangeTag = $rangeTagList->item($nr);<br />
my $firstTagList = $rangeTag->getElementsByTagName("first");<br />
my $firstTag = $firstTagList->item(0);<br />
my $firstip = $firstTag->getFirstChild->getData;<br />
my $lastTagList = $rangeTag->getElementsByTagName("last");<br />
my $lastTag = $lastTagList->item(0);<br />
my $lastip = $lastTag->getFirstChild->getData;<br />
print SERVER " range $firstip $lastip;\n";<br />
}<br />
<br />
# extract routers in subnet (if any)<br />
my $routerTagList = $subnet->getElementsByTagName("router");<br />
my $numrouters = $routerTagList->getLength;<br />
<br />
if ( $numrouters > 0 ) {<br />
print SERVER " option routers";<br />
for ( my $nr = 0; $nr < $numrouters ; $nr++ ) {<br />
if ( $nr > 0 ) {<br />
print SERVER ",";<br />
}<br />
my $routerTag = $routerTagList->item($nr);<br />
my $router = $routerTag->getFirstChild->getData;<br />
print SERVER " $router";<br />
}<br />
print SERVER ";\n";<br />
}<br />
<br />
# extract dns in subnet (if any)<br />
my $dnsTagList = $subnet->getElementsByTagName("dns");<br />
my $numdns = $dnsTagList->getLength;<br />
if ( $numdns > 0 ) {<br />
print SERVER " option domain-name-servers";<br />
for ( my $nd = 0; $nd < $numdns ; $nd++ ) {<br />
if ( $nd > 0 ) {<br />
print SERVER ",";<br />
}<br />
my $dnsTag = $dnsTagList->item($nd);<br />
my $dns = $dnsTag->getFirstChild->getData;<br />
print SERVER " $dns";<br />
}<br />
print SERVER ";\n";<br />
}<br />
<br />
# extract domain in subnet (if specified)<br />
my $domainTagList = $subnet->getElementsByTagName("domain");<br />
my $numdomains = $domainTagList->getLength;<br />
if ( $numdomains == 1 ) {<br />
my $domainTag = $domainTagList->item(0);<br />
my $domain = $domainTag->getFirstChild->getData;<br />
print SERVER " option domain-name \"$domain\";\n";<br />
}<br />
<br />
# end subnet declaration in configuration file<br />
print SERVER "}\n\n";<br />
<br />
# extract hosts in subnet (if any)<br />
my $hostTagList = $subnet->getElementsByTagName("host");<br />
my $numhosts = $hostTagList->getLength;<br />
for ( my $nh = 0; $nh < $numhosts ; $nh++ ) {<br />
my $hostTag = $hostTagList->item($nh);<br />
my $hostname = $hostTag->getAttribute("name");<br />
my $hostmac = $hostTag->getAttribute("mac");<br />
my $hostip = $hostTag->getAttribute("ip");<br />
<br />
# ignore unmatching host declarations<br />
if ( $block->match($hostip) ) {<br />
print SERVER "host $hostname {\n hardware ethernet $hostmac;\n fixed-address $hostip;\n}\n\n";<br />
}<br />
}<br />
<br />
}<br />
close(SERVER);<br />
$files{"/etc/dhcp3/dhcpd.conf"} = $server_file;<br />
}<br />
<br />
my $relayTagList = $virtualm->getElementsByTagName("relay");<br />
my $numrelays = $relayTagList->getLength;<br />
if ( $numrelays == 1 ) {<br />
<br />
# Build file /etc/default/dhcp3-relay.conf<br />
my $relay_file = "/tmp/$vm" . "_relay.conf";<br />
chomp( my $date = `date` );<br />
open( RELAY, ">$relay_file" ) or $files{"ERROR"} = "Cannot open $relay_file file";<br />
print RELAY "# relay.conf file generated by dhcp.pm VNUML plugin at $date\n";<br />
print RELAY "SERVERS=\"";<br />
my $relay = $relayTagList->item(0);<br />
my $toserverTagList = $relay->getElementsByTagName("toserver");<br />
my $numtoservers = $toserverTagList->getLength;<br />
<br />
for ( my $nt = 0; $nt < $numtoservers ; $nt++ ) {<br />
my $toserverTag = $toserverTagList->item($nt);<br />
my $toserverData = $toserverTag->getFirstChild->getData;<br />
print RELAY "$toserverData ";<br />
}<br />
<br />
print RELAY "\"\n";<br />
close(RELAY);<br />
$files{"/etc/default/dhcp3-relay"} = $relay_file;<br />
}<br />
<br />
my $clientTagList = $virtualm->getElementsByTagName("client");<br />
my $numclients = $clientTagList->getLength;<br />
if ( $numclients == 1 ) {<br />
# Build file /etc/dhcp3/dhclient.conf<br />
my $client_file = "/tmp/$vm" . "_client.conf";<br />
chomp( my $date = `date` );<br />
open( CLIENT, ">$client_file" ) or $files{"ERROR"} = "Cannot open $client_file file";<br />
print CLIENT "# Configuration file for /sbin/dhclient, which is included in Debian's dhcp3-client package.\n";<br />
print CLIENT "# client.conf file generated by dhcp.pm VNUML plugin at $date\n\n";<br />
print CLIENT "send host-name \"<hostname>\";\n";<br />
print CLIENT "request subnet-mask, broadcast-address, time-offset, routers, domain-name, domain-name-servers, domain-search, host-name, netbios-name-servers, netbios-scope, interface-mtu;\n";<br />
print CLIENT "retry 10;\n";<br />
close(CLIENT);<br />
$files{"/etc/dhcp3/dhclient.conf"} = $client_file;<br />
<br />
}<br />
}else{<br />
$files{"ERROR"} = "Your choice $type for $vm is not a recognized type (yet)\n";<br />
}<br />
}<br />
}<br />
}<br />
return %files;<br />
}<br />
<br />
###########################################################<br />
# bootingCommands<br />
#<br />
# To be called during "t" mode, for each vm in the scenario<br />
#<br />
# Arguments:<br />
# - vm name<br />
#<br />
# Returns:<br />
# - list of commands to execute in the virtual machine at booting time<br />
#<br />
###########################################################<br />
<br />
sub bootingCommands {<br />
<br />
}<br />
<br />
<br />
###########################################################<br />
# execVmsToUse<br />
#<br />
# To be called once during "x" mode<br />
#<br />
# Arguments:<br />
# - seq command sequence<br />
#<br />
# Returns:<br />
# - list of virtual machines where the command has effect<br />
#<br />
###########################################################<br />
<br />
sub execVmsToUse {<br />
<br />
my $self = shift;<br />
my $seq = shift;<br />
<br />
# Four lists are built, one is returned depending on the executed command<br />
my @vm_list = ();<br />
my @server_vm_list = ();<br />
my @relay_vm_list = ();<br />
my @client_vm_list = ();<br />
<br />
my $virtualmList=$globalNode->getElementsByTagName("vm");<br />
my $longitud = $virtualmList->getLength;<br />
<br />
<br />
for (my $m=0; $m<$longitud; $m++){<br />
<br />
my $virtualm = $virtualmList->item($m);<br />
my $virtualm_name = $virtualm->getAttribute("name");<br />
push (@vm_list,$virtualm_name);<br />
<br />
my $serverTagList = $virtualm->getElementsByTagName("server");<br />
my $numservers = $serverTagList->getLength;<br />
my $relayTagList = $virtualm->getElementsByTagName("relay");<br />
my $numrelays = $relayTagList->getLength;<br />
my $clientTagList = $virtualm->getElementsByTagName("client");<br />
my $numclients = $clientTagList->getLength;<br />
<br />
if ( $numservers == 1 ) {<br />
push (@server_vm_list,$virtualm_name);<br />
}<br />
if ( $numrelays == 1 ) {<br />
push (@relay_vm_list,$virtualm_name);<br />
}<br />
if (!($numclients == 0)) {<br />
push (@client_vm_list,$virtualm_name);<br />
}<br />
}<br />
<br />
if ($seq eq "start" || $seq eq "restart" || $seq eq "stop" || $seq eq "dhcp-start" || $seq eq "dhcp-restart" || $seq eq "dhcp-stop") {<br />
return @vm_list;<br />
}elsif ($seq eq "dhcp-server-start"|| $seq eq "dhcp-server-stop" || $seq eq "dhcp-server-restart" || $seq eq "dhcp-server-force-reload"){<br />
return @server_vm_list;<br />
}elsif ( $seq eq "dhcp-relay-start"|| $seq eq "dhcp-relay-restart"|| $seq eq "dhcp-relay-stop"|| $seq eq "dhcp-relay-force-reload"){<br />
return @relay_vm_list;<br />
}elsif ($seq eq "dhcp-client-start"||$seq eq "dhcp-client-restart"||$seq eq "dhcp-client-stop"){<br />
return @client_vm_list;<br />
}else{<br />
return ();<br />
}<br />
}<br />
<br />
<br />
<br />
<br />
###########################################################<br />
# execCreateFiles<br />
#<br />
# To be called during "x" mode, for each vm in the scenario<br />
#<br />
# Arguments:<br />
# - vm name<br />
# - seq command sequence<br />
#<br />
# Returns:<br />
# - a hashname which kyes are absolute pathnames of files in vm filesystem and<br />
# values the the pathname of the file in the host filesystem. The file in the<br />
# host filesytesm is removed after VNUML processed it, so temporal files in<br />
# /tmp are preferable)<br />
#<br />
###########################################################<br />
<br />
sub execCreateFiles {<br />
}<br />
<br />
<br />
###########################################################<br />
# execCommands<br />
#<br />
# To be called during "x" mode, for each vm in the scenario<br />
#<br />
# Arguments:<br />
# - vm name<br />
# - seq command sequence<br />
#<br />
# Returns:<br />
# - list of commands to execute in the virtual machine after <exec> processing<br />
###########################################################<br />
<br />
sub execCommands {<br />
<br />
my $self = shift;<br />
my $vm = shift;<br />
my $seq = shift;<br />
<br />
my @commands;<br />
<br />
my $type;<br />
<br />
my $virtualmList = $globalNode->getElementsByTagName("vm");<br />
my $longitud = $virtualmList->getLength;<br />
<br />
for (my $m=0 ; $m<$longitud ; $m++) {<br />
<br />
my $virtualm = $virtualmList->item($m);<br />
my $virtualm_name = $virtualm->getAttribute("name");<br />
<br />
if ( $vm eq $virtualm_name ) {<br />
<br />
$type = $virtualm->getAttribute("type");<br />
<br />
switch ($type) {<br />
<br />
case "dhcp3" {<br />
# recognized type<br />
}<br />
else {<br />
unshift( @commands, "Your choice $type for $vm is not a recognized type (yet)\n");<br />
}<br />
}<br />
<br />
my $serverTagList = $virtualm->getElementsByTagName("server");<br />
my $numservers = $serverTagList->getLength;<br />
my $relayTagList = $virtualm->getElementsByTagName("relay");<br />
my $numrelays = $relayTagList->getLength;<br />
my $clientTagList = $virtualm->getElementsByTagName("client");<br />
my $numclients = $clientTagList->getLength;<br />
<br />
switch ($seq){<br />
<br />
case ["start","dhcp-start"]{ <br />
# Start server, relay and clients in the virtual machine, if any<br />
unshift( @commands, "" );<br />
if ( $numservers == 1 ) {<br />
push( @commands, "/etc/init.d/dhcp3-server start" );<br />
}<br />
if ( $numrelays == 1 ) {<br />
push( @commands, "/etc/init.d/dhcp3-relay start" );<br />
}<br />
if (!($numclients == 0)) {<br />
unshift(@commands, "" );<br />
my $client = $clientTagList->item(0);<br />
my $ifTagList = $client->getElementsByTagName("if");<br />
my $numif = $ifTagList->getLength;<br />
for (my $ni=0; $ni<$numif ; $ni++) {<br />
my $ifTag = $ifTagList->item($ni);<br />
my $ifData = $ifTag->getFirstChild->getData;<br />
if (!($ifData == 0)) {<br />
push(@commands,"dhclient eth"."$ifData");<br />
}<br />
}<br />
}<br />
<br />
}<br />
case ["restart","dhcp-restart"]{<br />
# Restart server, relay and clients in the virtual machine, if any <br />
unshift( @commands, "" );<br />
if ( $numservers == 1 ) {<br />
push( @commands, "/etc/init.d/dhcp3-server restart" );<br />
}<br />
if ( $numrelays == 1 ) {<br />
push( @commands, "/etc/init.d/dhcp3-relay restart" );<br />
}<br />
if (!($numclients == 0)) {<br />
unshift(@commands, "" );<br />
my $client = $clientTagList->item(0);<br />
my $ifTagList = $client->getElementsByTagName("if");<br />
my $numif = $ifTagList->getLength;<br />
for (my $ni=0; $ni<$numif ; $ni++) {<br />
my $ifTag = $ifTagList->item($ni);<br />
my $ifData = $ifTag->getFirstChild->getData;<br />
if (!($ifData == 0)) {<br />
push(@commands,"dhclient -r");<br />
push(@commands,"killall dhclient");<br />
push(@commands,"dhclient eth"."$ifData");<br />
}<br />
}<br />
}<br />
<br />
}<br />
case ["stop","dhcp-stop"]{ <br />
# Stop server and relay in the virtual machine, if any<br />
unshift( @commands, "" );<br />
if ( $numservers == 1 ) {<br />
push( @commands, "/etc/init.d/dhcp3-server stop" );<br />
}<br />
if ( $numrelays == 1 ) {<br />
push( @commands, "/etc/init.d/dhcp3-relay stop" );<br />
}<br />
if (!($numclients == 0)) {<br />
unshift(@commands, "" );<br />
my $client = $clientTagList->item(0);<br />
my $ifTagList = $client->getElementsByTagName("if");<br />
my $numif = $ifTagList->getLength;<br />
for (my $ni=0; $ni<$numif ; $ni++) {<br />
my $ifTag = $ifTagList->item($ni);<br />
my $ifData = $ifTag->getFirstChild->getData;<br />
if (!($ifData == 0)) {<br />
push(@commands,"dhclient -r");<br />
push(@commands,"killall dhclient");<br />
}<br />
}<br />
}<br />
<br />
}<br />
case ("dhcp-server-start"){<br />
# Start the server in the virtual machine. Return error if there isn't any. <br />
if ( $numservers == 0 ) {<br />
unshift( @commands, "$vm is not configured as a dhcp server. Choose the appropriate virtual machine with flag -M name" );<br />
}<br />
else {<br />
unshift( @commands, "" );<br />
push( @commands, "/etc/init.d/dhcp3-server start" );<br />
}<br />
}<br />
case ("dhcp-relay-start"){<br />
# Start the relay in the virtual machine. Return error if there isn't any.<br />
if ( $numrelays == 0 ) {<br />
unshift( @commands, "$vm is not configured as a dhcp relay. Choose the appropriate virtual machine with flag -M name" );<br />
}<br />
else {<br />
unshift( @commands, "" );<br />
push( @commands, "/etc/init.d/dhcp3-relay start" );<br />
} <br />
}<br />
case ("dhcp-client-start"){<br />
# Start the clients in the virtual machine. Return error if there aren't any.<br />
if ( $numclients == 0 ) {<br />
unshift( @commands, "$vm is not configured as a dhcp client. Choose the appropriate virtual machine with flag -M name" );<br />
}<br />
else {<br />
unshift(@commands, "" );<br />
my $client = $clientTagList->item(0);<br />
my $ifTagList = $client->getElementsByTagName("if");<br />
my $numif = $ifTagList->getLength;<br />
for (my $ni=0; $ni<$numif ; $ni++) {<br />
my $ifTag = $ifTagList->item($ni);<br />
my $ifData = $ifTag->getFirstChild->getData;<br />
if (!($ifData == 0)) {<br />
push(@commands,"dhclient eth"."$ifData");<br />
}<br />
}<br />
<br />
}<br />
}<br />
case ("dhcp-server-restart"){<br />
# Restart the server in the virtual machine. Return error if there isn't any. <br />
if ( $numservers == 0 ) {<br />
unshift( @commands, "$vm is not configured as a dhcp server. Choose the appropriate virtual machine with flag -M name" );<br />
}<br />
else {<br />
unshift( @commands, "" );<br />
push( @commands, "/etc/init.d/dhcp3-server restart" );<br />
}<br />
}<br />
case ("dhcp-relay-restart"){<br />
# Restart the relay in the virtual machine. Return error if there isn't any.<br />
if ( $numrelays == 0 ) {<br />
unshift( @commands, "$vm is not configured as a dhcp relay. Choose the appropriate virtual machine with flag -M name" );<br />
}<br />
else {<br />
unshift( @commands, "" );<br />
push( @commands, "/etc/init.d/dhcp3-relay restart" );<br />
} <br />
}<br />
<br />
case ("dhcp-client-restart"){<br />
# Start the clients in the virtual machine. Return error if there aren't any.<br />
if ( $numclients == 0 ) {<br />
unshift( @commands, "$vm is not configured as a dhcp client. Choose the appropriate virtual machine with flag -M name" );<br />
}<br />
else {<br />
unshift(@commands, "" );<br />
my $client = $clientTagList->item(0);<br />
my $ifTagList = $client->getElementsByTagName("if");<br />
my $numif = $ifTagList->getLength;<br />
for (my $ni=0; $ni<$numif ; $ni++) {<br />
my $ifTag = $ifTagList->item($ni);<br />
my $ifData = $ifTag->getFirstChild->getData;<br />
if (!($ifData == 0)) {<br />
push(@commands,"dhclient -r");<br />
push(@commands,"killall dhclient");<br />
push(@commands,"dhclient eth"."$ifData");<br />
}<br />
}<br />
<br />
}<br />
}<br />
<br />
case ("dhcp-server-stop"){<br />
# Stop the server in the virtual machine. Return error if there isn't any. <br />
if ( $numservers == 0 ) {<br />
unshift( @commands, "$vm is not configured as a dhcp server. Choose the appropriate virtual machine with flag -M name" );<br />
}<br />
else {<br />
unshift( @commands, "" );<br />
push( @commands, "/etc/init.d/dhcp3-server stop" );<br />
}<br />
<br />
}<br />
case ("dhcp-relay-stop"){<br />
# Stop the relay in the virtual machine. Return error if there isn't any. <br />
if ( $numrelays == 0 ) {<br />
unshift( @commands, "$vm is not configured as a dhcp relay. Choose the appropriate virtual machine with flag -M name" );<br />
}<br />
else {<br />
unshift( @commands, "" );<br />
push( @commands, "/etc/init.d/dhcp3-relay stop" );<br />
}<br />
<br />
}<br />
<br />
case ("dhcp-client-stop"){<br />
# Start the clients in the virtual machine. Return error if there aren't any.<br />
if ( $numclients == 0 ) {<br />
unshift( @commands, "$vm is not configured as a dhcp client. Choose the appropriate virtual machine with flag -M name" );<br />
}<br />
else {<br />
unshift(@commands, "" );<br />
my $client = $clientTagList->item(0);<br />
my $ifTagList = $client->getElementsByTagName("if");<br />
my $numif = $ifTagList->getLength;<br />
for (my $ni=0; $ni<$numif ; $ni++) {<br />
my $ifTag = $ifTagList->item($ni);<br />
my $ifData = $ifTag->getFirstChild->getData;<br />
if (!($ifData == 0)) {<br />
push(@commands,"dhclient -r");<br />
push(@commands,"killall dhclient");<br />
}<br />
}<br />
<br />
}<br />
}<br />
<br />
case ("dhcp-server-force-reload"){<br />
# Force reload of the server in the virtual machine. Return error if there isn't any. <br />
if ( $numservers == 0 ) {<br />
unshift( @commands, "$vm is not configured as a dhcp server. Choose the appropriate virtual machine with flag -M name" );<br />
}<br />
else {<br />
unshift( @commands, "" );<br />
push( @commands, "/etc/init.d/dhcp3-server force-reload" );<br />
}<br />
<br />
}<br />
case ("dhcp-relay-force-reload"){<br />
# Force reload of the relay in the virtual machine. Return error if there isn't any. <br />
if ( $numservers == 0 ) {<br />
unshift( @commands, "$vm is not configured as a dhcp relay. Choose the appropriate virtual machine with flag -M name" );<br />
}<br />
else {<br />
unshift( @commands, "" );<br />
push( @commands, "/etc/init.d/dhcp3-relay force-reload" );<br />
}<br />
<br />
}else{<br />
unshift( @commands, "\nYour choice \"$seq\" is not a recognized command (yet).\nAvailable commands: start, stop, restart, dhcp-start, dhcp-stop, dhcp-restart, dhcp-server-start, dhcp-server-stop, dhcp-server-restart, dhcp-server-force-reload, dhcp-relay-start, dhcp-relay-stop, dhcp-relay-restart, dhcp-relay-force-reload, dhcp-client-start.\n" );<br />
}<br />
}<br />
return @commands;<br />
}<br />
}<br />
}<br />
<br />
<br />
<br />
<br />
<br />
###########################################################<br />
# shutdownCommands<br />
#<br />
# To be called during "d" mode, for each vm in the scenario<br />
#<br />
# Arguments:<br />
# - vm name<br />
#<br />
# Returns:<br />
# - list of commands to execute in the virtual machine at shutdown time<br />
#<br />
###########################################################<br />
<br />
sub shutdownCommands {<br />
<br />
my $self = shift;<br />
my $vm = shift;<br />
<br />
my @commands;<br />
<br />
my $type;<br />
<br />
my $virtualmList = $globalNode->getElementsByTagName("vm");<br />
my $longitud = $virtualmList->getLength;<br />
<br />
for ( my $m = 0 ; $m < $longitud ; $m++ ) {<br />
<br />
my $virtualm = $virtualmList->item($m);<br />
my $virtualm_name = $virtualm->getAttribute("name");<br />
<br />
if ( $vm eq $virtualm_name ) {<br />
$type = $virtualm->getAttribute("type");<br />
<br />
switch ($type) {<br />
<br />
case "dhcp3" {<br />
<br />
unshift( @commands, "" );<br />
my $serverTagList = $virtualm->getElementsByTagName("server");<br />
my $numservers = $serverTagList->getLength;<br />
<br />
if ( $numservers == 1 ) {<br />
push( @commands, "/etc/init.d/dhcp3-server stop" );<br />
}<br />
<br />
my $relayTagList = $virtualm->getElementsByTagName("relay");<br />
my $numrelays = $relayTagList->getLength;<br />
<br />
if ( $numrelays == 1 ) {<br />
push( @commands, "/etc/init.d/dhcp3-relay stop" );<br />
}<br />
}<br />
else {<br />
unshift( @commands,"Your choice $type for $vm is not a recognized type (yet)\n");<br />
}<br />
<br />
}<br />
}<br />
<br />
return @commands;<br />
<br />
}<br />
}<br />
<br />
#############################################################<br />
# finalizePlugin<br />
#<br />
# To be called always, just before ending the procesing the scenario specification<br />
#<br />
# Arguments:<br />
# - none<br />
#<br />
# Returns:<br />
# - none<br />
#<br />
#############################################################<br />
<br />
sub finalizePlugin {<br />
<br />
}<br />
<br />
#############################################################<br />
#<br />
# Checks existence and semantics in ospf conf file.<br />
# Currently this check consist in:<br />
#<br />
# 1. Configuration file exists.<br />
# 2. Check DTD.<br />
# 3. IP tag contains mask attribute and data.<br />
# 4. Area tag is unique and contains data.<br />
#<br />
#############################################################<br />
<br />
sub checkConfigFile {<br />
<br />
# 1. Configuration file exists.<br />
my $config_file = shift;<br />
open( FILEHANDLE, $config_file )<br />
or { return "cannot open config file $config_file\n", };<br />
close(FILEHANDLE);<br />
<br />
# 2. Check DTD<br />
my $parser = new XML::DOM::ValParser;<br />
my $dom_tree;<br />
$valid_fail = 0;<br />
#eval {<br />
local $XML::Checker::FAIL = \&validation_fail;<br />
$dom_tree = $parser->parsefile($config_file);<br />
#};<br />
<br />
if ($valid_fail) {<br />
return ("$config_file is not a well-formed DHCP plugin file\n");<br />
}<br />
<br />
$globalNode = $dom_tree->getElementsByTagName("dhcp_conf")->item(0);<br />
<br />
return 0;<br />
}<br />
<br />
sub validation_fail {<br />
my $code = shift;<br />
<br />
# To set flag<br />
$valid_fail = 1;<br />
<br />
# To print error message<br />
XML::Checker::print_error( $code, @_ );<br />
}<br />
<br />
1<br />
</pre></div>Davidhttps://web.dit.upm.es/vnumlwiki/index.php?title=PluginsDummyCode&diff=4139PluginsDummyCode2011-07-21T08:48:16Z<p>David: Created page with "# dhcp.pm # # The dhcp plugin package dhcp; @ISA = qw(Exporter); @EXPORT = qw(createPlugin bootingCreateFiles bootingCommands execCreateF..."</p>
<hr />
<div># dhcp.pm<br />
#<br />
# The dhcp plugin<br />
<br />
package dhcp;<br />
<br />
@ISA = qw(Exporter);<br />
@EXPORT = qw(createPlugin<br />
bootingCreateFiles<br />
bootingCommands<br />
execCreateFiles<br />
execCommands<br />
shutdownCommand<br />
finalizePlugin);<br />
<br />
###########################################################<br />
# Modules no import<br />
###########################################################<br />
use strict;<br />
use Net::Netmask;<br />
use XML::DOM; # XML management library<br />
use File::Basename; # File management library<br />
use Switch;<br />
use Socket; # To resolve hostnames to IPs<br />
use XML::DOM::ValParser; # To check DTD<br />
<br />
<br />
###########################################################<br />
# Global variables <br />
###########################################################<br />
<br />
my $globalNode;<br />
my $valid_fail;<br />
<br />
<br />
###########################################################<br />
# Subroutines<br />
###########################################################<br />
<br />
###########################################################<br />
# createPlugin<br />
#<br />
# To be called always, just before starting procesing the scenario specification<br />
#<br />
# Arguments:<br />
# - the operation mode ("t","x","d" or "P")<br />
# - the plugin configuration file<br />
#<br />
# Returns:<br />
# - an error message or 0 if all is ok<br />
#<br />
###########################################################<br />
<br />
sub createPlugin {<br />
<br />
my $self = shift;<br />
my $mode = shift;<br />
my $conf = shift;<br />
<br />
my $error;<br />
<br />
print "dhcp: $conf\n";<br />
eval {<br />
$error = &checkConfigFile($conf);<br />
};<br />
<br />
if ($@) {<br />
$error = $@;<br />
}<br />
return $error;<br />
}<br />
<br />
###########################################################<br />
# bootingCreateFiles<br />
#<br />
# To be called during "t" mode, for each vm in the scenario<br />
#<br />
# Arguments:<br />
# - vm name<br />
#<br />
# Returns:<br />
# - a hashname which keys are absolute pathnames of files in vm filesystem and<br />
# values the the pathname of the file in the host filesystem. The file in the<br />
# host filesytesm is removed after VNUML processed it, so temporal files in<br />
# /tmp are preferable)<br />
#<br />
###########################################################<br />
<br />
sub bootingCreateFiles {<br />
<br />
my $self = shift;<br />
my $vm = shift;<br />
<br />
my %files;<br />
my $type;<br />
<br />
my $virtualmList = $globalNode->getElementsByTagName("vm");<br />
my $longitud = $virtualmList->getLength;<br />
<br />
for ( my $m = 0 ; $m < $longitud ; $m++ ){<br />
<br />
my $virtualm = $virtualmList->item($m);<br />
my $virtualm_name = $virtualm->getAttribute("name");<br />
<br />
if ( $virtualm_name eq $vm ){<br />
<br />
$type = $virtualm->getAttribute("type");<br />
<br />
switch ($type) {<br />
<br />
case "dhcp3" {<br />
<br />
my $serverTagList = $virtualm->getElementsByTagName("server");<br />
my $numservers = $serverTagList->getLength;<br />
if ( $numservers == 1 ) {<br />
<br />
# open filehandle to create /etc/dhcp3/dhcpd.conf file<br />
my $server_file = "/tmp/$vm" . "_server.conf";<br />
chomp( my $date = `date` );<br />
open( SERVER, ">$server_file" ) or $files{"ERROR"} = "Cannot open $server_file file";<br />
<br />
# server.conf file defaults<br />
print SERVER "# server.conf file generated by dhcp.pm VNUML plugin at $date\n\n";<br />
print SERVER "ddns-update-style none;\n";<br />
print SERVER "default-lease-time 120;\n";<br />
print SERVER "max-lease-time 120;\n";<br />
#print SERVER "log-facility local7;\n\n";<br />
<br />
# extract configuration from subnet blocks in dhcp_conf.xml<br />
my $server = $serverTagList->item(0);<br />
my $subnetTagList = $server->getElementsByTagName("subnet");<br />
my $numsubnets = $subnetTagList->getLength;<br />
<br />
for ( my $ns=0; $ns < $numsubnets ; $ns++ ) {<br />
my $subnet = $subnetTagList->item($ns);<br />
my $ipTagList = $subnet->getElementsByTagName("ip");<br />
my $numip = $ipTagList->getLength;<br />
<br />
# subnet declaration<br />
my $ipTag = $ipTagList->item($0);<br />
my $subnetmask = $ipTag->getAttribute("mask");<br />
my $subnetbaseip = $ipTag->getFirstChild->getData;<br />
my $block = new Net::Netmask("$subnetbaseip"."/"."$subnetmask");<br />
<br />
my $baseip = $block->base();<br />
my $mask = $block->mask();<br />
print SERVER "subnet $baseip netmask $mask {\n";<br />
<br />
# extract ip ranges in subnet<br />
my $rangeTagList = $subnet->getElementsByTagName("range");<br />
my $numranges = $rangeTagList->getLength;<br />
<br />
for ( my $nr = 0; $nr < $numranges ; $nr++ ) {<br />
my $rangeTag = $rangeTagList->item($nr);<br />
my $firstTagList = $rangeTag->getElementsByTagName("first");<br />
my $firstTag = $firstTagList->item(0);<br />
my $firstip = $firstTag->getFirstChild->getData;<br />
my $lastTagList = $rangeTag->getElementsByTagName("last");<br />
my $lastTag = $lastTagList->item(0);<br />
my $lastip = $lastTag->getFirstChild->getData;<br />
print SERVER " range $firstip $lastip;\n";<br />
}<br />
<br />
# extract routers in subnet (if any)<br />
my $routerTagList = $subnet->getElementsByTagName("router");<br />
my $numrouters = $routerTagList->getLength;<br />
<br />
if ( $numrouters > 0 ) {<br />
print SERVER " option routers";<br />
for ( my $nr = 0; $nr < $numrouters ; $nr++ ) {<br />
if ( $nr > 0 ) {<br />
print SERVER ",";<br />
}<br />
my $routerTag = $routerTagList->item($nr);<br />
my $router = $routerTag->getFirstChild->getData;<br />
print SERVER " $router";<br />
}<br />
print SERVER ";\n";<br />
}<br />
<br />
# extract dns in subnet (if any)<br />
my $dnsTagList = $subnet->getElementsByTagName("dns");<br />
my $numdns = $dnsTagList->getLength;<br />
if ( $numdns > 0 ) {<br />
print SERVER " option domain-name-servers";<br />
for ( my $nd = 0; $nd < $numdns ; $nd++ ) {<br />
if ( $nd > 0 ) {<br />
print SERVER ",";<br />
}<br />
my $dnsTag = $dnsTagList->item($nd);<br />
my $dns = $dnsTag->getFirstChild->getData;<br />
print SERVER " $dns";<br />
}<br />
print SERVER ";\n";<br />
}<br />
<br />
# extract domain in subnet (if specified)<br />
my $domainTagList = $subnet->getElementsByTagName("domain");<br />
my $numdomains = $domainTagList->getLength;<br />
if ( $numdomains == 1 ) {<br />
my $domainTag = $domainTagList->item(0);<br />
my $domain = $domainTag->getFirstChild->getData;<br />
print SERVER " option domain-name \"$domain\";\n";<br />
}<br />
<br />
# end subnet declaration in configuration file<br />
print SERVER "}\n\n";<br />
<br />
# extract hosts in subnet (if any)<br />
my $hostTagList = $subnet->getElementsByTagName("host");<br />
my $numhosts = $hostTagList->getLength;<br />
for ( my $nh = 0; $nh < $numhosts ; $nh++ ) {<br />
my $hostTag = $hostTagList->item($nh);<br />
my $hostname = $hostTag->getAttribute("name");<br />
my $hostmac = $hostTag->getAttribute("mac");<br />
my $hostip = $hostTag->getAttribute("ip");<br />
<br />
# ignore unmatching host declarations<br />
if ( $block->match($hostip) ) {<br />
print SERVER "host $hostname {\n hardware ethernet $hostmac;\n fixed-address $hostip;\n}\n\n";<br />
}<br />
}<br />
<br />
}<br />
close(SERVER);<br />
$files{"/etc/dhcp3/dhcpd.conf"} = $server_file;<br />
}<br />
<br />
my $relayTagList = $virtualm->getElementsByTagName("relay");<br />
my $numrelays = $relayTagList->getLength;<br />
if ( $numrelays == 1 ) {<br />
<br />
# Build file /etc/default/dhcp3-relay.conf<br />
my $relay_file = "/tmp/$vm" . "_relay.conf";<br />
chomp( my $date = `date` );<br />
open( RELAY, ">$relay_file" ) or $files{"ERROR"} = "Cannot open $relay_file file";<br />
print RELAY "# relay.conf file generated by dhcp.pm VNUML plugin at $date\n";<br />
print RELAY "SERVERS=\"";<br />
my $relay = $relayTagList->item(0);<br />
my $toserverTagList = $relay->getElementsByTagName("toserver");<br />
my $numtoservers = $toserverTagList->getLength;<br />
<br />
for ( my $nt = 0; $nt < $numtoservers ; $nt++ ) {<br />
my $toserverTag = $toserverTagList->item($nt);<br />
my $toserverData = $toserverTag->getFirstChild->getData;<br />
print RELAY "$toserverData ";<br />
}<br />
<br />
print RELAY "\"\n";<br />
close(RELAY);<br />
$files{"/etc/default/dhcp3-relay"} = $relay_file;<br />
}<br />
<br />
my $clientTagList = $virtualm->getElementsByTagName("client");<br />
my $numclients = $clientTagList->getLength;<br />
if ( $numclients == 1 ) {<br />
# Build file /etc/dhcp3/dhclient.conf<br />
my $client_file = "/tmp/$vm" . "_client.conf";<br />
chomp( my $date = `date` );<br />
open( CLIENT, ">$client_file" ) or $files{"ERROR"} = "Cannot open $client_file file";<br />
print CLIENT "# Configuration file for /sbin/dhclient, which is included in Debian's dhcp3-client package.\n";<br />
print CLIENT "# client.conf file generated by dhcp.pm VNUML plugin at $date\n\n";<br />
print CLIENT "send host-name \"<hostname>\";\n";<br />
print CLIENT "request subnet-mask, broadcast-address, time-offset, routers, domain-name, domain-name-servers, domain-search, host-name, netbios-name-servers, netbios-scope, interface-mtu;\n";<br />
print CLIENT "retry 10;\n";<br />
close(CLIENT);<br />
$files{"/etc/dhcp3/dhclient.conf"} = $client_file;<br />
<br />
}<br />
}else{<br />
$files{"ERROR"} = "Your choice $type for $vm is not a recognized type (yet)\n";<br />
}<br />
}<br />
}<br />
}<br />
return %files;<br />
}<br />
<br />
###########################################################<br />
# bootingCommands<br />
#<br />
# To be called during "t" mode, for each vm in the scenario<br />
#<br />
# Arguments:<br />
# - vm name<br />
#<br />
# Returns:<br />
# - list of commands to execute in the virtual machine at booting time<br />
#<br />
###########################################################<br />
<br />
sub bootingCommands {<br />
<br />
}<br />
<br />
<br />
###########################################################<br />
# execVmsToUse<br />
#<br />
# To be called once during "x" mode<br />
#<br />
# Arguments:<br />
# - seq command sequence<br />
#<br />
# Returns:<br />
# - list of virtual machines where the command has effect<br />
#<br />
###########################################################<br />
<br />
sub execVmsToUse {<br />
<br />
my $self = shift;<br />
my $seq = shift;<br />
<br />
# Four lists are built, one is returned depending on the executed command<br />
my @vm_list = ();<br />
my @server_vm_list = ();<br />
my @relay_vm_list = ();<br />
my @client_vm_list = ();<br />
<br />
my $virtualmList=$globalNode->getElementsByTagName("vm");<br />
my $longitud = $virtualmList->getLength;<br />
<br />
<br />
for (my $m=0; $m<$longitud; $m++){<br />
<br />
my $virtualm = $virtualmList->item($m);<br />
my $virtualm_name = $virtualm->getAttribute("name");<br />
push (@vm_list,$virtualm_name);<br />
<br />
my $serverTagList = $virtualm->getElementsByTagName("server");<br />
my $numservers = $serverTagList->getLength;<br />
my $relayTagList = $virtualm->getElementsByTagName("relay");<br />
my $numrelays = $relayTagList->getLength;<br />
my $clientTagList = $virtualm->getElementsByTagName("client");<br />
my $numclients = $clientTagList->getLength;<br />
<br />
if ( $numservers == 1 ) {<br />
push (@server_vm_list,$virtualm_name);<br />
}<br />
if ( $numrelays == 1 ) {<br />
push (@relay_vm_list,$virtualm_name);<br />
}<br />
if (!($numclients == 0)) {<br />
push (@client_vm_list,$virtualm_name);<br />
}<br />
}<br />
<br />
if ($seq eq "start" || $seq eq "restart" || $seq eq "stop" || $seq eq "dhcp-start" || $seq eq "dhcp-restart" || $seq eq "dhcp-stop") {<br />
return @vm_list;<br />
}elsif ($seq eq "dhcp-server-start"|| $seq eq "dhcp-server-stop" || $seq eq "dhcp-server-restart" || $seq eq "dhcp-server-force-reload"){<br />
return @server_vm_list;<br />
}elsif ( $seq eq "dhcp-relay-start"|| $seq eq "dhcp-relay-restart"|| $seq eq "dhcp-relay-stop"|| $seq eq "dhcp-relay-force-reload"){<br />
return @relay_vm_list;<br />
}elsif ($seq eq "dhcp-client-start"||$seq eq "dhcp-client-restart"||$seq eq "dhcp-client-stop"){<br />
return @client_vm_list;<br />
}else{<br />
return ();<br />
}<br />
}<br />
<br />
<br />
<br />
<br />
###########################################################<br />
# execCreateFiles<br />
#<br />
# To be called during "x" mode, for each vm in the scenario<br />
#<br />
# Arguments:<br />
# - vm name<br />
# - seq command sequence<br />
#<br />
# Returns:<br />
# - a hashname which kyes are absolute pathnames of files in vm filesystem and<br />
# values the the pathname of the file in the host filesystem. The file in the<br />
# host filesytesm is removed after VNUML processed it, so temporal files in<br />
# /tmp are preferable)<br />
#<br />
###########################################################<br />
<br />
sub execCreateFiles {<br />
}<br />
<br />
<br />
###########################################################<br />
# execCommands<br />
#<br />
# To be called during "x" mode, for each vm in the scenario<br />
#<br />
# Arguments:<br />
# - vm name<br />
# - seq command sequence<br />
#<br />
# Returns:<br />
# - list of commands to execute in the virtual machine after <exec> processing<br />
###########################################################<br />
<br />
sub execCommands {<br />
<br />
my $self = shift;<br />
my $vm = shift;<br />
my $seq = shift;<br />
<br />
my @commands;<br />
<br />
my $type;<br />
<br />
my $virtualmList = $globalNode->getElementsByTagName("vm");<br />
my $longitud = $virtualmList->getLength;<br />
<br />
for (my $m=0 ; $m<$longitud ; $m++) {<br />
<br />
my $virtualm = $virtualmList->item($m);<br />
my $virtualm_name = $virtualm->getAttribute("name");<br />
<br />
if ( $vm eq $virtualm_name ) {<br />
<br />
$type = $virtualm->getAttribute("type");<br />
<br />
switch ($type) {<br />
<br />
case "dhcp3" {<br />
# recognized type<br />
}<br />
else {<br />
unshift( @commands, "Your choice $type for $vm is not a recognized type (yet)\n");<br />
}<br />
}<br />
<br />
my $serverTagList = $virtualm->getElementsByTagName("server");<br />
my $numservers = $serverTagList->getLength;<br />
my $relayTagList = $virtualm->getElementsByTagName("relay");<br />
my $numrelays = $relayTagList->getLength;<br />
my $clientTagList = $virtualm->getElementsByTagName("client");<br />
my $numclients = $clientTagList->getLength;<br />
<br />
switch ($seq){<br />
<br />
case ["start","dhcp-start"]{ <br />
# Start server, relay and clients in the virtual machine, if any<br />
unshift( @commands, "" );<br />
if ( $numservers == 1 ) {<br />
push( @commands, "/etc/init.d/dhcp3-server start" );<br />
}<br />
if ( $numrelays == 1 ) {<br />
push( @commands, "/etc/init.d/dhcp3-relay start" );<br />
}<br />
if (!($numclients == 0)) {<br />
unshift(@commands, "" );<br />
my $client = $clientTagList->item(0);<br />
my $ifTagList = $client->getElementsByTagName("if");<br />
my $numif = $ifTagList->getLength;<br />
for (my $ni=0; $ni<$numif ; $ni++) {<br />
my $ifTag = $ifTagList->item($ni);<br />
my $ifData = $ifTag->getFirstChild->getData;<br />
if (!($ifData == 0)) {<br />
push(@commands,"dhclient eth"."$ifData");<br />
}<br />
}<br />
}<br />
<br />
}<br />
case ["restart","dhcp-restart"]{<br />
# Restart server, relay and clients in the virtual machine, if any <br />
unshift( @commands, "" );<br />
if ( $numservers == 1 ) {<br />
push( @commands, "/etc/init.d/dhcp3-server restart" );<br />
}<br />
if ( $numrelays == 1 ) {<br />
push( @commands, "/etc/init.d/dhcp3-relay restart" );<br />
}<br />
if (!($numclients == 0)) {<br />
unshift(@commands, "" );<br />
my $client = $clientTagList->item(0);<br />
my $ifTagList = $client->getElementsByTagName("if");<br />
my $numif = $ifTagList->getLength;<br />
for (my $ni=0; $ni<$numif ; $ni++) {<br />
my $ifTag = $ifTagList->item($ni);<br />
my $ifData = $ifTag->getFirstChild->getData;<br />
if (!($ifData == 0)) {<br />
push(@commands,"dhclient -r");<br />
push(@commands,"killall dhclient");<br />
push(@commands,"dhclient eth"."$ifData");<br />
}<br />
}<br />
}<br />
<br />
}<br />
case ["stop","dhcp-stop"]{ <br />
# Stop server and relay in the virtual machine, if any<br />
unshift( @commands, "" );<br />
if ( $numservers == 1 ) {<br />
push( @commands, "/etc/init.d/dhcp3-server stop" );<br />
}<br />
if ( $numrelays == 1 ) {<br />
push( @commands, "/etc/init.d/dhcp3-relay stop" );<br />
}<br />
if (!($numclients == 0)) {<br />
unshift(@commands, "" );<br />
my $client = $clientTagList->item(0);<br />
my $ifTagList = $client->getElementsByTagName("if");<br />
my $numif = $ifTagList->getLength;<br />
for (my $ni=0; $ni<$numif ; $ni++) {<br />
my $ifTag = $ifTagList->item($ni);<br />
my $ifData = $ifTag->getFirstChild->getData;<br />
if (!($ifData == 0)) {<br />
push(@commands,"dhclient -r");<br />
push(@commands,"killall dhclient");<br />
}<br />
}<br />
}<br />
<br />
}<br />
case ("dhcp-server-start"){<br />
# Start the server in the virtual machine. Return error if there isn't any. <br />
if ( $numservers == 0 ) {<br />
unshift( @commands, "$vm is not configured as a dhcp server. Choose the appropriate virtual machine with flag -M name" );<br />
}<br />
else {<br />
unshift( @commands, "" );<br />
push( @commands, "/etc/init.d/dhcp3-server start" );<br />
}<br />
}<br />
case ("dhcp-relay-start"){<br />
# Start the relay in the virtual machine. Return error if there isn't any.<br />
if ( $numrelays == 0 ) {<br />
unshift( @commands, "$vm is not configured as a dhcp relay. Choose the appropriate virtual machine with flag -M name" );<br />
}<br />
else {<br />
unshift( @commands, "" );<br />
push( @commands, "/etc/init.d/dhcp3-relay start" );<br />
} <br />
}<br />
case ("dhcp-client-start"){<br />
# Start the clients in the virtual machine. Return error if there aren't any.<br />
if ( $numclients == 0 ) {<br />
unshift( @commands, "$vm is not configured as a dhcp client. Choose the appropriate virtual machine with flag -M name" );<br />
}<br />
else {<br />
unshift(@commands, "" );<br />
my $client = $clientTagList->item(0);<br />
my $ifTagList = $client->getElementsByTagName("if");<br />
my $numif = $ifTagList->getLength;<br />
for (my $ni=0; $ni<$numif ; $ni++) {<br />
my $ifTag = $ifTagList->item($ni);<br />
my $ifData = $ifTag->getFirstChild->getData;<br />
if (!($ifData == 0)) {<br />
push(@commands,"dhclient eth"."$ifData");<br />
}<br />
}<br />
<br />
}<br />
}<br />
case ("dhcp-server-restart"){<br />
# Restart the server in the virtual machine. Return error if there isn't any. <br />
if ( $numservers == 0 ) {<br />
unshift( @commands, "$vm is not configured as a dhcp server. Choose the appropriate virtual machine with flag -M name" );<br />
}<br />
else {<br />
unshift( @commands, "" );<br />
push( @commands, "/etc/init.d/dhcp3-server restart" );<br />
}<br />
}<br />
case ("dhcp-relay-restart"){<br />
# Restart the relay in the virtual machine. Return error if there isn't any.<br />
if ( $numrelays == 0 ) {<br />
unshift( @commands, "$vm is not configured as a dhcp relay. Choose the appropriate virtual machine with flag -M name" );<br />
}<br />
else {<br />
unshift( @commands, "" );<br />
push( @commands, "/etc/init.d/dhcp3-relay restart" );<br />
} <br />
}<br />
<br />
case ("dhcp-client-restart"){<br />
# Start the clients in the virtual machine. Return error if there aren't any.<br />
if ( $numclients == 0 ) {<br />
unshift( @commands, "$vm is not configured as a dhcp client. Choose the appropriate virtual machine with flag -M name" );<br />
}<br />
else {<br />
unshift(@commands, "" );<br />
my $client = $clientTagList->item(0);<br />
my $ifTagList = $client->getElementsByTagName("if");<br />
my $numif = $ifTagList->getLength;<br />
for (my $ni=0; $ni<$numif ; $ni++) {<br />
my $ifTag = $ifTagList->item($ni);<br />
my $ifData = $ifTag->getFirstChild->getData;<br />
if (!($ifData == 0)) {<br />
push(@commands,"dhclient -r");<br />
push(@commands,"killall dhclient");<br />
push(@commands,"dhclient eth"."$ifData");<br />
}<br />
}<br />
<br />
}<br />
}<br />
<br />
case ("dhcp-server-stop"){<br />
# Stop the server in the virtual machine. Return error if there isn't any. <br />
if ( $numservers == 0 ) {<br />
unshift( @commands, "$vm is not configured as a dhcp server. Choose the appropriate virtual machine with flag -M name" );<br />
}<br />
else {<br />
unshift( @commands, "" );<br />
push( @commands, "/etc/init.d/dhcp3-server stop" );<br />
}<br />
<br />
}<br />
case ("dhcp-relay-stop"){<br />
# Stop the relay in the virtual machine. Return error if there isn't any. <br />
if ( $numrelays == 0 ) {<br />
unshift( @commands, "$vm is not configured as a dhcp relay. Choose the appropriate virtual machine with flag -M name" );<br />
}<br />
else {<br />
unshift( @commands, "" );<br />
push( @commands, "/etc/init.d/dhcp3-relay stop" );<br />
}<br />
<br />
}<br />
<br />
case ("dhcp-client-stop"){<br />
# Start the clients in the virtual machine. Return error if there aren't any.<br />
if ( $numclients == 0 ) {<br />
unshift( @commands, "$vm is not configured as a dhcp client. Choose the appropriate virtual machine with flag -M name" );<br />
}<br />
else {<br />
unshift(@commands, "" );<br />
my $client = $clientTagList->item(0);<br />
my $ifTagList = $client->getElementsByTagName("if");<br />
my $numif = $ifTagList->getLength;<br />
for (my $ni=0; $ni<$numif ; $ni++) {<br />
my $ifTag = $ifTagList->item($ni);<br />
my $ifData = $ifTag->getFirstChild->getData;<br />
if (!($ifData == 0)) {<br />
push(@commands,"dhclient -r");<br />
push(@commands,"killall dhclient");<br />
}<br />
}<br />
<br />
}<br />
}<br />
<br />
case ("dhcp-server-force-reload"){<br />
# Force reload of the server in the virtual machine. Return error if there isn't any. <br />
if ( $numservers == 0 ) {<br />
unshift( @commands, "$vm is not configured as a dhcp server. Choose the appropriate virtual machine with flag -M name" );<br />
}<br />
else {<br />
unshift( @commands, "" );<br />
push( @commands, "/etc/init.d/dhcp3-server force-reload" );<br />
}<br />
<br />
}<br />
case ("dhcp-relay-force-reload"){<br />
# Force reload of the relay in the virtual machine. Return error if there isn't any. <br />
if ( $numservers == 0 ) {<br />
unshift( @commands, "$vm is not configured as a dhcp relay. Choose the appropriate virtual machine with flag -M name" );<br />
}<br />
else {<br />
unshift( @commands, "" );<br />
push( @commands, "/etc/init.d/dhcp3-relay force-reload" );<br />
}<br />
<br />
}else{<br />
unshift( @commands, "\nYour choice \"$seq\" is not a recognized command (yet).\nAvailable commands: start, stop, restart, dhcp-start, dhcp-stop, dhcp-restart, dhcp-server-start, dhcp-server-stop, dhcp-server-restart, dhcp-server-force-reload, dhcp-relay-start, dhcp-relay-stop, dhcp-relay-restart, dhcp-relay-force-reload, dhcp-client-start.\n" );<br />
}<br />
}<br />
return @commands;<br />
}<br />
}<br />
}<br />
<br />
<br />
<br />
<br />
<br />
###########################################################<br />
# shutdownCommands<br />
#<br />
# To be called during "d" mode, for each vm in the scenario<br />
#<br />
# Arguments:<br />
# - vm name<br />
#<br />
# Returns:<br />
# - list of commands to execute in the virtual machine at shutdown time<br />
#<br />
###########################################################<br />
<br />
sub shutdownCommands {<br />
<br />
my $self = shift;<br />
my $vm = shift;<br />
<br />
my @commands;<br />
<br />
my $type;<br />
<br />
my $virtualmList = $globalNode->getElementsByTagName("vm");<br />
my $longitud = $virtualmList->getLength;<br />
<br />
for ( my $m = 0 ; $m < $longitud ; $m++ ) {<br />
<br />
my $virtualm = $virtualmList->item($m);<br />
my $virtualm_name = $virtualm->getAttribute("name");<br />
<br />
if ( $vm eq $virtualm_name ) {<br />
$type = $virtualm->getAttribute("type");<br />
<br />
switch ($type) {<br />
<br />
case "dhcp3" {<br />
<br />
unshift( @commands, "" );<br />
my $serverTagList = $virtualm->getElementsByTagName("server");<br />
my $numservers = $serverTagList->getLength;<br />
<br />
if ( $numservers == 1 ) {<br />
push( @commands, "/etc/init.d/dhcp3-server stop" );<br />
}<br />
<br />
my $relayTagList = $virtualm->getElementsByTagName("relay");<br />
my $numrelays = $relayTagList->getLength;<br />
<br />
if ( $numrelays == 1 ) {<br />
push( @commands, "/etc/init.d/dhcp3-relay stop" );<br />
}<br />
}<br />
else {<br />
unshift( @commands,"Your choice $type for $vm is not a recognized type (yet)\n");<br />
}<br />
<br />
}<br />
}<br />
<br />
return @commands;<br />
<br />
}<br />
}<br />
<br />
#############################################################<br />
# finalizePlugin<br />
#<br />
# To be called always, just before ending the procesing the scenario specification<br />
#<br />
# Arguments:<br />
# - none<br />
#<br />
# Returns:<br />
# - none<br />
#<br />
#############################################################<br />
<br />
sub finalizePlugin {<br />
<br />
}<br />
<br />
#############################################################<br />
#<br />
# Checks existence and semantics in ospf conf file.<br />
# Currently this check consist in:<br />
#<br />
# 1. Configuration file exists.<br />
# 2. Check DTD.<br />
# 3. IP tag contains mask attribute and data.<br />
# 4. Area tag is unique and contains data.<br />
#<br />
#############################################################<br />
<br />
sub checkConfigFile {<br />
<br />
# 1. Configuration file exists.<br />
my $config_file = shift;<br />
open( FILEHANDLE, $config_file )<br />
or { return "cannot open config file $config_file\n", };<br />
close(FILEHANDLE);<br />
<br />
# 2. Check DTD<br />
my $parser = new XML::DOM::ValParser;<br />
my $dom_tree;<br />
$valid_fail = 0;<br />
#eval {<br />
local $XML::Checker::FAIL = \&validation_fail;<br />
$dom_tree = $parser->parsefile($config_file);<br />
#};<br />
<br />
if ($valid_fail) {<br />
return ("$config_file is not a well-formed DHCP plugin file\n");<br />
}<br />
<br />
$globalNode = $dom_tree->getElementsByTagName("dhcp_conf")->item(0);<br />
<br />
return 0;<br />
}<br />
<br />
sub validation_fail {<br />
my $code = shift;<br />
<br />
# To set flag<br />
$valid_fail = 1;<br />
<br />
# To print error message<br />
XML::Checker::print_error( $code, @_ );<br />
}<br />
<br />
1</div>Davidhttps://web.dit.upm.es/vnumlwiki/index.php?title=Plugins&diff=4138Plugins2011-07-21T08:47:45Z<p>David: </p>
<hr />
<div>{{Title|VNUML Extension Plugins}}<br />
<br />
<span style="color:red"><strong>Under construction!</strong></span><br />
<br />
Since VNUML 1.9 an extension plugins mechanism has been developed, so new functionality can be added to create files and execute commands in the virtual machines. You can use the plugins included in the VNUML or develop your owns, using the VNUML plugins API.<br />
<br />
* [[PluginsAPI|Plugin API specification]]<br />
* [[PluginsHowto|Plugin development howto]]<br />
<br />
Plugins included in the VNUML package:<br />
<br />
* [[PluginOspfd|Ospfd]], to configure OSPF daemons in the virtual machines<br />
* [[PluginDhcp|Dhcp]], to provide DHCP capabilities in the virtual machines<br />
<br />
Plugins code:<br />
* [[PluginsDummyCode|Dummy]]</div>Davidhttps://web.dit.upm.es/vnumlwiki/index.php?title=Vnx-rootfsolive&diff=4137Vnx-rootfsolive2011-05-26T12:51:52Z<p>David: </p>
<hr />
<div>{{Title|How to create an Olive (Juniper router) root-file-system for VNX}}<br />
<br />
The procedure described here is mainly based on the excellent information provided in the following GNS3 blog entry: [http://blog.gns3.net/2009/10/olive-juniper/2/ Olive reloaded or how to emulate Juniper routers]. It has been tested over an Ubuntu 10.04.1 LTS machine.<br />
<br />
Steps:<br />
<ul><br />
<li>Create the base root filesystem image (use 5G instead of 4G):</li><br />
qemu-img create -f qcow2 root_fs_olive.qcow2 5G<br />
<li>Download Freebsd 4.11 installation CD from:</li><br />
wget ftp://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/i386/ISO-IMAGES/4.11/4.11-RELEASE-i386-miniinst.iso<br />
<li>Start the new virtual machine:</li><br />
kvm -m 256 -hda root_fs_olive.qcow2 -cdrom 4.11-RELEASE-i386-miniinst.iso -boot d -localtime<br />
and make the FreeBSD installation following the exact steps described in GNS3 blog.<br />
<li>Once the FreeBSD installation is finished, stop the virtual machine (just make a Ctrl-C on the window you started the kvm command line when asked to restart). Start the virtual machine again using the following options:<br />
</li><br />
kvm -m 1024 -hda root_fs_olive.qcow2 -boot c -localtime -net nic,macaddr=00:aa:00:60:01:01,model=e1000 -net user<br />
<li>Login into the machine and configure the network interface:</li><br />
dhclient em0<br />
<br />
<li>Get JunOS package (you need an account in Juniper's server to download JunOS images):</li><br />
wget ... jinstall-9.5R1.8-domestic-signed.tgz<br />
<br />
<li>Copy it using scp from inside the virtual machine:</li><br />
scp 10.0.2.2:/path-to/jinstall-9.5R1.8-domestic-signed.tgz /var/tmp<br />
<br />
<li>Prepare the JunOS package before installing it using the following instructions:</li><br />
cd /var/tmp<br />
mkdir jinst-signed<br />
cd jinst-signed/<br />
tar zxvf ../jinstall-9.5R1.8-domestic-signed.tgz<br />
mkdir jinst<br />
cd jinst<br />
tar zfvx ../jinstall-9.5R1.8-domestic.tgz<br />
mkdir pkgtools<br />
cd pkgtools<br />
tar zxvf ../pkgtools.tgz<br />
cd bin<br />
cp /usr/bin/true ./checkpic<br />
cd ..<br />
tar zcvf ../pkgtools.tgz *<br />
cd ..<br />
rm -rf pkgtools<br />
tar zcfv /var/tmp/jinstall-9.5R1.8-domestic-olive.tgz *<br />
cd /var/tmp<br />
rm -rf jinstall-9.5R1.8-domestic-signed.tgz jinst-signed<br />
Note: you don't need to sign the package before rebuilding it as described in Olive's blogs.<br />
<li>Install the package:</li><br />
pkg_add -f jinstall-9.5R1.8-domestic-olive.tgz<br />
<li>When the installation is finished and you are required to reboot, stop the virtual machine with "halt" and restart it with the following parameters:</li><br />
kvm -bios bios-0.10.6.bin -m 1024 -hda root_fs_olive.qcow2 -boot c -localtime -nodefaults -nographic -serial stdio<br />
<br />
Note: as stated in a comment to "Olive reloaded" blog entry mentioned above, Olive virtual machines do not work with the latest BIOS distributed with qemu-kvm package. To make it work, you have to download the BIOS from qemu 0.10.6 version and copy it to /usr/share/qemu/ directory:<br />
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.10.6/qemu-kvm-0.10.6.tar.gz<br />
tar xfvz qemu-kvm-0.10.6.tar.gz<br />
cp qemu-kvm-0.10.6/pc-bios/bios.bin /usr/share/qemu-kvm/bios-0.10.6.bin<br />
<br />
<li>Finally, install the autoconfiguration daemon with the following procedure:</li><br />
<ul><br />
<li>Start the virtual machine with:</li><br />
kvm -bios bios-0.10.6.bin -m 1024 -hda root_fs_olive.qcow2 -boot c -localtime -nodefaults -nographic -serial stdio -net nic,macaddr=00:aa:00:60:01:01,model=e1000 -net user<br />
<br />
<li>Configure the network interface manually (dhclient is no more available; it has been deleted duting JunOS installation) and test the connectivity to the host:</li><br />
ifconfig em0 inet 10.0.2.10/24<br />
ping 10.0.2.2<br />
<br />
<li>Copy the olived tar file to the virtual machine (note that name of the file could be different depending on the version):</li><br />
scp 10.0.2.2:/usr/share/vnx/ace/vnx-ace-olive-0.1b.tgz /var/tmp<br />
<br />
<li>Expand the tar file and install the daemon:</li><br />
cd /var/tmp<br />
tar xfvz vnx-ace-olive-0.1b.tgz <br />
cd vnx-ace-olive-0.1b<br />
sh install-vnxolived<br />
<br />
<li>Delete /var/tmp directory:</li><br />
rm -rf /var/tmp/*<br />
<br />
<li>Set the root password for the router:</li><br />
cli<br />
config<br />
set system root-authentication plain-text-password <br />
commit<br />
</ul><br />
<br />
<li>Stop the virtual machine with a halt. The root filesystem is now ready to be used with VNX.</li><br />
</ul><br />
<br />
== References==<br />
<br />
* Virtualizing JunOS on VMware. http://pauldotcom.com/2011/05/virtualizing-junos-on-vmware.html</div>Davidhttps://web.dit.upm.es/vnumlwiki/index.php?title=Vnx-rootfsfedora&diff=4136Vnx-rootfsfedora2011-05-23T23:23:18Z<p>David: Created page with "{{Title|How to create a Fedora root filesystem for VNX}} Follow this procedure to create a fedora based root filesystem for VNX. The procedure has been tested with Fedora 14. <u..."</p>
<hr />
<div>{{Title|How to create a Fedora root filesystem for VNX}}<br />
<br />
Follow this procedure to create a fedora based root filesystem for VNX. The procedure has been tested with Fedora 14.<br />
<ul><br />
<li>Create the filesystem disk image:</li><br />
qemu-img create -f qcow2 root_fs_fedora-base.qcow2 5GB<br />
<li>Get Fedora installation DVD (use the complete DVD; do not use the Live version, as it seems the installation wizard does not include the customization menu). For example:</li><br />
wget ftp://ftp.rediris.es/mirror/fedora/14/Fedora/i386/iso/Fedora-14-i386-DVD.iso<br />
cp Fedora-14-i386-DVD.iso /almacen/iso<br />
<li>Create a libvirt XML definition (root_fs_freebsd.xml) containing the virtual machine description:</li><br />
<pre><br />
<domain type='kvm'><br />
<name>Fedora</name><br />
<memory>524288</memory><br />
<vcpu>1</vcpu><br />
<os><br />
<type arch="i686">hvm</type><br />
<boot dev='hd'/><br />
<boot dev='cdrom'/><br />
</os><br />
<features><br />
<pae/><br />
<acpi/><br />
<apic/><br />
</features><br />
<clock sync="localtime"/><br />
<devices><br />
<emulator>/usr/bin/kvm</emulator><br />
<disk type='file' device='disk'><br />
<source file='/usr/share/vnx/filesystems/root_fs_fedora-base.qcow2'/><br />
<target dev='hda'/><br />
</disk><br />
<disk type='file' device='cdrom'><br />
<source file='/almacen/iso/Fedora-14-i386-DVD.iso'/><br />
<target dev='hdb'/><br />
</disk><br />
<interface type='network'><br />
<source network='default'/><br />
</interface><br />
<serial type="pty"><br />
<target port="1"/><br />
</serial><br />
<console type="pty"><br />
<target port="1"/><br />
</console><br />
<graphics type='vnc'/><br />
</devices><br />
</domain><br />
</pre><br />
Note: change "source file=" lines to whatever fits your case (use full paths). <br />
<br />
<li>Start the virtual machine with:</li><br />
virsh create root_fs_fedora.xml<br />
<li>Access virtual machine console with:</li><br />
virt-viewer Fedora<br />
<li>Follow Fedora installation menus to install:</li><br />
<ul><br />
<li>A "minimal" system, if you want a server rootfs without user interface</li><br />
<li>One of the other options (e.g "web server", "desktop system", etc) if you want a system with graphical user interface</li><br />
</ul><br />
<li>Once installation is finished, update the system and install additional packages</li><br />
yum update<br />
yum install perl perl-XML-DOM acpid udisks<br />
Note: if yum fails, check that the network is working. Maybe you will have to manually execute "dhclient eth0", at least in the case of a minimal installation.<br />
<li>Install VNX autoconfiguration daemon:</li><br />
<ul><br />
<li>From the host execute:</li><br />
/usr/share/vnx/bin/vnx_update_aced Fedora /usr/share/vnx/aced/vnx-aced-lf-0.1b.tgz <br />
<li>From the virtual machine console:</li><br />
ln -s /media/CDROM /media/cdrom<br />
perl /media/cdrom/install_vnxdaemon<br />
</ul><br />
<li>Delete udev network rules files:</li><br />
rm /etc/udev/rules.d/70-persistent-net.rules<br />
<li>Enable login on the first serial line by creating a file named /etc/init/serial-ttyS0.conf with the following content:</li><br />
#This service maintains a getty on /dev/ttyS0.<br />
start on stopped rc RUNLEVEL=[2345]<br />
stop on starting runlevel [016]<br />
respawn<br />
exec /sbin/agetty /dev/ttyS0 9600 vt100-nav<br />
<li>Besides, you have to add ttyS0 to /etc/securetty file if you want to login root on that console:</li><br />
echo "ttyS0" >> /etc/securetty<br />
<li>If you have chosen a "minimum installation", activate network services (they are disable by default):</li><br />
chkconfig --level 3 network on<br />
<li>Optionally:</li><br />
<ul><br />
<li>Install other services, for example, an apache server:</li><br />
yum install httpd<br />
update-rc.d -f apache2 remove # to avoid automatic start<br />
<li>Or, if using a "minumum installation", install network utilities:</li><br />
yum install telnet wget openssh-clients<br />
<li>If you want automatic login, just edit /etc/gdm/custom.conf and add the following lines:</li><br />
AutomaticLoginEnable=true<br />
AutomaticLogin=vnx<br />
<li>Disable the firewall. Firewall is enabled by default which could be problematic for testing purpose systems. If desired, disable it graphically in "System|Administration|Firewall" option, or using the following command from the command line:</li><br />
chkconfig iptables off<br />
</ul><br />
<li>Clean yum cache and stop the machine with:</li><br />
yum clean all<br />
halt<br />
</ul><br />
<br />
== Installing additional software ==<br />
<br />
To install additional software or modify your root file system, you just have to start it as described above and make the operations required on the filesystem.<br />
* Start the virtual machine (directly using virsh or the vnx_modify_rootfs utility):<br />
/usr/share/vnx/bin/vnx_modify_rootfs root_fs_fedora.xml <br />
* Install the software:<br />
yum install ...<br />
* Delete udev rules files:<br />
rm /etc/udev/rules.d/70-persistent-net.rules<br />
* Stop the machine with:<br />
halt<br />
<br />
== Known problems ==</div>Davidhttps://web.dit.upm.es/vnumlwiki/index.php?title=VNX&diff=4135VNX2011-05-23T23:22:38Z<p>David: /* Information for users */</p>
<hr />
<div>{{Title|VNX Project Documentation}}<br />
<br />
'''VNX (Virtualization over X)''' is the new release of the '''VNUML''' tool. VNX brings important new functionalities that overcome the most important limitations VNUML tool has:<br />
* Integration of new virtualization platforms to allow virtual machines running other operating systems (Windows, FreeBSD, etc) apart from Linux. In this sense:<br />
** VNX uses [http://libvirt.org libvirt] to interact with the virtualization capabilities, allowing the use of most of the virtualization platforms available for Linux (KVM, Xen, etc)<br />
** Integrates [http://www.ipflow.utc.fr/blog/ Dynamips] to allow limited emulation of CISCO routers<br />
* Restart of individual virtual machines<br />
* Autoconfiguration and command execution capabilities for several operating systems: Linux, FreeBSD and Windows (XP and 7).<br />
<br />
== Information for users ==<br />
* [[vnx-install|VNX Installation Guide]]<br />
* [[vnx-examples|Example scenarios]]<br />
* [[vnx-troubleshooting|Troubleshooting]]<br />
* Rootfilesystem creation How-to's:<br />
** [[vnx-rootfswinxp|How to create a Windows XP rootfilesystem for VNX]]<br />
** [[vnx-rootfswin7|How to create a Windows 7 rootfilesystem for VNX]]<br />
** [[vnx-rootfsubuntu|How to create a Ubuntu rootfilesytem for VNX]]<br />
** [[vnx-rootfsfreebsd|How to create a FreeBSD rootfilesytem for VNX]]<br />
** [[vnx-rootfsolive|How to create an Olive (juniper router) rootfilesystem for VNX]]<br />
** [[vnx-rootfsfedora|How to create a Fedora rootfilesytem for VNX]]<br />
<br />
== Downloading VNX ==<br />
<br />
You can download VNX from http://idefix.dit.upm.es/download/vnx<br />
<br />
VNX Root filesystems are temporarily hosted in http://idefix.dit.upm.es/download/vnx/filesystems</div>Davidhttps://web.dit.upm.es/vnumlwiki/index.php?title=Vnx-install&diff=4133Vnx-install2011-05-10T17:17:31Z<p>David: /* Installation over Ubuntu 10.04/9.10 */</p>
<hr />
<div>{{Title|VNX (Virtual Networks over X virtualization) v0.14 beta}}<br />
<br />
== Installation over Ubuntu 10.04/9.10 ==<br />
<br />
This section describes the procedure for installing VNX over Ubuntu 10.04 or 9.10. Open a root shell window and follow these steps:<br />
<ul><br />
<br />
<li>Install all packages required (basic development, virtualization, perl libraries and auxiliar packages):</li><br />
apt-get update<br />
apt-get install build-essential qemu-kvm libvirt-bin vlan xterm \<br />
bridge-utils screen virt-manager virt-viewer libxml-checker-perl \<br />
libxml-parser-perl libnetaddr-ip-perl libnet-pcap-perl \<br />
libnet-ipv6addr-perl liberror-perl libexception-class-perl \<br />
uml-utilities libxml-libxml-perl libxml2-dev libgnutls-dev \<br />
libdevmapper-dev libterm-readline-perl-perl libnet-telnet-perl \<br />
libnet-ip-perl libreadonly-perl libmath-round-perl libappconfig-perl \<br />
libdbi-perl graphviz libnl-dev genisoimage gnome-terminal libfile-homedir-perl<br />
<br />
<!--Note: for Ubuntu 9.04 change "qemu-kvm" package by "qemu kvm" --><br />
<li>If you use 64 bits version of Ubuntu, install 32 bits compatibility libraries:</li><br />
apt-get install ia32-libs<br />
<br />
<li>Install libvirt 0.8.5:</li><br />
/etc/init.d/libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.8.5.tar.gz<br />
tar xfvz libvirt-0.8.5.tar.gz<br />
cd libvirt-0.8.5<br />
./configure --without-xen --prefix=/usr && make && make install<br />
/etc/init.d/libvirt-bin start<br />
<br />
'''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.<br />
<br />
<li>Install Sys::Virt perl module:</li><br />
<ul><br />
<li>For Ubuntu 10.04, just install the libsys-virt-perl package</li><br />
apt-get install libsys-virt-perl<br />
<!--<br />
'''IMPORTANT NOTE''': Windows XP virtual machines started with VNX over Ubuntu 9.10 frequently hang when executing commands or with high traffic loads. The problem could be related with virtual network drivers. We are investigating the problem to find a solution. By now, Ubuntu 10.04 is the recomended platform to test VNX.<br />
--><br />
<li>For Ubuntu 9.10, as Sys::Virt library is not available as a package, install it manually:</li><br />
wget http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.2.3.tar.gz<br />
tar xfvz Sys-Virt-0.2.3.tar.gz <br />
cd Sys-Virt-0.2.3<br />
perl Makefile.PL<br />
make install<br />
</ul><br />
<br />
<li>Install VNX:</li><br />
mkdir /tmp/vnx-update<br />
cd /tmp/vnx-update<br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-latest.tgz<br />
tar xfvz vnx-latest.tgz<br />
cd vnx-*<br />
./install_vnx<br />
<br />
<li>Create the VNX config file (/etc/vnx.conf). You just can move the sample config file:</li><br />
mv /etc/vnx.conf.sample /etc/vnx.conf<br />
<br />
<li>Download root file systems from http://idefix.dit.upm.es/download/vnx/filesystems and copy them to /usr/share/vnx/filesystems directory:</li><br />
cd /usr/share/vnx/filesystems<br />
<br />
# ubuntu server<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.10-v02.qcow2.bz2<br />
bunzip2 root_fs_ubuntu-10.10-v02.qcow2.bz2<br />
ln -s root_fs_ubuntu-10.10-v02.qcow2 root_fs_ubuntu<br />
<br />
# ubuntu with gui<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.10-gui-v01.qcow2.bz2<br />
bunzip2 root_fs_ubuntu-10.10-gui-v01.qcow2.bz2<br />
ln -s root_fs_ubuntu-10.10-gui-v01.qcow2 root_fs_ubuntu-gui<br />
<br />
# freebsd server<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-8.1-v01.qcow2.bz2<br />
bunzip2 root_fs_freebsd-8.1-v01.qcow2.bz2<br />
ln -s root_fs_freebsd-8.1-v01.qcow2 root_fs_freebsd<br />
<br />
# freebsd gui<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-8.1-gui-v01.qcow2.bz2<br />
bunzip2 root_fs_freebsd-8.1-gui-v01.qcow2.bz2<br />
ln -s root_fs_freebsd-8.1-gui-v01.qcow2 root_fs_freebsd-gui<br />
<br />
# winxp and win7<br />
# Sorry! Unfortunately for legal reasons we cannot distribute windows XP<br />
# or Windows 7 root filesystems. See VNX documentation for detailed recipes<br />
# to create these root fylesystems from scratch<br />
<br />
<li>Additionally, if you plan to use VNUML root filesystem:</li><br />
# VNUML root_fs_tutorial and kernel<br />
cd /usr/share/vnx/filesystems<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_tutorial-0.6.0.bz2<br />
bunzip2 root_fs_tutorial-0.6.0.bz2<br />
ln -s root_fs_tutorial-0.6.0 root_fs_tutorial<br />
cd /usr/share/vnx/kernels<br />
wget -N http://jungla.dit.upm.es/~vnx/download/kernels/linux-2.6.18.1-bb2-xt-4m<br />
chmod +x linux-2.6.18.1-bb2-xt-4m<br />
ln -s linux-2.6.18.1-bb2-xt-4m linux<br />
<br />
</ul><br />
<br />
'''NOTE for Ubuntu 10.04.1''': It seems that an additional package has to be installed:<br />
apt-get install kvm-pxe<br />
<br />
<br />
=== Additional install steps for Dynamips support ===<br />
<br />
* Install Dynamips and Dynagen:<br />
apt-get install dynamips dynagen<br />
<br />
* Create a file /etc/init.d/dynamips (taken from http://7200emu.hacki.at/viewtopic.php?t=2198):<br />
<pre><br />
#!/bin/sh<br />
# Start/stop the dynamips program as a daemon.<br />
#<br />
### BEGIN INIT INFO<br />
# Provides: dynamips<br />
# Default-Start: 2 3 4 5<br />
# Default-Stop: 0 1 6<br />
# Short-Description: Cisco hardware emulator daemon<br />
### END INIT INFO<br />
<br />
DAEMON=/usr/bin/dynamips<br />
NAME=dynamips<br />
PORT=7200<br />
PIDFILE=/var/run/$NAME.pid <br />
LOGFILE=/var/log/$NAME.log<br />
DESC="Cisco Emulator"<br />
SCRIPTNAME=/etc/init.d/$NAME<br />
<br />
test -f $DAEMON || exit 0<br />
<br />
. /lib/lsb/init-functions<br />
<br />
<br />
case "$1" in<br />
start) log_daemon_msg "Starting $DESC " "$NAME"<br />
start-stop-daemon --start --chdir /tmp --background --make-pidfile --pidfile $PIDFILE --name $NAME --startas $DAEMON -- -H $PORT -l $LOGFILE<br />
log_end_msg $?<br />
;;<br />
stop) log_daemon_msg "Stopping $DESC " "$NAME"<br />
start-stop-daemon --stop --quiet --pidfile $PIDFILE --name $NAME<br />
log_end_msg $?<br />
;;<br />
restart) log_daemon_msg "Restarting $DESC " "$NAME"<br />
start-stop-daemon --stop --retry 5 --quiet --pidfile $PIDFILE --name $NAME<br />
start-stop-daemon --start --chdir /tmp --background --make-pidfile --pidfile $PIDFILE --name $NAME --startas $DAEMON -- -H $PORT -l $LOGFILE<br />
log_end_msg $?<br />
;;<br />
status)<br />
status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $? <br />
#status $NAME<br />
#RETVAL=$?<br />
;; <br />
*) log_action_msg "Usage: $SCRIPTNAME {start|stop|restart|status}"<br />
exit 2<br />
;;<br />
esac<br />
exit 0<br />
<br />
</pre><br />
<br />
* Set execution permissions for the script and add it to system start-up:<br />
chmod +x /etc/init.d/dynamips<br />
update-rc.d dynamips defaults<br />
/etc/init.d/dynamips start<br />
<br />
* Download and install cisco IOS image:<br />
cd /usr/share/vnx/filesystems<br />
# Cisco image<br />
wget ... c3640-js-mz.124-19.image<br />
ln -s c3640-js-mz.124-19.image c3640<br />
<br />
* Calculate the idle-pc value for your computer following the procedure in http://dynagen.org/tutorial.htm:<br />
dynagen /usr/share/vnx/examples/R.net<br />
console R # type 'no' to exit the config wizard and wait <br />
# for the router to completely start <br />
idle-pc get R<br />
Once you know the idle-pc value for your system, include it in /etc/vnx.conf file.<br />
<br />
=== Additional install steps for Olive support ===<br />
<br />
Several additional steps are needed to support Olive (Juniper) routers in VNX scenarios:<br />
<br />
<ul><br />
<br />
<!-- Ya no hace falta desde que se usa <qemu:commandline><br />
<br />
<li>Install a patched version of libvirt 0.8.5 with support to define the bios used by a virtual machine:</li><br />
<br />
<ul><br />
<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><br />
<pre><br />
diff -crB libvirt-0.8.5.orig/src/conf/domain_conf.c libvirt-0.8.5/src/conf/domain_conf.c<br />
*** libvirt-0.8.5.orig/src/conf/domain_conf.c 2010-11-22 11:38:08.000000000 +0100<br />
--- libvirt-0.8.5/src/conf/domain_conf.c 2010-11-22 11:47:41.000000000 +0100<br />
***************<br />
*** 4267,4272 ****<br />
--- 4267,4274 ----<br />
if (node)<br />
def->mem.hugepage_backed = 1;<br />
<br />
+ def->biosfile = virXPathString("string(./biosfile[1])", ctxt);<br />
+ <br />
/* Extract other memory tunables */<br />
if (virXPathULong("string(./memtune/hard_limit)", ctxt,<br />
&def->mem.hard_limit) < 0)<br />
diff -crB libvirt-0.8.5.orig/src/conf/domain_conf.h libvirt-0.8.5/src/conf/domain_conf.h<br />
*** libvirt-0.8.5.orig/src/conf/domain_conf.h 2010-11-22 11:38:08.000000000 +0100<br />
--- libvirt-0.8.5/src/conf/domain_conf.h 2010-11-22 11:40:18.000000000 +0100<br />
***************<br />
*** 885,890 ****<br />
--- 885,891 ----<br />
unsigned long min_guarantee;<br />
unsigned long swap_hard_limit;<br />
} mem;<br />
+ char *biosfile;<br />
unsigned short vcpus;<br />
unsigned short maxvcpus;<br />
int cpumasklen;<br />
diff -crB libvirt-0.8.5.orig/src/qemu/qemu_conf.c libvirt-0.8.5/src/qemu/qemu_conf.c<br />
*** libvirt-0.8.5.orig/src/qemu/qemu_conf.c 2010-11-22 11:38:08.000000000 +0100<br />
--- libvirt-0.8.5/src/qemu/qemu_conf.c 2010-11-22 11:41:05.000000000 +0100<br />
***************<br />
*** 3984,3989 ****<br />
--- 3984,3995 ----<br />
ADD_ARG_LIT(emulator);<br />
ADD_ARG_LIT("-S");<br />
<br />
+ if(def->biosfile)<br />
+ {<br />
+ ADD_ARG_LIT("-bios");<br />
+ ADD_ARG_LIT(def->biosfile);<br />
+ }<br />
+ <br />
/* This should *never* be NULL, since we always provide<br />
* a machine in the capabilities data for QEMU. So this<br />
* check is just here as a safety in case the unexpected<br />
</pre><br />
<br />
<li>Install libvirt 0.8.5 with that patch applied:</li><br />
service libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.8.5.tar.gz<br />
tar xfvz libvirt-0.8.5.tar.gz <br />
cd libvirt-0.8.5<br />
patch -p1 -i ../libvirt-0.8.5-biosfile.patch <br />
./configure --without-xen --prefix=/usr && make && make install<br />
service libvirt-bin start<br />
<br />
</ul><br />
--><br />
<li>Download old qemu bios from 0.10.6 version and copy it to /usr/share/qemu directory:</li><br />
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.10.6/qemu-kvm-0.10.6.tar.gz<br />
tar xfvz qemu-kvm-0.10.6.tar.gz<br />
cp qemu-kvm-0.10.6/pc-bios/bios.bin /usr/share/qemu-kvm/bios-0.10.6.bin<br />
<br />
<!-- Not needed, it seems to work without downloading this drivers<br />
<li>Download i82559 ROM from the latest qemu versions (Ubuntu 10.04 does not include that ROM in qemu-kvm package):</li><br />
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.12.5/qemu-kvm-0.12.5.tar.gz<br />
tar xfvz qemu-kvm-0.12.5.tar.gz<br />
cp qemu-kvm-0.12.5/pc-bios/pxe-i82559er.bin /usr/share/qemu-kvm/<br />
--><br />
</ul><br />
<br />
== Installation over Fedora 11 (Draft) ==<br />
<br />
Follow this steps to install VNX over Fedora 11:<br />
<ul><br />
<br />
<li>Install packages:</li><br />
yum -y groupinstall "Development Tools"<br />
yum install qemu-kvm libvirt virt-manager virt-viewer perl-XML-LibXML<br />
yum install perl-XML-DOM perl-NetAddr-IP perl-Readonly perl-TermReadKey<br />
yum install perl-Net-Pcap perl-Net-IPv6Addr perl-Net-Telnet perl-Error<br />
yum install perl-Exception-Class perl-ExtUtils-MakeMaker tunctl screen wget<br />
yum install libxml2-devel gnutls-devel device-mapper-devel uml_utilities <br />
yum install roxterm xterm graphviz perl-AppConfig<br />
<br />
<li>Install libvirt 0.8.5:</li><br />
/etc/init.d/libvirtd stop<br />
wget http://libvirt.org/sources/libvirt-0.8.5.tar.gz<br />
tar xfvz libvirt-0.8.5.tar.gz<br />
cd libvirt-0.8.5<br />
./configure --without-xen --prefix=/usr && make && make install<br />
/etc/init.d/libvirtd start<br />
<br />
<li>Install SysVirt manually:</li><br />
wget http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.2.4.tar.gz<br />
tar xfvz Sys-Virt-0.2.4.tar.gz<br />
cd Sys-Virt-0.2.4<br />
perl Makefile.PL<br />
make install<br />
<!--<br />
<li> Instalar VNUML sobre Fedora 11 siguiendo la receta en http://www.dit.upm.es/vnumlwiki/index.php/Fedora11</li><br />
<br />
<li> Instalar paquetes y librerías necesarias:</li><br />
yum install qemu-kvm libvirt virt-manager virt-viewer perl-XML-LibXML perl-Sys-Virt<br />
yum -y install bridge-utils readline-devel perl-Module-Build screen expat-devel libpcap-devel <br />
yum -y install perl-Net-Pcap perl-NetAddr-IP perl-Net-IPv6Addr perl-XML-DOM perl-Exception-Class<br />
yum -y install perl-TermReadKey perl-Error perl-CPAN uml_utilities xterm tunctl<br />
<br />
<li>Install XML::Checker perl library:</li><br />
perl -MCPAN -e shell<br />
install XML::Checker<br />
--><br />
<li>Add symbolic link for kvm:</li><br />
ln -s /usr/bin/qemu-kvm /usr/bin/kvm<br />
<br />
<li>Install VNX:</li><br />
mkdir /tmp/vnx-update<br />
cd /tmp/vnx-update<br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-latest.tgz<br />
tar xfvz vnx-latest.tgz<br />
cd vnx-*<br />
./install_vnx<br />
<br />
<li>Create the VNX config file (/etc/vnx.conf). You just can move the sample config file:</li><br />
mv /etc/vnx.conf.samble /etc/vnx.conf<br />
<br />
<li>Disable host firewall or, alternatively, configure "tun" type network interfaces as trusted interfaces (System->Firewall->Trusted Interfaces).</li><br />
<br />
<li>Download root file systems from http://idefix.dit.upm.es/download/vnx/filesystems and copy them to /usr/share/vnx/filesystems directory:</li><br />
cd /usr/share/vnx/filesystems<br />
<br />
# ubuntu server<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.10-v01.qcow2.bz2<br />
bunzip2 root_fs_ubuntu-10.10-v01.qcow2.bz2<br />
ln -s root_fs_ubuntu-10.10-v01.qcow2 root_fs_ubuntu<br />
<br />
# ubuntu with gui<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.10-gui-v01.qcow2.bz2<br />
bunzip2 root_fs_ubuntu-10.10-gui-v01.qcow2.bz2<br />
ln -s root_fs_ubuntu-10.10-gui-v01.qcow2 root_fs_ubuntu-gui<br />
<br />
# freebsd server<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-8.1-v01.qcow2.bz2<br />
bunzip2 root_fs_freebsd-8.1-v01.qcow2.bz2<br />
ln -s root_fs_freebsd-8.1-v01.qcow2 root_fs_freebsd<br />
<br />
# freebsd gui<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-8.1-gui-v01.qcow2.bz2<br />
bunzip2 root_fs_freebsd-8.1-gui-v01.qcow2.bz2<br />
ln -s root_fs_freebsd-8.1-gui-v01.qcow2 root_fs_freebsd-gui<br />
<br />
# winxp and win7<br />
# Sorry! Unfortunately for legal reasons we cannot distribute windows XP<br />
# or Windows 7 root filesystems. See VNX documentation for detailed recipes<br />
# to create these root fylesystems from scratch<br />
<br />
</ul><br />
<br />
=== Additional install steps for Dynamips support ===<br />
<br />
* Install Dynamips and Dynagen:<br />
wget http://downloads.sourceforge.net/project/dyna-gen/dynamips%20Linux%20RPM/0.2.8-RC2/dynamips-0.2.8RC2-1.i386.rpm<br />
rpm -i dynamips-0.2.8RC2-1.i386.rpm<br />
wget http://downloads.sourceforge.net/project/dyna-gen/dynagen%20source%20_%20Linux/dynagen%200.11.0/dynagen-0.11.0-1.fc9.noarch.rpm<br />
rpm -i dynagen-0.11.0-1.fc9.noarch.rpm<br />
<br />
* Set execution permissions for the script and add it to system start-up:<br />
chkconfig --add dynamips<br />
/etc/init.d/dynamips start<br />
<br />
* Download and install cisco IOS image:<br />
cd /usr/share/vnx/filesystems<br />
# Cisco image<br />
wget ... c3640-js-mz.124-19.image<br />
ln -s c3640-js-mz.124-19.image c3640<br />
<br />
* Calculate the idle-pc value for your computer following the procedure in http://dynagen.org/tutorial.htm:<br />
dynagen /usr/share/vnx/examples/R.net<br />
console R # type 'no' to exit the config wizard and wait <br />
# for the router to completely start <br />
idle-pc get R<br />
Once you know the idle-pc value for your system, include it in /etc/vnx.conf file.<br />
<br />
=== Additional install steps for Olive support ===<br />
<br />
Several additional steps are needed to support Olive (Juniper) routers in VNX scenarios:<br />
<br />
<ul><br />
<br />
<li>Download old qemu bios from 0.10.6 version and copy it to /usr/share/qemu directory:</li><br />
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.10.6/qemu-kvm-0.10.6.tar.gz<br />
tar xfvz qemu-kvm-0.10.6.tar.gz<br />
cp qemu-kvm-0.10.6/pc-bios/bios.bin /usr/share/qemu/bios-0.10.6.bin<br />
<br />
</ul><br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<!-- COSAS ANTIGUAS --><br />
<br />
<!--li>Modificar vnumlparser.pl, sustituyendo en la función mode_t la línea en ):</li><br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
<br />
por:<br />
<br />
if (! -e "/dev/net/tun") {<br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
}<br />
<br />
Explicación: el módulo tun se ha integrado en el kernel a partir de la 10.04, por lo que no es necesario cargarlo como hasta ahora mediante "modprobe tun". El cambio anterior simplemente comprueba si existe el dispositivo /dev/net/tun y carga el modulo en caso de que no exista.<br />
--><br />
<br />
<br />
<!--li>Modificar vnumlparser.pl, sustituyendo en la función mode_t la línea en ):</li><br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
<br />
por:<br />
<br />
if (! -e "/dev/net/tun") {<br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
}<br />
<br />
Explicación: el módulo tun se ha integrado en el kernel a partir de la 10.04, por lo que no es necesario cargarlo como hasta ahora mediante "modprobe tun". El cambio anterior simplemente comprueba si existe el dispositivo /dev/net/tun y carga el modulo en caso de que no exista.<br />
--><br />
<br />
<!--<br />
Pasos a seguir para instalar VNX sobre Ubuntu 9.10. <br />
<br />
'''Nota importante''': se han detectado importantes problemas de prestaciones cuando se utiliza el sistema de ficheros ext4 con Ubuntu 9.10. Por ello, y hasta que se localice el origen de dichas ineficiencias, se recomienda utilizar ext3. <br />
<ul><br />
<br />
<li> Instalar Ubuntu 9.10 y actualizar con:</li><br />
apt-get update; apt-get dist-upgrade<br />
--><br />
<!--<br />
<li>Añadir repositorios VNUML a /etc/apt/sources.lst:</li><br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian binary/" >> /etc/apt/sources.list<br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian-testing binary/" >> /etc/apt/sources.list<br />
--><br />
<!--<br />
<li>Install paquetes básicos de desarrollo, paquetes de virtualización (qemu-kvm, libvirt, vnuml) y librerías y paquetes auxiliares</li><br />
apt-get update<br />
apt-get install build-essential qemu-kvm libvirt-bin libvirt-dev \<br />
virt-manager virt-viewer vlan xterm bridge-utils screen uml-utilities \<br />
libxml-checker-perl libxml-parser-perl libnetaddr-ip-perl libnet-pcap-perl \<br />
libnet-ipv6addr-perl liberror-perl libexception-class-perl libxml-libxml-perl \<br />
libxml2-dev libgnutls-dev libdevmapper-dev libterm-readline-perl-perl <br />
<br />
<br />
<br />
curl vnuml linux-um <br />
<br />
<li>Si se usa la versión de Ubuntu de 64 bits hay que instalar las librerías de compatibilidad de 32 bits:</li><br />
apt-get install ia32-libs<br />
<br />
<li>Install qemu-kvm version 0.12.4 (version 0.11 which comes as apackage in 9.10 provokes hanging problems in Windows virtual machines when executing commands -something relates apparently with mounting cdroms in vms-):</li><br />
wget http://sourceforge.net/projects/kvm/files/qemu-kvm/0.11.1/qemu-kvm-0.11.1.tar.gz/download<br />
tar xfvz qemu-kvm-0.11.1.tar.gz<br />
cd qemu-kvm-0.11.1<br />
./configure --prefix=/usr && make && make install<br />
ln -s /usr/bin/qemu-system-x86_64 /usr/bin/kvm<br />
Editar /etc/modules y añadir:<br />
kvm <br />
kvm_intel<br />
<br />
wget http://sourceforge.net/projects/kvm/files/kvm-kmod/2.6.31.6b/kvm-kmod-2.6.31.6b.tar.bz2/download<br />
<br />
<li>Instalar libvirt 0.8.0:</li><br />
/etc/init.d/libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.8.0.tar.gz<br />
tar xfvz libvirt-0.8.0.tar.gz<br />
cd libvirt-0.8.0<br />
./configure --prefix=/usr && make && make install<br />
/etc/init.d/libvirt-bin start<br />
<br />
<li> Instalar la librería perl de acceso a libvirt (Sys::Virt) desde CPAN (dicha librería no esta disponible como paquete para Ubuntu 9.10):</li><br />
--><br />
<!-- wget http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.2.2.tar.gz<br />
tar xfvz Sys-Virt-0.2.2.tar.gz <br />
cd Sys-Virt-0.2.2<br />
perl Makefile.PL<br />
make install<br />
--><br />
<!--<br />
perl -MCPAN -e "CPAN::Shell->force(qw(install Sys::Virt));"<br />
Nota: constestar YES a la pregunta "Would you like me to configure as much as posible automatically?" y a "Is it OK to try to connect to the Internet?" <br />
<br />
<li>Instalar rootfilesystem de VNUML, enlaces del kernel y crear clave rsa:</li><br />
cd /usr/share/vnuml/filesystems<br />
wget http://www.dit.upm.es/vnuml/download/scripts/root-fs-installer<br />
perl root-fs-installer<br />
cd ../kernels<br />
ln -s linux-2.6.28.10-1m linux<br />
ssh-keygen -t rsa1<br />
<br />
<li>Instalar VNX:</li><br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-0.12b.tgz<br />
tar xfvz vnx-0.12b.tgz<br />
cd vnx-0.12b<br />
./install-vnx<br />
</ul><br />
<br />
Notas:<br />
http://www.ubuntu-es.org/node/128867<br />
175 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-headers-2.6.32-02063209_2.6.32-02063209_all.deb<br />
176 http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-image-2.6.32-02063209-generic_2.6.32-02063209_amd64.deb<br />
177 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-image-2.6.32-02063209-generic_2.6.32-02063209_amd64.deb<br />
178 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-headers-2.6.32-02063209-generic_2.6.32-02063209_amd64.deb<br />
--><br />
<br />
<!--<br />
=== Sobre Ubuntu 8.04 ===<br />
<br />
Pasos a seguir para instalar VNX sobre Ubuntu 8.04:<br />
<ul><br />
<br />
<li> Instalar Ubuntu 8.04 y actualizar con:</li><br />
apt-get update; apt-get dist-upgrade<br />
Rearrancar la máquina en caso de que se actualice la versión del kernel.<br />
<br />
<li> Añadir repositorio VNUML a /etc/apt/sources.lst:</li><br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian binary/" >> /etc/apt/sources.list<br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian-testing binary/" >> /etc/apt/sources.list<br />
<br />
<li> Instalar paquetes:</li><br />
apt-get update <br />
apt-get install virt-manager virt-viewer build-essential \<br />
libxml-libxml-perl vncviewer vlan xterm bridge-utils screen \<br />
curl vnuml linux-um libterm-readline-perl-perl zlib-bin zlib1g-dev \<br />
libxen3-dev libxml2-dev libgnutls-dev libsasl2-dev libsdl1.2-dev \<br />
libdevmapper-dev dnsmasq xbase-clients pkg-config<br />
<br />
<li>Si se usa la versión de Ubuntu de 64 bits hay que instalar las librerías de compatibilidad de 32 bits:</li><br />
apt-get install ia32-libs<br />
<br />
<li>Instalar qemu-kvm version 0.11.1 (la version 0.12.2 da errores):</li><br />
wget http://sourceforge.net/projects/kvm/files/qemu-kvm/0.11.1/qemu-kvm-0.11.1.tar.gz/download<br />
tar xfvz qemu-kvm-0.11.1.tar.gz<br />
cd qemu-kvm-0.11.1<br />
./configure --prefix=/usr && make && make install<br />
ln -s /usr/bin/qemu-system-x86_64 /usr/bin/kvm<br />
Editar /etc/modules y añadir:<br />
kvm <br />
kvm_intel<br />
<br />
<li>Instalar libvirt 0.7.6:</li><br />
apt-get install libvirt-bin<br />
/etc/init.d/libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.7.6.tar.gz<br />
tar xfvz libvirt-0.7.6.tar.gz<br />
cd libvirt-0.7.6<br />
./configure --prefix=/usr --without-storage-disk && make && make install<br />
/etc/init.d/libvirt-bin start<br />
<br />
<li>Instalar librería perl de acceso a libvirt (Sys::Virt) mediante CPAN (no está disponible como paquete ubuntu)</li><br />
perl -MCPAN -e "CPAN::Shell->force(qw(install Sys::Virt));"<br />
Note: answer NO to the question "Are you ready for manual configuration?"<br />
<br />
<li>Instalar rootfilesystem de VNUML, enlaces del kernel y crear clave rsa:</li><br />
cd /usr/share/vnuml/filesystems<br />
wget http://www.dit.upm.es/vnuml/download/scripts/root-fs-installer<br />
perl root-fs-installer<br />
cd ../kernels<br />
ln -s linux-2.6.28.10-1m linux<br />
ssh-keygen -t rsa1<br />
<br />
<li>Instalar VNX:</li><br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-0.12b.tgz<br />
tar xfvz vnx-0.12b.tgz<br />
cd vnx-0.12b<br />
./install-vnx<br />
</ul><br />
--></div>Davidhttps://web.dit.upm.es/vnumlwiki/index.php?title=Vnx-install&diff=4132Vnx-install2011-05-10T09:47:46Z<p>David: /* Installation over Ubuntu 10.04/9.10 */</p>
<hr />
<div>{{Title|VNX (Virtual Networks over X virtualization) v0.14 beta}}<br />
<br />
== Installation over Ubuntu 10.04/9.10 ==<br />
<br />
This section describes the procedure for installing VNX over Ubuntu 10.04 or 9.10. Open a root shell window and follow these steps:<br />
<ul><br />
<br />
<li>Install all packages required (basic development, virtualization, perl libraries and auxiliar packages):</li><br />
apt-get update<br />
apt-get install build-essential qemu-kvm libvirt-bin vlan xterm \<br />
bridge-utils screen virt-manager virt-viewer libxml-checker-perl \<br />
libxml-parser-perl libnetaddr-ip-perl libnet-pcap-perl \<br />
libnet-ipv6addr-perl liberror-perl libexception-class-perl \<br />
uml-utilities libxml-libxml-perl libxml2-dev libgnutls-dev \<br />
libdevmapper-dev libterm-readline-perl-perl libnet-telnet-perl \<br />
libnet-ip-perl libreadonly-perl libmath-round-perl libappconfig-perl \<br />
libdbi-perl graphviz libnl-dev genisoimage gnome-terminal libfile-homedir-perl<br />
<br />
<!--Note: for Ubuntu 9.04 change "qemu-kvm" package by "qemu kvm" --><br />
<li>If you use 64 bits version of Ubuntu, install 32 bits compatibility libraries:</li><br />
apt-get install ia32-libs<br />
<br />
<li>Install libvirt 0.8.5:</li><br />
/etc/init.d/libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.8.5.tar.gz<br />
tar xfvz libvirt-0.8.5.tar.gz<br />
cd libvirt-0.8.5<br />
./configure --without-xen --prefix=/usr && make && make install<br />
/etc/init.d/libvirt-bin start<br />
<br />
'''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.<br />
<br />
<li>Install Sys::Virt perl module:</li><br />
<ul><br />
<li>For Ubuntu 10.04, just install the libsys-virt-perl package</li><br />
apt-get install libsys-virt-perl<br />
<!--<br />
'''IMPORTANT NOTE''': Windows XP virtual machines started with VNX over Ubuntu 9.10 frequently hang when executing commands or with high traffic loads. The problem could be related with virtual network drivers. We are investigating the problem to find a solution. By now, Ubuntu 10.04 is the recomended platform to test VNX.<br />
--><br />
<li>For Ubuntu 9.10, as Sys::Virt library is not available as a package, install it manually:</li><br />
wget http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.2.3.tar.gz<br />
tar xfvz Sys-Virt-0.2.3.tar.gz <br />
cd Sys-Virt-0.2.3<br />
perl Makefile.PL<br />
make install<br />
</ul><br />
<br />
<li>Install VNX:</li><br />
mkdir /tmp/vnx-update<br />
cd /tmp/vnx-update<br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-latest.tgz<br />
tar xfvz vnx-latest.tgz<br />
cd vnx-*<br />
./install_vnx<br />
<br />
<li>Create the VNX config file (/etc/vnx.conf). You just can move the sample config file:</li><br />
mv /etc/vnx.conf.sample /etc/vnx.conf<br />
<br />
<li>Download root file systems from http://idefix.dit.upm.es/download/vnx/filesystems and copy them to /usr/share/vnx/filesystems directory:</li><br />
cd /usr/share/vnx/filesystems<br />
<br />
# ubuntu server<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.10-v02.qcow2.bz2<br />
bunzip2 root_fs_ubuntu-10.10-v02.qcow2.bz2<br />
ln -s root_fs_ubuntu-10.10-v02.qcow2 root_fs_ubuntu<br />
<br />
# ubuntu with gui<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.10-gui-v01.qcow2.bz2<br />
bunzip2 root_fs_ubuntu-10.10-gui-v01.qcow2.bz2<br />
ln -s root_fs_ubuntu-10.10-gui-v01.qcow2 root_fs_ubuntu-gui<br />
<br />
# freebsd server<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-8.1-v01.qcow2.bz2<br />
bunzip2 root_fs_freebsd-8.1-v01.qcow2.bz2<br />
ln -s root_fs_freebsd-8.1-v01.qcow2 root_fs_freebsd<br />
<br />
# freebsd gui<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-8.1-gui-v01.qcow2.bz2<br />
bunzip2 root_fs_freebsd-8.1-gui-v01.qcow2.bz2<br />
ln -s root_fs_freebsd-8.1-gui-v01.qcow2 root_fs_freebsd-gui<br />
<br />
# winxp and win7<br />
# Sorry! Unfortunately for legal reasons we cannot distribute windows XP<br />
# or Windows 7 root filesystems. See VNX documentation for detailed recipes<br />
# to create these root fylesystems from scratch<br />
<br />
<li>Additionally, if you plan to use VNUML root filesystem:</li><br />
# VNUML root_fs_tutorial and kernel<br />
cd /usr/share/vnx/filesystems<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_tutorial-0.6.0.bz2<br />
bunzip2 root_fs_tutorial-0.6.0.bz2<br />
ln -s root_fs_tutorial-0.6.0 root_fs_tutorial<br />
cd /usr/share/vnx/kernels<br />
wget -N http://jungla.dit.upm.es/~vnx/download/kernels/linux-2.6.18.1-bb2-xt-4m<br />
chmod +x linux-2.6.18.1-bb2-xt-4m<br />
ln -s linux-2.6.18.1-bb2-xt-4m linux<br />
<br />
</ul><br />
<br />
'''NOTE for Ubuntu 10.04.1''': It seems that an additional package has to be installed:<br />
apt-get install kvm-pxe<br />
<br />
'''NOTE for Ubuntu 10.10''': It seems that the default way of naming VLAN has changed. In Ubuntu 10.10, when creating a VLAN subinterface the interface name assigned is vlanXXX (for example, with "/sbin/vconfig add eth1 701", the interface created in vlan701). However, VNX is written to work with names of type vlan1.701. To change the naming you have to issue the following command:<br />
/sbin/vconfig set_name_type DEV_PLUS_VID_NO_PAD<br />
<br />
=== Additional install steps for Dynamips support ===<br />
<br />
* Install Dynamips and Dynagen:<br />
apt-get install dynamips dynagen<br />
<br />
* Create a file /etc/init.d/dynamips (taken from http://7200emu.hacki.at/viewtopic.php?t=2198):<br />
<pre><br />
#!/bin/sh<br />
# Start/stop the dynamips program as a daemon.<br />
#<br />
### BEGIN INIT INFO<br />
# Provides: dynamips<br />
# Default-Start: 2 3 4 5<br />
# Default-Stop: 0 1 6<br />
# Short-Description: Cisco hardware emulator daemon<br />
### END INIT INFO<br />
<br />
DAEMON=/usr/bin/dynamips<br />
NAME=dynamips<br />
PORT=7200<br />
PIDFILE=/var/run/$NAME.pid <br />
LOGFILE=/var/log/$NAME.log<br />
DESC="Cisco Emulator"<br />
SCRIPTNAME=/etc/init.d/$NAME<br />
<br />
test -f $DAEMON || exit 0<br />
<br />
. /lib/lsb/init-functions<br />
<br />
<br />
case "$1" in<br />
start) log_daemon_msg "Starting $DESC " "$NAME"<br />
start-stop-daemon --start --chdir /tmp --background --make-pidfile --pidfile $PIDFILE --name $NAME --startas $DAEMON -- -H $PORT -l $LOGFILE<br />
log_end_msg $?<br />
;;<br />
stop) log_daemon_msg "Stopping $DESC " "$NAME"<br />
start-stop-daemon --stop --quiet --pidfile $PIDFILE --name $NAME<br />
log_end_msg $?<br />
;;<br />
restart) log_daemon_msg "Restarting $DESC " "$NAME"<br />
start-stop-daemon --stop --retry 5 --quiet --pidfile $PIDFILE --name $NAME<br />
start-stop-daemon --start --chdir /tmp --background --make-pidfile --pidfile $PIDFILE --name $NAME --startas $DAEMON -- -H $PORT -l $LOGFILE<br />
log_end_msg $?<br />
;;<br />
status)<br />
status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $? <br />
#status $NAME<br />
#RETVAL=$?<br />
;; <br />
*) log_action_msg "Usage: $SCRIPTNAME {start|stop|restart|status}"<br />
exit 2<br />
;;<br />
esac<br />
exit 0<br />
<br />
</pre><br />
<br />
* Set execution permissions for the script and add it to system start-up:<br />
chmod +x /etc/init.d/dynamips<br />
update-rc.d dynamips defaults<br />
/etc/init.d/dynamips start<br />
<br />
* Download and install cisco IOS image:<br />
cd /usr/share/vnx/filesystems<br />
# Cisco image<br />
wget ... c3640-js-mz.124-19.image<br />
ln -s c3640-js-mz.124-19.image c3640<br />
<br />
* Calculate the idle-pc value for your computer following the procedure in http://dynagen.org/tutorial.htm:<br />
dynagen /usr/share/vnx/examples/R.net<br />
console R # type 'no' to exit the config wizard and wait <br />
# for the router to completely start <br />
idle-pc get R<br />
Once you know the idle-pc value for your system, include it in /etc/vnx.conf file.<br />
<br />
=== Additional install steps for Olive support ===<br />
<br />
Several additional steps are needed to support Olive (Juniper) routers in VNX scenarios:<br />
<br />
<ul><br />
<br />
<!-- Ya no hace falta desde que se usa <qemu:commandline><br />
<br />
<li>Install a patched version of libvirt 0.8.5 with support to define the bios used by a virtual machine:</li><br />
<br />
<ul><br />
<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><br />
<pre><br />
diff -crB libvirt-0.8.5.orig/src/conf/domain_conf.c libvirt-0.8.5/src/conf/domain_conf.c<br />
*** libvirt-0.8.5.orig/src/conf/domain_conf.c 2010-11-22 11:38:08.000000000 +0100<br />
--- libvirt-0.8.5/src/conf/domain_conf.c 2010-11-22 11:47:41.000000000 +0100<br />
***************<br />
*** 4267,4272 ****<br />
--- 4267,4274 ----<br />
if (node)<br />
def->mem.hugepage_backed = 1;<br />
<br />
+ def->biosfile = virXPathString("string(./biosfile[1])", ctxt);<br />
+ <br />
/* Extract other memory tunables */<br />
if (virXPathULong("string(./memtune/hard_limit)", ctxt,<br />
&def->mem.hard_limit) < 0)<br />
diff -crB libvirt-0.8.5.orig/src/conf/domain_conf.h libvirt-0.8.5/src/conf/domain_conf.h<br />
*** libvirt-0.8.5.orig/src/conf/domain_conf.h 2010-11-22 11:38:08.000000000 +0100<br />
--- libvirt-0.8.5/src/conf/domain_conf.h 2010-11-22 11:40:18.000000000 +0100<br />
***************<br />
*** 885,890 ****<br />
--- 885,891 ----<br />
unsigned long min_guarantee;<br />
unsigned long swap_hard_limit;<br />
} mem;<br />
+ char *biosfile;<br />
unsigned short vcpus;<br />
unsigned short maxvcpus;<br />
int cpumasklen;<br />
diff -crB libvirt-0.8.5.orig/src/qemu/qemu_conf.c libvirt-0.8.5/src/qemu/qemu_conf.c<br />
*** libvirt-0.8.5.orig/src/qemu/qemu_conf.c 2010-11-22 11:38:08.000000000 +0100<br />
--- libvirt-0.8.5/src/qemu/qemu_conf.c 2010-11-22 11:41:05.000000000 +0100<br />
***************<br />
*** 3984,3989 ****<br />
--- 3984,3995 ----<br />
ADD_ARG_LIT(emulator);<br />
ADD_ARG_LIT("-S");<br />
<br />
+ if(def->biosfile)<br />
+ {<br />
+ ADD_ARG_LIT("-bios");<br />
+ ADD_ARG_LIT(def->biosfile);<br />
+ }<br />
+ <br />
/* This should *never* be NULL, since we always provide<br />
* a machine in the capabilities data for QEMU. So this<br />
* check is just here as a safety in case the unexpected<br />
</pre><br />
<br />
<li>Install libvirt 0.8.5 with that patch applied:</li><br />
service libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.8.5.tar.gz<br />
tar xfvz libvirt-0.8.5.tar.gz <br />
cd libvirt-0.8.5<br />
patch -p1 -i ../libvirt-0.8.5-biosfile.patch <br />
./configure --without-xen --prefix=/usr && make && make install<br />
service libvirt-bin start<br />
<br />
</ul><br />
--><br />
<li>Download old qemu bios from 0.10.6 version and copy it to /usr/share/qemu directory:</li><br />
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.10.6/qemu-kvm-0.10.6.tar.gz<br />
tar xfvz qemu-kvm-0.10.6.tar.gz<br />
cp qemu-kvm-0.10.6/pc-bios/bios.bin /usr/share/qemu-kvm/bios-0.10.6.bin<br />
<br />
<!-- Not needed, it seems to work without downloading this drivers<br />
<li>Download i82559 ROM from the latest qemu versions (Ubuntu 10.04 does not include that ROM in qemu-kvm package):</li><br />
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.12.5/qemu-kvm-0.12.5.tar.gz<br />
tar xfvz qemu-kvm-0.12.5.tar.gz<br />
cp qemu-kvm-0.12.5/pc-bios/pxe-i82559er.bin /usr/share/qemu-kvm/<br />
--><br />
</ul><br />
<br />
== Installation over Fedora 11 (Draft) ==<br />
<br />
Follow this steps to install VNX over Fedora 11:<br />
<ul><br />
<br />
<li>Install packages:</li><br />
yum -y groupinstall "Development Tools"<br />
yum install qemu-kvm libvirt virt-manager virt-viewer perl-XML-LibXML<br />
yum install perl-XML-DOM perl-NetAddr-IP perl-Readonly perl-TermReadKey<br />
yum install perl-Net-Pcap perl-Net-IPv6Addr perl-Net-Telnet perl-Error<br />
yum install perl-Exception-Class perl-ExtUtils-MakeMaker tunctl screen wget<br />
yum install libxml2-devel gnutls-devel device-mapper-devel uml_utilities <br />
yum install roxterm xterm graphviz perl-AppConfig<br />
<br />
<li>Install libvirt 0.8.5:</li><br />
/etc/init.d/libvirtd stop<br />
wget http://libvirt.org/sources/libvirt-0.8.5.tar.gz<br />
tar xfvz libvirt-0.8.5.tar.gz<br />
cd libvirt-0.8.5<br />
./configure --without-xen --prefix=/usr && make && make install<br />
/etc/init.d/libvirtd start<br />
<br />
<li>Install SysVirt manually:</li><br />
wget http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.2.4.tar.gz<br />
tar xfvz Sys-Virt-0.2.4.tar.gz<br />
cd Sys-Virt-0.2.4<br />
perl Makefile.PL<br />
make install<br />
<!--<br />
<li> Instalar VNUML sobre Fedora 11 siguiendo la receta en http://www.dit.upm.es/vnumlwiki/index.php/Fedora11</li><br />
<br />
<li> Instalar paquetes y librerías necesarias:</li><br />
yum install qemu-kvm libvirt virt-manager virt-viewer perl-XML-LibXML perl-Sys-Virt<br />
yum -y install bridge-utils readline-devel perl-Module-Build screen expat-devel libpcap-devel <br />
yum -y install perl-Net-Pcap perl-NetAddr-IP perl-Net-IPv6Addr perl-XML-DOM perl-Exception-Class<br />
yum -y install perl-TermReadKey perl-Error perl-CPAN uml_utilities xterm tunctl<br />
<br />
<li>Install XML::Checker perl library:</li><br />
perl -MCPAN -e shell<br />
install XML::Checker<br />
--><br />
<li>Add symbolic link for kvm:</li><br />
ln -s /usr/bin/qemu-kvm /usr/bin/kvm<br />
<br />
<li>Install VNX:</li><br />
mkdir /tmp/vnx-update<br />
cd /tmp/vnx-update<br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-latest.tgz<br />
tar xfvz vnx-latest.tgz<br />
cd vnx-*<br />
./install_vnx<br />
<br />
<li>Create the VNX config file (/etc/vnx.conf). You just can move the sample config file:</li><br />
mv /etc/vnx.conf.samble /etc/vnx.conf<br />
<br />
<li>Disable host firewall or, alternatively, configure "tun" type network interfaces as trusted interfaces (System->Firewall->Trusted Interfaces).</li><br />
<br />
<li>Download root file systems from http://idefix.dit.upm.es/download/vnx/filesystems and copy them to /usr/share/vnx/filesystems directory:</li><br />
cd /usr/share/vnx/filesystems<br />
<br />
# ubuntu server<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.10-v01.qcow2.bz2<br />
bunzip2 root_fs_ubuntu-10.10-v01.qcow2.bz2<br />
ln -s root_fs_ubuntu-10.10-v01.qcow2 root_fs_ubuntu<br />
<br />
# ubuntu with gui<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.10-gui-v01.qcow2.bz2<br />
bunzip2 root_fs_ubuntu-10.10-gui-v01.qcow2.bz2<br />
ln -s root_fs_ubuntu-10.10-gui-v01.qcow2 root_fs_ubuntu-gui<br />
<br />
# freebsd server<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-8.1-v01.qcow2.bz2<br />
bunzip2 root_fs_freebsd-8.1-v01.qcow2.bz2<br />
ln -s root_fs_freebsd-8.1-v01.qcow2 root_fs_freebsd<br />
<br />
# freebsd gui<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-8.1-gui-v01.qcow2.bz2<br />
bunzip2 root_fs_freebsd-8.1-gui-v01.qcow2.bz2<br />
ln -s root_fs_freebsd-8.1-gui-v01.qcow2 root_fs_freebsd-gui<br />
<br />
# winxp and win7<br />
# Sorry! Unfortunately for legal reasons we cannot distribute windows XP<br />
# or Windows 7 root filesystems. See VNX documentation for detailed recipes<br />
# to create these root fylesystems from scratch<br />
<br />
</ul><br />
<br />
=== Additional install steps for Dynamips support ===<br />
<br />
* Install Dynamips and Dynagen:<br />
wget http://downloads.sourceforge.net/project/dyna-gen/dynamips%20Linux%20RPM/0.2.8-RC2/dynamips-0.2.8RC2-1.i386.rpm<br />
rpm -i dynamips-0.2.8RC2-1.i386.rpm<br />
wget http://downloads.sourceforge.net/project/dyna-gen/dynagen%20source%20_%20Linux/dynagen%200.11.0/dynagen-0.11.0-1.fc9.noarch.rpm<br />
rpm -i dynagen-0.11.0-1.fc9.noarch.rpm<br />
<br />
* Set execution permissions for the script and add it to system start-up:<br />
chkconfig --add dynamips<br />
/etc/init.d/dynamips start<br />
<br />
* Download and install cisco IOS image:<br />
cd /usr/share/vnx/filesystems<br />
# Cisco image<br />
wget ... c3640-js-mz.124-19.image<br />
ln -s c3640-js-mz.124-19.image c3640<br />
<br />
* Calculate the idle-pc value for your computer following the procedure in http://dynagen.org/tutorial.htm:<br />
dynagen /usr/share/vnx/examples/R.net<br />
console R # type 'no' to exit the config wizard and wait <br />
# for the router to completely start <br />
idle-pc get R<br />
Once you know the idle-pc value for your system, include it in /etc/vnx.conf file.<br />
<br />
=== Additional install steps for Olive support ===<br />
<br />
Several additional steps are needed to support Olive (Juniper) routers in VNX scenarios:<br />
<br />
<ul><br />
<br />
<li>Download old qemu bios from 0.10.6 version and copy it to /usr/share/qemu directory:</li><br />
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.10.6/qemu-kvm-0.10.6.tar.gz<br />
tar xfvz qemu-kvm-0.10.6.tar.gz<br />
cp qemu-kvm-0.10.6/pc-bios/bios.bin /usr/share/qemu/bios-0.10.6.bin<br />
<br />
</ul><br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<!-- COSAS ANTIGUAS --><br />
<br />
<!--li>Modificar vnumlparser.pl, sustituyendo en la función mode_t la línea en ):</li><br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
<br />
por:<br />
<br />
if (! -e "/dev/net/tun") {<br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
}<br />
<br />
Explicación: el módulo tun se ha integrado en el kernel a partir de la 10.04, por lo que no es necesario cargarlo como hasta ahora mediante "modprobe tun". El cambio anterior simplemente comprueba si existe el dispositivo /dev/net/tun y carga el modulo en caso de que no exista.<br />
--><br />
<br />
<br />
<!--li>Modificar vnumlparser.pl, sustituyendo en la función mode_t la línea en ):</li><br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
<br />
por:<br />
<br />
if (! -e "/dev/net/tun") {<br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
}<br />
<br />
Explicación: el módulo tun se ha integrado en el kernel a partir de la 10.04, por lo que no es necesario cargarlo como hasta ahora mediante "modprobe tun". El cambio anterior simplemente comprueba si existe el dispositivo /dev/net/tun y carga el modulo en caso de que no exista.<br />
--><br />
<br />
<!--<br />
Pasos a seguir para instalar VNX sobre Ubuntu 9.10. <br />
<br />
'''Nota importante''': se han detectado importantes problemas de prestaciones cuando se utiliza el sistema de ficheros ext4 con Ubuntu 9.10. Por ello, y hasta que se localice el origen de dichas ineficiencias, se recomienda utilizar ext3. <br />
<ul><br />
<br />
<li> Instalar Ubuntu 9.10 y actualizar con:</li><br />
apt-get update; apt-get dist-upgrade<br />
--><br />
<!--<br />
<li>Añadir repositorios VNUML a /etc/apt/sources.lst:</li><br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian binary/" >> /etc/apt/sources.list<br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian-testing binary/" >> /etc/apt/sources.list<br />
--><br />
<!--<br />
<li>Install paquetes básicos de desarrollo, paquetes de virtualización (qemu-kvm, libvirt, vnuml) y librerías y paquetes auxiliares</li><br />
apt-get update<br />
apt-get install build-essential qemu-kvm libvirt-bin libvirt-dev \<br />
virt-manager virt-viewer vlan xterm bridge-utils screen uml-utilities \<br />
libxml-checker-perl libxml-parser-perl libnetaddr-ip-perl libnet-pcap-perl \<br />
libnet-ipv6addr-perl liberror-perl libexception-class-perl libxml-libxml-perl \<br />
libxml2-dev libgnutls-dev libdevmapper-dev libterm-readline-perl-perl <br />
<br />
<br />
<br />
curl vnuml linux-um <br />
<br />
<li>Si se usa la versión de Ubuntu de 64 bits hay que instalar las librerías de compatibilidad de 32 bits:</li><br />
apt-get install ia32-libs<br />
<br />
<li>Install qemu-kvm version 0.12.4 (version 0.11 which comes as apackage in 9.10 provokes hanging problems in Windows virtual machines when executing commands -something relates apparently with mounting cdroms in vms-):</li><br />
wget http://sourceforge.net/projects/kvm/files/qemu-kvm/0.11.1/qemu-kvm-0.11.1.tar.gz/download<br />
tar xfvz qemu-kvm-0.11.1.tar.gz<br />
cd qemu-kvm-0.11.1<br />
./configure --prefix=/usr && make && make install<br />
ln -s /usr/bin/qemu-system-x86_64 /usr/bin/kvm<br />
Editar /etc/modules y añadir:<br />
kvm <br />
kvm_intel<br />
<br />
wget http://sourceforge.net/projects/kvm/files/kvm-kmod/2.6.31.6b/kvm-kmod-2.6.31.6b.tar.bz2/download<br />
<br />
<li>Instalar libvirt 0.8.0:</li><br />
/etc/init.d/libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.8.0.tar.gz<br />
tar xfvz libvirt-0.8.0.tar.gz<br />
cd libvirt-0.8.0<br />
./configure --prefix=/usr && make && make install<br />
/etc/init.d/libvirt-bin start<br />
<br />
<li> Instalar la librería perl de acceso a libvirt (Sys::Virt) desde CPAN (dicha librería no esta disponible como paquete para Ubuntu 9.10):</li><br />
--><br />
<!-- wget http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.2.2.tar.gz<br />
tar xfvz Sys-Virt-0.2.2.tar.gz <br />
cd Sys-Virt-0.2.2<br />
perl Makefile.PL<br />
make install<br />
--><br />
<!--<br />
perl -MCPAN -e "CPAN::Shell->force(qw(install Sys::Virt));"<br />
Nota: constestar YES a la pregunta "Would you like me to configure as much as posible automatically?" y a "Is it OK to try to connect to the Internet?" <br />
<br />
<li>Instalar rootfilesystem de VNUML, enlaces del kernel y crear clave rsa:</li><br />
cd /usr/share/vnuml/filesystems<br />
wget http://www.dit.upm.es/vnuml/download/scripts/root-fs-installer<br />
perl root-fs-installer<br />
cd ../kernels<br />
ln -s linux-2.6.28.10-1m linux<br />
ssh-keygen -t rsa1<br />
<br />
<li>Instalar VNX:</li><br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-0.12b.tgz<br />
tar xfvz vnx-0.12b.tgz<br />
cd vnx-0.12b<br />
./install-vnx<br />
</ul><br />
<br />
Notas:<br />
http://www.ubuntu-es.org/node/128867<br />
175 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-headers-2.6.32-02063209_2.6.32-02063209_all.deb<br />
176 http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-image-2.6.32-02063209-generic_2.6.32-02063209_amd64.deb<br />
177 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-image-2.6.32-02063209-generic_2.6.32-02063209_amd64.deb<br />
178 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-headers-2.6.32-02063209-generic_2.6.32-02063209_amd64.deb<br />
--><br />
<br />
<!--<br />
=== Sobre Ubuntu 8.04 ===<br />
<br />
Pasos a seguir para instalar VNX sobre Ubuntu 8.04:<br />
<ul><br />
<br />
<li> Instalar Ubuntu 8.04 y actualizar con:</li><br />
apt-get update; apt-get dist-upgrade<br />
Rearrancar la máquina en caso de que se actualice la versión del kernel.<br />
<br />
<li> Añadir repositorio VNUML a /etc/apt/sources.lst:</li><br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian binary/" >> /etc/apt/sources.list<br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian-testing binary/" >> /etc/apt/sources.list<br />
<br />
<li> Instalar paquetes:</li><br />
apt-get update <br />
apt-get install virt-manager virt-viewer build-essential \<br />
libxml-libxml-perl vncviewer vlan xterm bridge-utils screen \<br />
curl vnuml linux-um libterm-readline-perl-perl zlib-bin zlib1g-dev \<br />
libxen3-dev libxml2-dev libgnutls-dev libsasl2-dev libsdl1.2-dev \<br />
libdevmapper-dev dnsmasq xbase-clients pkg-config<br />
<br />
<li>Si se usa la versión de Ubuntu de 64 bits hay que instalar las librerías de compatibilidad de 32 bits:</li><br />
apt-get install ia32-libs<br />
<br />
<li>Instalar qemu-kvm version 0.11.1 (la version 0.12.2 da errores):</li><br />
wget http://sourceforge.net/projects/kvm/files/qemu-kvm/0.11.1/qemu-kvm-0.11.1.tar.gz/download<br />
tar xfvz qemu-kvm-0.11.1.tar.gz<br />
cd qemu-kvm-0.11.1<br />
./configure --prefix=/usr && make && make install<br />
ln -s /usr/bin/qemu-system-x86_64 /usr/bin/kvm<br />
Editar /etc/modules y añadir:<br />
kvm <br />
kvm_intel<br />
<br />
<li>Instalar libvirt 0.7.6:</li><br />
apt-get install libvirt-bin<br />
/etc/init.d/libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.7.6.tar.gz<br />
tar xfvz libvirt-0.7.6.tar.gz<br />
cd libvirt-0.7.6<br />
./configure --prefix=/usr --without-storage-disk && make && make install<br />
/etc/init.d/libvirt-bin start<br />
<br />
<li>Instalar librería perl de acceso a libvirt (Sys::Virt) mediante CPAN (no está disponible como paquete ubuntu)</li><br />
perl -MCPAN -e "CPAN::Shell->force(qw(install Sys::Virt));"<br />
Note: answer NO to the question "Are you ready for manual configuration?"<br />
<br />
<li>Instalar rootfilesystem de VNUML, enlaces del kernel y crear clave rsa:</li><br />
cd /usr/share/vnuml/filesystems<br />
wget http://www.dit.upm.es/vnuml/download/scripts/root-fs-installer<br />
perl root-fs-installer<br />
cd ../kernels<br />
ln -s linux-2.6.28.10-1m linux<br />
ssh-keygen -t rsa1<br />
<br />
<li>Instalar VNX:</li><br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-0.12b.tgz<br />
tar xfvz vnx-0.12b.tgz<br />
cd vnx-0.12b<br />
./install-vnx<br />
</ul><br />
--></div>Davidhttps://web.dit.upm.es/vnumlwiki/index.php?title=Vnx-install&diff=4131Vnx-install2011-04-06T07:33:58Z<p>David: </p>
<hr />
<div>{{Title|VNX (Virtual Networks over X virtualization) v0.14 beta}}<br />
<br />
== Installation over Ubuntu 10.04/9.10 ==<br />
<br />
This section describes the procedure for installing VNX over Ubuntu 10.04 or 9.10. Open a root shell window and follow these steps:<br />
<ul><br />
<br />
<li>Install all packages required (basic development, virtualization, perl libraries and auxiliar packages):</li><br />
apt-get update<br />
apt-get install build-essential qemu-kvm libvirt-bin vlan xterm \<br />
bridge-utils screen virt-manager virt-viewer libxml-checker-perl \<br />
libxml-parser-perl libnetaddr-ip-perl libnet-pcap-perl \<br />
libnet-ipv6addr-perl liberror-perl libexception-class-perl \<br />
uml-utilities libxml-libxml-perl libxml2-dev libgnutls-dev \<br />
libdevmapper-dev libterm-readline-perl-perl libnet-telnet-perl \<br />
libnet-ip-perl libreadonly-perl libmath-round-perl libappconfig-perl \<br />
libdbi-perl graphviz libnl-dev genisoimage gnome-terminal libfile-homedir-perl<br />
<br />
<!--Note: for Ubuntu 9.04 change "qemu-kvm" package by "qemu kvm" --><br />
<li>If you use 64 bits version of Ubuntu, install 32 bits compatibility libraries:</li><br />
apt-get install ia32-libs<br />
<br />
<li>Install libvirt 0.8.5:</li><br />
/etc/init.d/libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.8.5.tar.gz<br />
tar xfvz libvirt-0.8.5.tar.gz<br />
cd libvirt-0.8.5<br />
./configure --without-xen --prefix=/usr && make && make install<br />
/etc/init.d/libvirt-bin start<br />
<br />
'''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.<br />
<br />
<li>Install Sys::Virt perl module:</li><br />
<ul><br />
<li>For Ubuntu 10.04, just install the libsys-virt-perl package</li><br />
apt-get install libsys-virt-perl<br />
<!--<br />
'''IMPORTANT NOTE''': Windows XP virtual machines started with VNX over Ubuntu 9.10 frequently hang when executing commands or with high traffic loads. The problem could be related with virtual network drivers. We are investigating the problem to find a solution. By now, Ubuntu 10.04 is the recomended platform to test VNX.<br />
--><br />
<li>For Ubuntu 9.10, as Sys::Virt library is not available as a package, install it manually:</li><br />
wget http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.2.3.tar.gz<br />
tar xfvz Sys-Virt-0.2.3.tar.gz <br />
cd Sys-Virt-0.2.3<br />
perl Makefile.PL<br />
make install<br />
</ul><br />
<br />
<li>Install VNX:</li><br />
mkdir /tmp/vnx-update<br />
cd /tmp/vnx-update<br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-latest.tgz<br />
tar xfvz vnx-latest.tgz<br />
cd vnx-*<br />
./install_vnx<br />
<br />
<li>Create the VNX config file (/etc/vnx.conf). You just can move the sample config file:</li><br />
mv /etc/vnx.conf.sample /etc/vnx.conf<br />
<br />
<li>Download root file systems from http://idefix.dit.upm.es/download/vnx/filesystems and copy them to /usr/share/vnx/filesystems directory:</li><br />
cd /usr/share/vnx/filesystems<br />
<br />
# ubuntu server<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.10-v02.qcow2.bz2<br />
bunzip2 root_fs_ubuntu-10.10-v02.qcow2.bz2<br />
ln -s root_fs_ubuntu-10.10-v02.qcow2 root_fs_ubuntu<br />
<br />
# ubuntu with gui<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.10-gui-v01.qcow2.bz2<br />
bunzip2 root_fs_ubuntu-10.10-gui-v01.qcow2.bz2<br />
ln -s root_fs_ubuntu-10.10-gui-v01.qcow2 root_fs_ubuntu-gui<br />
<br />
# freebsd server<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-8.1-v01.qcow2.bz2<br />
bunzip2 root_fs_freebsd-8.1-v01.qcow2.bz2<br />
ln -s root_fs_freebsd-8.1-v01.qcow2 root_fs_freebsd<br />
<br />
# freebsd gui<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-8.1-gui-v01.qcow2.bz2<br />
bunzip2 root_fs_freebsd-8.1-gui-v01.qcow2.bz2<br />
ln -s root_fs_freebsd-8.1-gui-v01.qcow2 root_fs_freebsd-gui<br />
<br />
# winxp and win7<br />
# Sorry! Unfortunately for legal reasons we cannot distribute windows XP<br />
# or Windows 7 root filesystems. See VNX documentation for detailed recipes<br />
# to create these root fylesystems from scratch<br />
<br />
<li>Additionally, if you plan to use VNUML root filesystem:</li><br />
# VNUML root_fs_tutorial and kernel<br />
cd /usr/share/vnx/filesystems<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_tutorial-0.6.0.bz2<br />
bunzip2 root_fs_tutorial-0.6.0.bz2<br />
ln -s root_fs_tutorial-0.6.0 root_fs_tutorial<br />
cd /usr/share/vnx/kernels<br />
wget -N http://jungla.dit.upm.es/~vnx/download/kernels/linux-2.6.18.1-bb2-xt-4m<br />
chmod +x linux-2.6.18.1-bb2-xt-4m<br />
ln -s linux-2.6.18.1-bb2-xt-4m linux<br />
<br />
</ul><br />
<br />
'''NOTE for Ubuntu 10.04.1''': It seems that an additional package has to be installed:<br />
apt-get install kvm-pxe<br />
<br />
=== Additional install steps for Dynamips support ===<br />
<br />
* Install Dynamips and Dynagen:<br />
apt-get install dynamips dynagen<br />
<br />
* Create a file /etc/init.d/dynamips (taken from http://7200emu.hacki.at/viewtopic.php?t=2198):<br />
<pre><br />
#!/bin/sh<br />
# Start/stop the dynamips program as a daemon.<br />
#<br />
### BEGIN INIT INFO<br />
# Provides: dynamips<br />
# Default-Start: 2 3 4 5<br />
# Default-Stop: 0 1 6<br />
# Short-Description: Cisco hardware emulator daemon<br />
### END INIT INFO<br />
<br />
DAEMON=/usr/bin/dynamips<br />
NAME=dynamips<br />
PORT=7200<br />
PIDFILE=/var/run/$NAME.pid <br />
LOGFILE=/var/log/$NAME.log<br />
DESC="Cisco Emulator"<br />
SCRIPTNAME=/etc/init.d/$NAME<br />
<br />
test -f $DAEMON || exit 0<br />
<br />
. /lib/lsb/init-functions<br />
<br />
<br />
case "$1" in<br />
start) log_daemon_msg "Starting $DESC " "$NAME"<br />
start-stop-daemon --start --chdir /tmp --background --make-pidfile --pidfile $PIDFILE --name $NAME --startas $DAEMON -- -H $PORT -l $LOGFILE<br />
log_end_msg $?<br />
;;<br />
stop) log_daemon_msg "Stopping $DESC " "$NAME"<br />
start-stop-daemon --stop --quiet --pidfile $PIDFILE --name $NAME<br />
log_end_msg $?<br />
;;<br />
restart) log_daemon_msg "Restarting $DESC " "$NAME"<br />
start-stop-daemon --stop --retry 5 --quiet --pidfile $PIDFILE --name $NAME<br />
start-stop-daemon --start --chdir /tmp --background --make-pidfile --pidfile $PIDFILE --name $NAME --startas $DAEMON -- -H $PORT -l $LOGFILE<br />
log_end_msg $?<br />
;;<br />
status)<br />
status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $? <br />
#status $NAME<br />
#RETVAL=$?<br />
;; <br />
*) log_action_msg "Usage: $SCRIPTNAME {start|stop|restart|status}"<br />
exit 2<br />
;;<br />
esac<br />
exit 0<br />
<br />
</pre><br />
<br />
* Set execution permissions for the script and add it to system start-up:<br />
chmod +x /etc/init.d/dynamips<br />
update-rc.d dynamips defaults<br />
/etc/init.d/dynamips start<br />
<br />
* Download and install cisco IOS image:<br />
cd /usr/share/vnx/filesystems<br />
# Cisco image<br />
wget ... c3640-js-mz.124-19.image<br />
ln -s c3640-js-mz.124-19.image c3640<br />
<br />
* Calculate the idle-pc value for your computer following the procedure in http://dynagen.org/tutorial.htm:<br />
dynagen /usr/share/vnx/examples/R.net<br />
console R # type 'no' to exit the config wizard and wait <br />
# for the router to completely start <br />
idle-pc get R<br />
Once you know the idle-pc value for your system, include it in /etc/vnx.conf file.<br />
<br />
=== Additional install steps for Olive support ===<br />
<br />
Several additional steps are needed to support Olive (Juniper) routers in VNX scenarios:<br />
<br />
<ul><br />
<br />
<!-- Ya no hace falta desde que se usa <qemu:commandline><br />
<br />
<li>Install a patched version of libvirt 0.8.5 with support to define the bios used by a virtual machine:</li><br />
<br />
<ul><br />
<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><br />
<pre><br />
diff -crB libvirt-0.8.5.orig/src/conf/domain_conf.c libvirt-0.8.5/src/conf/domain_conf.c<br />
*** libvirt-0.8.5.orig/src/conf/domain_conf.c 2010-11-22 11:38:08.000000000 +0100<br />
--- libvirt-0.8.5/src/conf/domain_conf.c 2010-11-22 11:47:41.000000000 +0100<br />
***************<br />
*** 4267,4272 ****<br />
--- 4267,4274 ----<br />
if (node)<br />
def->mem.hugepage_backed = 1;<br />
<br />
+ def->biosfile = virXPathString("string(./biosfile[1])", ctxt);<br />
+ <br />
/* Extract other memory tunables */<br />
if (virXPathULong("string(./memtune/hard_limit)", ctxt,<br />
&def->mem.hard_limit) < 0)<br />
diff -crB libvirt-0.8.5.orig/src/conf/domain_conf.h libvirt-0.8.5/src/conf/domain_conf.h<br />
*** libvirt-0.8.5.orig/src/conf/domain_conf.h 2010-11-22 11:38:08.000000000 +0100<br />
--- libvirt-0.8.5/src/conf/domain_conf.h 2010-11-22 11:40:18.000000000 +0100<br />
***************<br />
*** 885,890 ****<br />
--- 885,891 ----<br />
unsigned long min_guarantee;<br />
unsigned long swap_hard_limit;<br />
} mem;<br />
+ char *biosfile;<br />
unsigned short vcpus;<br />
unsigned short maxvcpus;<br />
int cpumasklen;<br />
diff -crB libvirt-0.8.5.orig/src/qemu/qemu_conf.c libvirt-0.8.5/src/qemu/qemu_conf.c<br />
*** libvirt-0.8.5.orig/src/qemu/qemu_conf.c 2010-11-22 11:38:08.000000000 +0100<br />
--- libvirt-0.8.5/src/qemu/qemu_conf.c 2010-11-22 11:41:05.000000000 +0100<br />
***************<br />
*** 3984,3989 ****<br />
--- 3984,3995 ----<br />
ADD_ARG_LIT(emulator);<br />
ADD_ARG_LIT("-S");<br />
<br />
+ if(def->biosfile)<br />
+ {<br />
+ ADD_ARG_LIT("-bios");<br />
+ ADD_ARG_LIT(def->biosfile);<br />
+ }<br />
+ <br />
/* This should *never* be NULL, since we always provide<br />
* a machine in the capabilities data for QEMU. So this<br />
* check is just here as a safety in case the unexpected<br />
</pre><br />
<br />
<li>Install libvirt 0.8.5 with that patch applied:</li><br />
service libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.8.5.tar.gz<br />
tar xfvz libvirt-0.8.5.tar.gz <br />
cd libvirt-0.8.5<br />
patch -p1 -i ../libvirt-0.8.5-biosfile.patch <br />
./configure --without-xen --prefix=/usr && make && make install<br />
service libvirt-bin start<br />
<br />
</ul><br />
--><br />
<li>Download old qemu bios from 0.10.6 version and copy it to /usr/share/qemu directory:</li><br />
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.10.6/qemu-kvm-0.10.6.tar.gz<br />
tar xfvz qemu-kvm-0.10.6.tar.gz<br />
cp qemu-kvm-0.10.6/pc-bios/bios.bin /usr/share/qemu-kvm/bios-0.10.6.bin<br />
<br />
<!-- Not needed, it seems to work without downloading this drivers<br />
<li>Download i82559 ROM from the latest qemu versions (Ubuntu 10.04 does not include that ROM in qemu-kvm package):</li><br />
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.12.5/qemu-kvm-0.12.5.tar.gz<br />
tar xfvz qemu-kvm-0.12.5.tar.gz<br />
cp qemu-kvm-0.12.5/pc-bios/pxe-i82559er.bin /usr/share/qemu-kvm/<br />
--><br />
</ul><br />
<br />
== Installation over Fedora 11 (Draft) ==<br />
<br />
Follow this steps to install VNX over Fedora 11:<br />
<ul><br />
<br />
<li>Install packages:</li><br />
yum -y groupinstall "Development Tools"<br />
yum install qemu-kvm libvirt virt-manager virt-viewer perl-XML-LibXML<br />
yum install perl-XML-DOM perl-NetAddr-IP perl-Readonly perl-TermReadKey<br />
yum install perl-Net-Pcap perl-Net-IPv6Addr perl-Net-Telnet perl-Error<br />
yum install perl-Exception-Class perl-ExtUtils-MakeMaker tunctl screen wget<br />
yum install libxml2-devel gnutls-devel device-mapper-devel uml_utilities <br />
yum install roxterm xterm graphviz perl-AppConfig<br />
<br />
<li>Install libvirt 0.8.5:</li><br />
/etc/init.d/libvirtd stop<br />
wget http://libvirt.org/sources/libvirt-0.8.5.tar.gz<br />
tar xfvz libvirt-0.8.5.tar.gz<br />
cd libvirt-0.8.5<br />
./configure --without-xen --prefix=/usr && make && make install<br />
/etc/init.d/libvirtd start<br />
<br />
<li>Install SysVirt manually:</li><br />
wget http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.2.4.tar.gz<br />
tar xfvz Sys-Virt-0.2.4.tar.gz<br />
cd Sys-Virt-0.2.4<br />
perl Makefile.PL<br />
make install<br />
<!--<br />
<li> Instalar VNUML sobre Fedora 11 siguiendo la receta en http://www.dit.upm.es/vnumlwiki/index.php/Fedora11</li><br />
<br />
<li> Instalar paquetes y librerías necesarias:</li><br />
yum install qemu-kvm libvirt virt-manager virt-viewer perl-XML-LibXML perl-Sys-Virt<br />
yum -y install bridge-utils readline-devel perl-Module-Build screen expat-devel libpcap-devel <br />
yum -y install perl-Net-Pcap perl-NetAddr-IP perl-Net-IPv6Addr perl-XML-DOM perl-Exception-Class<br />
yum -y install perl-TermReadKey perl-Error perl-CPAN uml_utilities xterm tunctl<br />
<br />
<li>Install XML::Checker perl library:</li><br />
perl -MCPAN -e shell<br />
install XML::Checker<br />
--><br />
<li>Add symbolic link for kvm:</li><br />
ln -s /usr/bin/qemu-kvm /usr/bin/kvm<br />
<br />
<li>Install VNX:</li><br />
mkdir /tmp/vnx-update<br />
cd /tmp/vnx-update<br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-latest.tgz<br />
tar xfvz vnx-latest.tgz<br />
cd vnx-*<br />
./install_vnx<br />
<br />
<li>Create the VNX config file (/etc/vnx.conf). You just can move the sample config file:</li><br />
mv /etc/vnx.conf.samble /etc/vnx.conf<br />
<br />
<li>Disable host firewall or, alternatively, configure "tun" type network interfaces as trusted interfaces (System->Firewall->Trusted Interfaces).</li><br />
<br />
<li>Download root file systems from http://idefix.dit.upm.es/download/vnx/filesystems and copy them to /usr/share/vnx/filesystems directory:</li><br />
cd /usr/share/vnx/filesystems<br />
<br />
# ubuntu server<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.10-v01.qcow2.bz2<br />
bunzip2 root_fs_ubuntu-10.10-v01.qcow2.bz2<br />
ln -s root_fs_ubuntu-10.10-v01.qcow2 root_fs_ubuntu<br />
<br />
# ubuntu with gui<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.10-gui-v01.qcow2.bz2<br />
bunzip2 root_fs_ubuntu-10.10-gui-v01.qcow2.bz2<br />
ln -s root_fs_ubuntu-10.10-gui-v01.qcow2 root_fs_ubuntu-gui<br />
<br />
# freebsd server<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-8.1-v01.qcow2.bz2<br />
bunzip2 root_fs_freebsd-8.1-v01.qcow2.bz2<br />
ln -s root_fs_freebsd-8.1-v01.qcow2 root_fs_freebsd<br />
<br />
# freebsd gui<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-8.1-gui-v01.qcow2.bz2<br />
bunzip2 root_fs_freebsd-8.1-gui-v01.qcow2.bz2<br />
ln -s root_fs_freebsd-8.1-gui-v01.qcow2 root_fs_freebsd-gui<br />
<br />
# winxp and win7<br />
# Sorry! Unfortunately for legal reasons we cannot distribute windows XP<br />
# or Windows 7 root filesystems. See VNX documentation for detailed recipes<br />
# to create these root fylesystems from scratch<br />
<br />
</ul><br />
<br />
=== Additional install steps for Dynamips support ===<br />
<br />
* Install Dynamips and Dynagen:<br />
wget http://downloads.sourceforge.net/project/dyna-gen/dynamips%20Linux%20RPM/0.2.8-RC2/dynamips-0.2.8RC2-1.i386.rpm<br />
rpm -i dynamips-0.2.8RC2-1.i386.rpm<br />
wget http://downloads.sourceforge.net/project/dyna-gen/dynagen%20source%20_%20Linux/dynagen%200.11.0/dynagen-0.11.0-1.fc9.noarch.rpm<br />
rpm -i dynagen-0.11.0-1.fc9.noarch.rpm<br />
<br />
* Set execution permissions for the script and add it to system start-up:<br />
chkconfig --add dynamips<br />
/etc/init.d/dynamips start<br />
<br />
* Download and install cisco IOS image:<br />
cd /usr/share/vnx/filesystems<br />
# Cisco image<br />
wget ... c3640-js-mz.124-19.image<br />
ln -s c3640-js-mz.124-19.image c3640<br />
<br />
* Calculate the idle-pc value for your computer following the procedure in http://dynagen.org/tutorial.htm:<br />
dynagen /usr/share/vnx/examples/R.net<br />
console R # type 'no' to exit the config wizard and wait <br />
# for the router to completely start <br />
idle-pc get R<br />
Once you know the idle-pc value for your system, include it in /etc/vnx.conf file.<br />
<br />
=== Additional install steps for Olive support ===<br />
<br />
Several additional steps are needed to support Olive (Juniper) routers in VNX scenarios:<br />
<br />
<ul><br />
<br />
<li>Download old qemu bios from 0.10.6 version and copy it to /usr/share/qemu directory:</li><br />
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.10.6/qemu-kvm-0.10.6.tar.gz<br />
tar xfvz qemu-kvm-0.10.6.tar.gz<br />
cp qemu-kvm-0.10.6/pc-bios/bios.bin /usr/share/qemu/bios-0.10.6.bin<br />
<br />
</ul><br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<!-- COSAS ANTIGUAS --><br />
<br />
<!--li>Modificar vnumlparser.pl, sustituyendo en la función mode_t la línea en ):</li><br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
<br />
por:<br />
<br />
if (! -e "/dev/net/tun") {<br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
}<br />
<br />
Explicación: el módulo tun se ha integrado en el kernel a partir de la 10.04, por lo que no es necesario cargarlo como hasta ahora mediante "modprobe tun". El cambio anterior simplemente comprueba si existe el dispositivo /dev/net/tun y carga el modulo en caso de que no exista.<br />
--><br />
<br />
<br />
<!--li>Modificar vnumlparser.pl, sustituyendo en la función mode_t la línea en ):</li><br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
<br />
por:<br />
<br />
if (! -e "/dev/net/tun") {<br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
}<br />
<br />
Explicación: el módulo tun se ha integrado en el kernel a partir de la 10.04, por lo que no es necesario cargarlo como hasta ahora mediante "modprobe tun". El cambio anterior simplemente comprueba si existe el dispositivo /dev/net/tun y carga el modulo en caso de que no exista.<br />
--><br />
<br />
<!--<br />
Pasos a seguir para instalar VNX sobre Ubuntu 9.10. <br />
<br />
'''Nota importante''': se han detectado importantes problemas de prestaciones cuando se utiliza el sistema de ficheros ext4 con Ubuntu 9.10. Por ello, y hasta que se localice el origen de dichas ineficiencias, se recomienda utilizar ext3. <br />
<ul><br />
<br />
<li> Instalar Ubuntu 9.10 y actualizar con:</li><br />
apt-get update; apt-get dist-upgrade<br />
--><br />
<!--<br />
<li>Añadir repositorios VNUML a /etc/apt/sources.lst:</li><br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian binary/" >> /etc/apt/sources.list<br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian-testing binary/" >> /etc/apt/sources.list<br />
--><br />
<!--<br />
<li>Install paquetes básicos de desarrollo, paquetes de virtualización (qemu-kvm, libvirt, vnuml) y librerías y paquetes auxiliares</li><br />
apt-get update<br />
apt-get install build-essential qemu-kvm libvirt-bin libvirt-dev \<br />
virt-manager virt-viewer vlan xterm bridge-utils screen uml-utilities \<br />
libxml-checker-perl libxml-parser-perl libnetaddr-ip-perl libnet-pcap-perl \<br />
libnet-ipv6addr-perl liberror-perl libexception-class-perl libxml-libxml-perl \<br />
libxml2-dev libgnutls-dev libdevmapper-dev libterm-readline-perl-perl <br />
<br />
<br />
<br />
curl vnuml linux-um <br />
<br />
<li>Si se usa la versión de Ubuntu de 64 bits hay que instalar las librerías de compatibilidad de 32 bits:</li><br />
apt-get install ia32-libs<br />
<br />
<li>Install qemu-kvm version 0.12.4 (version 0.11 which comes as apackage in 9.10 provokes hanging problems in Windows virtual machines when executing commands -something relates apparently with mounting cdroms in vms-):</li><br />
wget http://sourceforge.net/projects/kvm/files/qemu-kvm/0.11.1/qemu-kvm-0.11.1.tar.gz/download<br />
tar xfvz qemu-kvm-0.11.1.tar.gz<br />
cd qemu-kvm-0.11.1<br />
./configure --prefix=/usr && make && make install<br />
ln -s /usr/bin/qemu-system-x86_64 /usr/bin/kvm<br />
Editar /etc/modules y añadir:<br />
kvm <br />
kvm_intel<br />
<br />
wget http://sourceforge.net/projects/kvm/files/kvm-kmod/2.6.31.6b/kvm-kmod-2.6.31.6b.tar.bz2/download<br />
<br />
<li>Instalar libvirt 0.8.0:</li><br />
/etc/init.d/libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.8.0.tar.gz<br />
tar xfvz libvirt-0.8.0.tar.gz<br />
cd libvirt-0.8.0<br />
./configure --prefix=/usr && make && make install<br />
/etc/init.d/libvirt-bin start<br />
<br />
<li> Instalar la librería perl de acceso a libvirt (Sys::Virt) desde CPAN (dicha librería no esta disponible como paquete para Ubuntu 9.10):</li><br />
--><br />
<!-- wget http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.2.2.tar.gz<br />
tar xfvz Sys-Virt-0.2.2.tar.gz <br />
cd Sys-Virt-0.2.2<br />
perl Makefile.PL<br />
make install<br />
--><br />
<!--<br />
perl -MCPAN -e "CPAN::Shell->force(qw(install Sys::Virt));"<br />
Nota: constestar YES a la pregunta "Would you like me to configure as much as posible automatically?" y a "Is it OK to try to connect to the Internet?" <br />
<br />
<li>Instalar rootfilesystem de VNUML, enlaces del kernel y crear clave rsa:</li><br />
cd /usr/share/vnuml/filesystems<br />
wget http://www.dit.upm.es/vnuml/download/scripts/root-fs-installer<br />
perl root-fs-installer<br />
cd ../kernels<br />
ln -s linux-2.6.28.10-1m linux<br />
ssh-keygen -t rsa1<br />
<br />
<li>Instalar VNX:</li><br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-0.12b.tgz<br />
tar xfvz vnx-0.12b.tgz<br />
cd vnx-0.12b<br />
./install-vnx<br />
</ul><br />
<br />
Notas:<br />
http://www.ubuntu-es.org/node/128867<br />
175 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-headers-2.6.32-02063209_2.6.32-02063209_all.deb<br />
176 http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-image-2.6.32-02063209-generic_2.6.32-02063209_amd64.deb<br />
177 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-image-2.6.32-02063209-generic_2.6.32-02063209_amd64.deb<br />
178 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-headers-2.6.32-02063209-generic_2.6.32-02063209_amd64.deb<br />
--><br />
<br />
<!--<br />
=== Sobre Ubuntu 8.04 ===<br />
<br />
Pasos a seguir para instalar VNX sobre Ubuntu 8.04:<br />
<ul><br />
<br />
<li> Instalar Ubuntu 8.04 y actualizar con:</li><br />
apt-get update; apt-get dist-upgrade<br />
Rearrancar la máquina en caso de que se actualice la versión del kernel.<br />
<br />
<li> Añadir repositorio VNUML a /etc/apt/sources.lst:</li><br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian binary/" >> /etc/apt/sources.list<br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian-testing binary/" >> /etc/apt/sources.list<br />
<br />
<li> Instalar paquetes:</li><br />
apt-get update <br />
apt-get install virt-manager virt-viewer build-essential \<br />
libxml-libxml-perl vncviewer vlan xterm bridge-utils screen \<br />
curl vnuml linux-um libterm-readline-perl-perl zlib-bin zlib1g-dev \<br />
libxen3-dev libxml2-dev libgnutls-dev libsasl2-dev libsdl1.2-dev \<br />
libdevmapper-dev dnsmasq xbase-clients pkg-config<br />
<br />
<li>Si se usa la versión de Ubuntu de 64 bits hay que instalar las librerías de compatibilidad de 32 bits:</li><br />
apt-get install ia32-libs<br />
<br />
<li>Instalar qemu-kvm version 0.11.1 (la version 0.12.2 da errores):</li><br />
wget http://sourceforge.net/projects/kvm/files/qemu-kvm/0.11.1/qemu-kvm-0.11.1.tar.gz/download<br />
tar xfvz qemu-kvm-0.11.1.tar.gz<br />
cd qemu-kvm-0.11.1<br />
./configure --prefix=/usr && make && make install<br />
ln -s /usr/bin/qemu-system-x86_64 /usr/bin/kvm<br />
Editar /etc/modules y añadir:<br />
kvm <br />
kvm_intel<br />
<br />
<li>Instalar libvirt 0.7.6:</li><br />
apt-get install libvirt-bin<br />
/etc/init.d/libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.7.6.tar.gz<br />
tar xfvz libvirt-0.7.6.tar.gz<br />
cd libvirt-0.7.6<br />
./configure --prefix=/usr --without-storage-disk && make && make install<br />
/etc/init.d/libvirt-bin start<br />
<br />
<li>Instalar librería perl de acceso a libvirt (Sys::Virt) mediante CPAN (no está disponible como paquete ubuntu)</li><br />
perl -MCPAN -e "CPAN::Shell->force(qw(install Sys::Virt));"<br />
Note: answer NO to the question "Are you ready for manual configuration?"<br />
<br />
<li>Instalar rootfilesystem de VNUML, enlaces del kernel y crear clave rsa:</li><br />
cd /usr/share/vnuml/filesystems<br />
wget http://www.dit.upm.es/vnuml/download/scripts/root-fs-installer<br />
perl root-fs-installer<br />
cd ../kernels<br />
ln -s linux-2.6.28.10-1m linux<br />
ssh-keygen -t rsa1<br />
<br />
<li>Instalar VNX:</li><br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-0.12b.tgz<br />
tar xfvz vnx-0.12b.tgz<br />
cd vnx-0.12b<br />
./install-vnx<br />
</ul><br />
--></div>Davidhttps://web.dit.upm.es/vnumlwiki/index.php?title=Vnx-rootfswinxp&diff=4130Vnx-rootfswinxp2011-03-31T21:55:17Z<p>David: /* Known problems */</p>
<hr />
<div>{{Title|How to create a Windows XP root-file-system for VNX}}<br />
<br />
== Create a basic Windows XP rootfs ==<br />
<ul><br />
<li>Create the filesystem disk image:</li><br />
qemu-img create -f qcow2 root_fs_winxp-base.qcow2 5GB<br />
<li>Create a libvirt XML definition (root_fs_winxp.xml) containing the virtual machine description:</li><br />
<pre><br />
<domain type='kvm'><br />
<name>WinXP</name><br />
<memory>524288</memory><br />
<vcpu>1</vcpu><br />
<os><br />
<type arch="i686">hvm</type><br />
<boot dev='hd'/><br />
<boot dev='cdrom'/><br />
</os><br />
<features><br />
<pae/><br />
<acpi/><br />
<apic/><br />
</features><br />
<clock sync="localtime"/><br />
<devices><br />
<emulator>/usr/bin/kvm</emulator><br />
<disk type='file' device='disk'><br />
<source file='/usr/share/vnx/filesystems/root_fs_winxp-base.qcow2'/><br />
<target dev='hda'/><br />
</disk><br />
<disk type='file' device='cdrom'><br />
<source file='/almacen/iso/winxp.iso'/><br />
<target dev='hdb'/><br />
</disk><br />
<interface type='network'><br />
<source network='default'/><br />
</interface><br />
<interface type='network'><br />
<source network='default'/><br />
</interface><br />
<interface type='network'><br />
<source network='default'/><br />
</interface><br />
<interface type='network'><br />
<source network='default'/><br />
</interface><br />
<serial type='pty'><br />
<source path='/dev/pts/3'/><br />
<target port='0'/><br />
</serial><br />
<graphics type='vnc' port='5005' /><br />
</devices><br />
</domain><br />
</pre><br />
Note: change "source file=" lines to whatever fits your case (use full paths). <br />
<br />
<li>Start the virtual machine with:</li><br />
virsh create root_fs_winxp.xml<br />
<li>Open virtual machine console with:</li><br />
virt-viewer WinXP<br />
Note: you also can access the console through vncviewer:<br />
vncviewer localhost::5005<br />
<li>Make a standard windows installation, naming the machine "winxp" and creating a "vnx" user.</li><br />
<li>After Windows XP instalation is finished:</li><br />
<ul><br />
<li>Update it using "Windows update"</li><br />
<li>Disable screensaver</li><br />
<li>Disable Firewall</li><br />
<li>Install autoconfiguration daemon by downloading and executing the following program:</li><br />
http://www.dit.upm.es/vnx/download/vnx-autoconf-daemon-windows-v01.exe<br />
<li>Install TweakUI (http://download.microsoft.com/download/f/c/a/fca6767b-9ed9-45a6-b352-839afb2a2679/TweakUiPowertoySetup.exe) and disable autorun in all drives:</li><br />
<ul><br />
<li>Expand the My Computer branch, then the AutoPlay branch, and then select Drives</li><br />
<li>Turn off the checkbox next to all drive letters</li><br />
</ul><br />
<!--<br />
<li>Temporal: to obligue vnxclient to start hiden:</li><br />
<ul><br />
<li>Install download http://www.commandline.co.uk/cmdow/cmdow.zip and extract cmdow.exe to c:\windows</li><br />
<li>Create a script c:\Documents and Settings\user\Menú Inicio\Programas\Inicio\hide-vnxclient.bat with the following lines:</li><br />
cmdow @ hid<br />
ping 127.0.0.1 -n 1 -w 1000 > NUL<br />
c:\windows\cmdow c:\windows\vnxclient.exe /HID<br />
</ul><br />
--><br />
<li>Activate windows by providing a license number<br />
<li>Optional: eliminate alert messages (at least firewall and antivirus ones) from "Control Panel-->Security Center-->Change alerts (left panel)"</li><br />
<li>Optional: install basic networking applications like an ssh client (i.e. putty), an scp client (i.e. winscp) or an X server (i.e Xming)</li><br />
<li>Configure static addresses in the four network interfaces and DISABLE all of them (necessary to speed up autoconfiguration). You can use, for example, the following script (setnetifs.bat):</li><br />
<br />
netsh interface ip set address name="eth0" static 1.1.1.1 255.255.255.252<br />
netsh interface ip set address name="eth1" static 1.1.1.5 255.255.255.252<br />
netsh interface ip set address name="eth2" static 1.1.1.9 255.255.255.252<br />
netsh interface ip set address name="eth3" static 1.1.1.13 255.255.255.252<br />
<br />
Note: this script supposes that the name of network interfaces has been changed to something rational like eth0, eth1, etc, instead of the original names "Conexión de área local X" which are unusable from a bat script due to the accents...<br />
<br />
</ul><br />
</ul><br />
<br />
== Known problems ==<br />
<br />
<ul><br />
<li>Each time a vm starts, Windows finds new hardware and installs a driver for a standard RAM PCI controller. This fact slows down the boot process. To avoid it, just start the rootfilesystem once in direct mode to have windows detect the hardware and let the driver installed. For that purpose, you can use the following VNX scenario (xp.xml):</li><br />
<pre><br />
<?xml version="1.0" encoding="UTF-8"?><br />
<vnx xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"<br />
xsi:noNamespaceSchemaLocation="/usr/share/xml/vnx/vnx-1.95.xsd"><br />
<global><br />
<version>1.92</version><br />
<scenario_name>xp</scenario_name><br />
<vm_mgmt type="none" /><br />
</global><br />
<vm name="winxp" type="libvirt" subtype="kvm" os="windows"><br />
<filesystem type="direct">/usr/share/vnx/filesystems/root_fs_winxp</filesystem><br />
<mem>512M</mem><br />
</vm><br />
</vnx><br />
</pre><br />
Started with:<br />
vnx -f xp.xml -v --create<br />
and stopped with:<br />
vnx -f xp.xml -v --shutdown<br />
Note: never use not use "--destroy"option to stop a rootfilesystem use in direct mode: you will corrupt the filesystem.<br />
</ul><br />
<br />
== Use sysprep to manage Windows XP activation ==<br />
<br />
=== Install sysprep on the image ===<br />
<br />
=== Generate the final image ===</div>Davidhttps://web.dit.upm.es/vnumlwiki/index.php?title=Vnx-rootfswinxp&diff=4129Vnx-rootfswinxp2011-03-31T15:08:35Z<p>David: /* Known problems */</p>
<hr />
<div>{{Title|How to create a Windows XP root-file-system for VNX}}<br />
<br />
== Create a basic Windows XP rootfs ==<br />
<ul><br />
<li>Create the filesystem disk image:</li><br />
qemu-img create -f qcow2 root_fs_winxp-base.qcow2 5GB<br />
<li>Create a libvirt XML definition (root_fs_winxp.xml) containing the virtual machine description:</li><br />
<pre><br />
<domain type='kvm'><br />
<name>WinXP</name><br />
<memory>524288</memory><br />
<vcpu>1</vcpu><br />
<os><br />
<type arch="i686">hvm</type><br />
<boot dev='hd'/><br />
<boot dev='cdrom'/><br />
</os><br />
<features><br />
<pae/><br />
<acpi/><br />
<apic/><br />
</features><br />
<clock sync="localtime"/><br />
<devices><br />
<emulator>/usr/bin/kvm</emulator><br />
<disk type='file' device='disk'><br />
<source file='/usr/share/vnx/filesystems/root_fs_winxp-base.qcow2'/><br />
<target dev='hda'/><br />
</disk><br />
<disk type='file' device='cdrom'><br />
<source file='/almacen/iso/winxp.iso'/><br />
<target dev='hdb'/><br />
</disk><br />
<interface type='network'><br />
<source network='default'/><br />
</interface><br />
<interface type='network'><br />
<source network='default'/><br />
</interface><br />
<interface type='network'><br />
<source network='default'/><br />
</interface><br />
<interface type='network'><br />
<source network='default'/><br />
</interface><br />
<serial type='pty'><br />
<source path='/dev/pts/3'/><br />
<target port='0'/><br />
</serial><br />
<graphics type='vnc' port='5005' /><br />
</devices><br />
</domain><br />
</pre><br />
Note: change "source file=" lines to whatever fits your case (use full paths). <br />
<br />
<li>Start the virtual machine with:</li><br />
virsh create root_fs_winxp.xml<br />
<li>Open virtual machine console with:</li><br />
virt-viewer WinXP<br />
Note: you also can access the console through vncviewer:<br />
vncviewer localhost::5005<br />
<li>Make a standard windows installation, naming the machine "winxp" and creating a "vnx" user.</li><br />
<li>After Windows XP instalation is finished:</li><br />
<ul><br />
<li>Update it using "Windows update"</li><br />
<li>Disable screensaver</li><br />
<li>Disable Firewall</li><br />
<li>Install autoconfiguration daemon by downloading and executing the following program:</li><br />
http://www.dit.upm.es/vnx/download/vnx-autoconf-daemon-windows-v01.exe<br />
<li>Install TweakUI (http://download.microsoft.com/download/f/c/a/fca6767b-9ed9-45a6-b352-839afb2a2679/TweakUiPowertoySetup.exe) and disable autorun in all drives:</li><br />
<ul><br />
<li>Expand the My Computer branch, then the AutoPlay branch, and then select Drives</li><br />
<li>Turn off the checkbox next to all drive letters</li><br />
</ul><br />
<!--<br />
<li>Temporal: to obligue vnxclient to start hiden:</li><br />
<ul><br />
<li>Install download http://www.commandline.co.uk/cmdow/cmdow.zip and extract cmdow.exe to c:\windows</li><br />
<li>Create a script c:\Documents and Settings\user\Menú Inicio\Programas\Inicio\hide-vnxclient.bat with the following lines:</li><br />
cmdow @ hid<br />
ping 127.0.0.1 -n 1 -w 1000 > NUL<br />
c:\windows\cmdow c:\windows\vnxclient.exe /HID<br />
</ul><br />
--><br />
<li>Activate windows by providing a license number<br />
<li>Optional: eliminate alert messages (at least firewall and antivirus ones) from "Control Panel-->Security Center-->Change alerts (left panel)"</li><br />
<li>Optional: install basic networking applications like an ssh client (i.e. putty), an scp client (i.e. winscp) or an X server (i.e Xming)</li><br />
<li>Configure static addresses in the four network interfaces and DISABLE all of them (necessary to speed up autoconfiguration). You can use, for example, the following script (setnetifs.bat):</li><br />
<br />
netsh interface ip set address name="eth0" static 1.1.1.1 255.255.255.252<br />
netsh interface ip set address name="eth1" static 1.1.1.5 255.255.255.252<br />
netsh interface ip set address name="eth2" static 1.1.1.9 255.255.255.252<br />
netsh interface ip set address name="eth3" static 1.1.1.13 255.255.255.252<br />
<br />
Note: this script supposes that the name of network interfaces has been changed to something rational like eth0, eth1, etc, instead of the original names "Conexión de área local X" which are unusable from a bat script due to the accents...<br />
<br />
</ul><br />
</ul><br />
<br />
== Known problems ==<br />
<br />
<ul><br />
<li>Each time a vm starts, Windows finds new hardware and installs a driver for a standard RAM PCI controller. This fact slows down the boot process. To avoid it, just start the rootfilesystem once in direct mode to have windows detect the hardware and let the driver installed. For that purpose, you can use the following VNX scenario (xp.xml):</li><br />
<pre><br />
<?xml version="1.0" encoding="UTF-8"?><br />
<vnx xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"<br />
xsi:noNamespaceSchemaLocation="/usr/share/xml/vnx/vnx-1.95.xsd"><br />
<global><br />
<version>1.92</version><br />
<scenario_name>xp</scenario_name><br />
</global><br />
<vm name="winxp" type="libvirt" subtype="kvm" os="windows"><br />
<filesystem type="direct">/usr/share/vnx/filesystems/root_fs_winxp</filesystem><br />
<mem>512M</mem><br />
</vm><br />
</vnx><br />
</pre><br />
Started with:<br />
vnx -f xp.xml -v --create<br />
and stopped with:<br />
vnx -f xp.xml -v --shutdown<br />
Note: never use not use "--destroy"option to stop a rootfilesystem use in direct mode: you will corrupt the filesystem.<br />
</ul><br />
<br />
== Use sysprep to manage Windows XP activation ==<br />
<br />
=== Install sysprep on the image ===<br />
<br />
=== Generate the final image ===</div>Davidhttps://web.dit.upm.es/vnumlwiki/index.php?title=Vnx-rootfswinxp&diff=4128Vnx-rootfswinxp2011-03-31T15:00:25Z<p>David: /* Known problems */</p>
<hr />
<div>{{Title|How to create a Windows XP root-file-system for VNX}}<br />
<br />
== Create a basic Windows XP rootfs ==<br />
<ul><br />
<li>Create the filesystem disk image:</li><br />
qemu-img create -f qcow2 root_fs_winxp-base.qcow2 5GB<br />
<li>Create a libvirt XML definition (root_fs_winxp.xml) containing the virtual machine description:</li><br />
<pre><br />
<domain type='kvm'><br />
<name>WinXP</name><br />
<memory>524288</memory><br />
<vcpu>1</vcpu><br />
<os><br />
<type arch="i686">hvm</type><br />
<boot dev='hd'/><br />
<boot dev='cdrom'/><br />
</os><br />
<features><br />
<pae/><br />
<acpi/><br />
<apic/><br />
</features><br />
<clock sync="localtime"/><br />
<devices><br />
<emulator>/usr/bin/kvm</emulator><br />
<disk type='file' device='disk'><br />
<source file='/usr/share/vnx/filesystems/root_fs_winxp-base.qcow2'/><br />
<target dev='hda'/><br />
</disk><br />
<disk type='file' device='cdrom'><br />
<source file='/almacen/iso/winxp.iso'/><br />
<target dev='hdb'/><br />
</disk><br />
<interface type='network'><br />
<source network='default'/><br />
</interface><br />
<interface type='network'><br />
<source network='default'/><br />
</interface><br />
<interface type='network'><br />
<source network='default'/><br />
</interface><br />
<interface type='network'><br />
<source network='default'/><br />
</interface><br />
<serial type='pty'><br />
<source path='/dev/pts/3'/><br />
<target port='0'/><br />
</serial><br />
<graphics type='vnc' port='5005' /><br />
</devices><br />
</domain><br />
</pre><br />
Note: change "source file=" lines to whatever fits your case (use full paths). <br />
<br />
<li>Start the virtual machine with:</li><br />
virsh create root_fs_winxp.xml<br />
<li>Open virtual machine console with:</li><br />
virt-viewer WinXP<br />
Note: you also can access the console through vncviewer:<br />
vncviewer localhost::5005<br />
<li>Make a standard windows installation, naming the machine "winxp" and creating a "vnx" user.</li><br />
<li>After Windows XP instalation is finished:</li><br />
<ul><br />
<li>Update it using "Windows update"</li><br />
<li>Disable screensaver</li><br />
<li>Disable Firewall</li><br />
<li>Install autoconfiguration daemon by downloading and executing the following program:</li><br />
http://www.dit.upm.es/vnx/download/vnx-autoconf-daemon-windows-v01.exe<br />
<li>Install TweakUI (http://download.microsoft.com/download/f/c/a/fca6767b-9ed9-45a6-b352-839afb2a2679/TweakUiPowertoySetup.exe) and disable autorun in all drives:</li><br />
<ul><br />
<li>Expand the My Computer branch, then the AutoPlay branch, and then select Drives</li><br />
<li>Turn off the checkbox next to all drive letters</li><br />
</ul><br />
<!--<br />
<li>Temporal: to obligue vnxclient to start hiden:</li><br />
<ul><br />
<li>Install download http://www.commandline.co.uk/cmdow/cmdow.zip and extract cmdow.exe to c:\windows</li><br />
<li>Create a script c:\Documents and Settings\user\Menú Inicio\Programas\Inicio\hide-vnxclient.bat with the following lines:</li><br />
cmdow @ hid<br />
ping 127.0.0.1 -n 1 -w 1000 > NUL<br />
c:\windows\cmdow c:\windows\vnxclient.exe /HID<br />
</ul><br />
--><br />
<li>Activate windows by providing a license number<br />
<li>Optional: eliminate alert messages (at least firewall and antivirus ones) from "Control Panel-->Security Center-->Change alerts (left panel)"</li><br />
<li>Optional: install basic networking applications like an ssh client (i.e. putty), an scp client (i.e. winscp) or an X server (i.e Xming)</li><br />
<li>Configure static addresses in the four network interfaces and DISABLE all of them (necessary to speed up autoconfiguration). You can use, for example, the following script (setnetifs.bat):</li><br />
<br />
netsh interface ip set address name="eth0" static 1.1.1.1 255.255.255.252<br />
netsh interface ip set address name="eth1" static 1.1.1.5 255.255.255.252<br />
netsh interface ip set address name="eth2" static 1.1.1.9 255.255.255.252<br />
netsh interface ip set address name="eth3" static 1.1.1.13 255.255.255.252<br />
<br />
Note: this script supposes that the name of network interfaces has been changed to something rational like eth0, eth1, etc, instead of the original names "Conexión de área local X" which are unusable from a bat script due to the accents...<br />
<br />
</ul><br />
</ul><br />
<br />
== Known problems ==<br />
<br />
<ul><br />
<li>Each time a vm starts, Windows finds new hardware and installs a driver for a standard RAM PCI controller. This fact slows down the boot process. To avoid it, just start the rootfilesystem once in direct mode to have windows detect the hardware and let the driver installed. For that purpose, you can use the following VNX scenario (xp.xml):</li><br />
<pre><br />
<?xml version="1.0" encoding="UTF-8"?><br />
<vnx xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"<br />
xsi:noNamespaceSchemaLocation="/usr/share/xml/vnx/vnx-1.95.xsd"><br />
<global><br />
<version>1.92</version><br />
<scenario_name>xp</scenario_name><br />
</global><br />
<vm name="winxp" type="libvirt" subtype="kvm" os="windows"><br />
<filesystem type="direct">/usr/share/vnx/filesystems/root_fs_winxp</filesystem><br />
<mem>512M</mem><br />
</vm><br />
</vnx><br />
</pre><br />
Started with:<br />
vnx -f xp.xml -u root --create<br />
and stopped with:<br />
vnx -f xp.xml -u root --shutdown<br />
Note: never use not use "--destroy"option to stop a rootfilesystem use in direct mode: you will corrupt the filesystem.<br />
</ul><br />
<br />
== Use sysprep to manage Windows XP activation ==<br />
<br />
=== Install sysprep on the image ===<br />
<br />
=== Generate the final image ===</div>Davidhttps://web.dit.upm.es/vnumlwiki/index.php?title=Vnx-rootfswinxp&diff=4127Vnx-rootfswinxp2011-03-31T14:59:13Z<p>David: /* Known problems */</p>
<hr />
<div>{{Title|How to create a Windows XP root-file-system for VNX}}<br />
<br />
== Create a basic Windows XP rootfs ==<br />
<ul><br />
<li>Create the filesystem disk image:</li><br />
qemu-img create -f qcow2 root_fs_winxp-base.qcow2 5GB<br />
<li>Create a libvirt XML definition (root_fs_winxp.xml) containing the virtual machine description:</li><br />
<pre><br />
<domain type='kvm'><br />
<name>WinXP</name><br />
<memory>524288</memory><br />
<vcpu>1</vcpu><br />
<os><br />
<type arch="i686">hvm</type><br />
<boot dev='hd'/><br />
<boot dev='cdrom'/><br />
</os><br />
<features><br />
<pae/><br />
<acpi/><br />
<apic/><br />
</features><br />
<clock sync="localtime"/><br />
<devices><br />
<emulator>/usr/bin/kvm</emulator><br />
<disk type='file' device='disk'><br />
<source file='/usr/share/vnx/filesystems/root_fs_winxp-base.qcow2'/><br />
<target dev='hda'/><br />
</disk><br />
<disk type='file' device='cdrom'><br />
<source file='/almacen/iso/winxp.iso'/><br />
<target dev='hdb'/><br />
</disk><br />
<interface type='network'><br />
<source network='default'/><br />
</interface><br />
<interface type='network'><br />
<source network='default'/><br />
</interface><br />
<interface type='network'><br />
<source network='default'/><br />
</interface><br />
<interface type='network'><br />
<source network='default'/><br />
</interface><br />
<serial type='pty'><br />
<source path='/dev/pts/3'/><br />
<target port='0'/><br />
</serial><br />
<graphics type='vnc' port='5005' /><br />
</devices><br />
</domain><br />
</pre><br />
Note: change "source file=" lines to whatever fits your case (use full paths). <br />
<br />
<li>Start the virtual machine with:</li><br />
virsh create root_fs_winxp.xml<br />
<li>Open virtual machine console with:</li><br />
virt-viewer WinXP<br />
Note: you also can access the console through vncviewer:<br />
vncviewer localhost::5005<br />
<li>Make a standard windows installation, naming the machine "winxp" and creating a "vnx" user.</li><br />
<li>After Windows XP instalation is finished:</li><br />
<ul><br />
<li>Update it using "Windows update"</li><br />
<li>Disable screensaver</li><br />
<li>Disable Firewall</li><br />
<li>Install autoconfiguration daemon by downloading and executing the following program:</li><br />
http://www.dit.upm.es/vnx/download/vnx-autoconf-daemon-windows-v01.exe<br />
<li>Install TweakUI (http://download.microsoft.com/download/f/c/a/fca6767b-9ed9-45a6-b352-839afb2a2679/TweakUiPowertoySetup.exe) and disable autorun in all drives:</li><br />
<ul><br />
<li>Expand the My Computer branch, then the AutoPlay branch, and then select Drives</li><br />
<li>Turn off the checkbox next to all drive letters</li><br />
</ul><br />
<!--<br />
<li>Temporal: to obligue vnxclient to start hiden:</li><br />
<ul><br />
<li>Install download http://www.commandline.co.uk/cmdow/cmdow.zip and extract cmdow.exe to c:\windows</li><br />
<li>Create a script c:\Documents and Settings\user\Menú Inicio\Programas\Inicio\hide-vnxclient.bat with the following lines:</li><br />
cmdow @ hid<br />
ping 127.0.0.1 -n 1 -w 1000 > NUL<br />
c:\windows\cmdow c:\windows\vnxclient.exe /HID<br />
</ul><br />
--><br />
<li>Activate windows by providing a license number<br />
<li>Optional: eliminate alert messages (at least firewall and antivirus ones) from "Control Panel-->Security Center-->Change alerts (left panel)"</li><br />
<li>Optional: install basic networking applications like an ssh client (i.e. putty), an scp client (i.e. winscp) or an X server (i.e Xming)</li><br />
<li>Configure static addresses in the four network interfaces and DISABLE all of them (necessary to speed up autoconfiguration). You can use, for example, the following script (setnetifs.bat):</li><br />
<br />
netsh interface ip set address name="eth0" static 1.1.1.1 255.255.255.252<br />
netsh interface ip set address name="eth1" static 1.1.1.5 255.255.255.252<br />
netsh interface ip set address name="eth2" static 1.1.1.9 255.255.255.252<br />
netsh interface ip set address name="eth3" static 1.1.1.13 255.255.255.252<br />
<br />
Note: this script supposes that the name of network interfaces has been changed to something rational like eth0, eth1, etc, instead of the original names "Conexión de área local X" which are unusable from a bat script due to the accents...<br />
<br />
</ul><br />
</ul><br />
<br />
== Known problems ==<br />
<br />
<ul><br />
<li>Each time a vm starts, Windows finds new hardware and installs a driver for a standard RAM PCI controller. This fact slows down the boot process. To avoid it, just start the rootfilesystem once in direct mode to have windows detect the hardware and let the driver installed. For that purpose, you can use the following VNX scenario (xp.xml):</li><br />
<pre><br />
<xml version="1.0" encoding="UTF-8"?><br />
<vnx xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"<br />
xsi:noNamespaceSchemaLocation="/usr/share/xml/vnx/vnx-1.95.xsd"><br />
<global><br />
<version>1.92</version><br />
<scenario_name>xp</scenario_name><br />
</global><br />
<vm name="winxp" type="libvirt" subtype="kvm" os="windows"><br />
<filesystem type="direct">/usr/share/vnx/filesystems/root_fs_winxp</filesystem><br />
<mem>512M</mem><br />
</vm><br />
</vnx><br />
</pre><br />
Started with:<br />
vnx -f xp.xml -u root --create<br />
and stopped with:<br />
vnx -f xp.xml -u root --shutdown<br />
Note: never use not use "--destroy"option to stop a rootfilesystem use in direct mode: you will corrupt the filesystem.<br />
</ul><br />
<br />
== Use sysprep to manage Windows XP activation ==<br />
<br />
=== Install sysprep on the image ===<br />
<br />
=== Generate the final image ===</div>Davidhttps://web.dit.upm.es/vnumlwiki/index.php?title=Vnx-rootfsubuntu&diff=4126Vnx-rootfsubuntu2011-03-30T20:50:03Z<p>David: </p>
<hr />
<div>{{Title|How to create a Ubuntu root-file-system for VNX}}<br />
<br />
Follow this procedure to create a Ubuntu based root-file-system for VNX. The procedure has been tested with Ubuntu 9.10 and 10.04.<br />
<ul><br />
<li>Create the filesystem disk image:</li><br />
qemu-img create -f qcow2 root_fs_ubuntu-base.qcow2 5GB<br />
<li>Get Ubuntu installation CD. For example:</li><br />
wget ftp://ftp.rediris.es/mirror/ubuntu-releases/10.04.1/ubuntu-10.04.1-server-i386.iso<br />
cp ubuntu-10.04.1-server-i386.iso /almacen/iso<br />
<li>Create a libvirt XML definition (root_fs_ubuntu.xml) containing the virtual machine description:</li><br />
<pre><br />
<domain type='kvm'><br />
<name>Ubuntu</name><br />
<memory>524288</memory><br />
<vcpu>1</vcpu><br />
<os><br />
<type arch="i686">hvm</type><br />
<boot dev='hd'/><br />
<boot dev='cdrom'/><br />
</os><br />
<features><br />
<pae/><br />
<acpi/><br />
<apic/><br />
</features><br />
<clock sync="localtime"/><br />
<devices><br />
<emulator>/usr/bin/kvm</emulator><br />
<disk type='file' device='disk'><br />
<source file='/usr/share/vnx/filesystems/root_fs_ubuntu-base.qcow2'/><br />
<target dev='hda'/><br />
<driver name="qemu" type="qcow2"/><br />
</disk><br />
<disk type='file' device='cdrom'><br />
<source file='/almacen/iso/ubuntu-10.04.1-server-i386.iso'/><br />
<target dev='hdb'/><br />
</disk><br />
<interface type='network'><br />
<source network='default'/><br />
</interface><br />
<graphics type='vnc'/><br />
</devices><br />
</domain><br />
</pre><br />
Note: change "source file=" lines to whatever fits your case (use full paths). <br />
<br />
<li>Start the virtual machine with:</li><br />
virsh create root_fs_ubuntu.xml<br />
<li>Access virtual machine console with:</li><br />
virt-viewer Ubuntu<br />
Note: alternative you can start the machine and open the console at the same time with the command:<br />
/usr/share/vnx/bin/vnx_modify_rootfs root_fs_ubuntu.xml<br />
<li>Follow Ubuntu installation menus to install a basic system with ssh server. Once the installation is finished, stop the machine and edit root_fs_ubuntu.xml file and comment the following line in cdrom disk specification:</li><br />
<pre><br />
<!--source file='/almacen/iso/ubuntu-10.04-server-i386.iso'/--><br />
</pre><br />
<li>Start the virtual machine again and finish the installation:</li><br />
<ul><br />
<li>Access the console and sudo root: </li><br />
sudo su<br />
<li>Update the system</li><br />
apt-get update<br />
apt-get dist-upgrade<br />
<li>Install XML::DOM perl package and ACPI daemon:</li><br />
apt-get install libxml-dom-perl acpid<br />
<li>Only for Ubuntu 10.04:</li><br />
<ul><br />
<li>create /media/cdrom* directories:</li><br />
mkdir /media/cdrom0<br />
mkdir /media/cdrom1<br />
ln -s /media/cdrom0 /media/cdrom<br />
ln -s /cdrom /media/cdrom<br />
<li>add the following lines to /etc/fstab:</li><br />
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0<br />
/dev/scd1 /media/cdrom1 udf,iso9660 user,noauto,exec,utf8 0 0<br />
</ul><br />
<li>Configure a serial console on ttyS0:</li><br />
cd /etc/init<br />
cp tty1.conf ttyS0.conf<br />
sed -i -e 's/tty1/ttyS0/' ttyS0.conf<br />
<li>Activate startup traces on serial console by editting /boot/grub/grub.cfg file and adding "console=ttyS0" to the linux line. For example:</li><br />
linux /boot/vmlinuz-2.6.35-25-generic-pae root=UUID=eb1a0afb-48b2-4e42-ba6d-22bfae1055f3 ro quiet console=ttyS0<br />
<li>Install VNX autoconfiguration daemon:</li><br />
<ul><br />
<li>From the host execute:</li><br />
/usr/share/vnx/bin/vnx_update_aced Ubuntu /usr/share/vnx/aced/vnx-aced-lf-0.1b.tgz <br />
<li>From the virtual machine console:</li><br />
mount /media/cdrom<br />
/media/cdrom/install_vnxdaemon<br />
</ul><br />
<li>Delete udev rules files:</li><br />
rm /etc/udev/rules.d/70-persistent-net.rules<br />
rm /etc/udev/rules.d/70-persistent-cd.rules<br />
<li>Optional: install graphical user interface.</li><br />
<ul><br />
<li>Minimal:</li><br />
sudo apt-get install xorg gnome-core gksu gdm gnome-system-tools gnome-nettool firefox-gnome-support<br />
<li>Complete:</li><br />
sudo apt-get install ubuntu-desktop<br />
</ul><br />
<li>Optional: install other services:</li><br />
<ul><br />
<li>Apache server:</li><br />
sudo apt-get install apache2<br />
update-rc.d -f apache2 remove # to avoid automatic start<br />
<li>Other network tools</li><br />
sudo apt-get install traceroute<br />
</ul><br />
<li>Clean cache and stop the machine with:</li><br />
apt-get clean<br />
halt<br />
</ul><br />
</ul><br />
<br />
If everything went well, your root filesystem will be ready to be used with VNX. You can make a simple test using the simple_ubuntu.xml scenario distributed with VNX. <br />
<br />
=== Installing additional software ===<br />
<br />
To install additional software or modify your root file system, you just have to start it as described above and make the operations required on the filesystem.<br />
* Start the virtual machine (directly using virsh or the vnx_modify_rootfs utility):<br />
/usr/share/vnx/bin/vnx_modify_rootfs root_fs_ubuntu.xml <br />
* Install the software:<br />
apt-get install ...<br />
* Delete udev rules files:<br />
rm /etc/udev/rules.d/70-persistent-net.rules<br />
rm /etc/udev/rules.d/70-persistent-cd.rules<br />
* Stop the machine with:<br />
halt<br />
<br />
=== Updating ACE daemon ===<br />
<br />
If you have a root filesystem with the autoconfiguration and command execution daemon (ACE) already installed, you can use the autoupdate functionallity to update the daemon to a newer version. Just follow this procedure:<br />
<br />
* Edit the xml described above and comment the line defining the Ubuntu iso file for the cdrom:<br />
<!--source file='/almacen/iso/ubuntu-10.04-server-i386.iso'/--><br />
* Start the virtual machine (directly using virsh or the vnx_modify_rootfs utility):<br />
/usr/share/vnx/bin/vnx_modify_rootfs root_fs_ubuntu.xml <br />
* Execute the update utility:<br />
/usr/share/vnx/bin/vnx_update_aced Ubuntu /usr/share/vnx/aced/vnx-aced-lf-0.1b.tgz <br />
* Once the ace daemon is updated the virtual machine will be rebooted automatically.<br />
<br />
=== Known problems ===<br />
<br />
<ul><br />
<li>Each a cdrom is mounted (for example, ehenever a command is executed on the virtual machine) the following error appear in the console:</li><br />
<pre><br />
Jul 27 22:33:31 vnx kernel: [ 4384.875886] ata1.01: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6<br />
Jul 27 22:33:31 vnx kernel: [ 4385.291374] ata1.01: BMDMA stat 0x5<br />
Jul 27 22:33:31 vnx kernel: [ 4385.493411] sr 0:0:1:0: [sr0] CDB: Read(10): 28 00 00 00 00 18 00 00 01 00<br />
Jul 27 22:33:31 vnx kernel: [ 4385.493460] ata1.01: cmd a0/01:00:00:00:08/00:00:00:00:00/b0 tag 0 dma 2048 in<br />
Jul 27 22:33:31 vnx kernel: [ 4385.493461] res 01/60:00:00:00:08/00:00:00:00:00/b0 Emask 0x3 (HSM violation)<br />
Jul 27 22:33:31 vnx kernel: [ 4386.263553] ata1.01: status: { ERR }<br />
</pre><br />
However, the command are executed correctly. This error does not appear on Ubuntu 9.10 filesystems.<br />
<br />
</ul></div>Davidhttps://web.dit.upm.es/vnumlwiki/index.php?title=Vnx-install&diff=4125Vnx-install2011-03-28T13:06:09Z<p>David: </p>
<hr />
<div>{{Title|VNX (Virtual Networks over X virtualization) v0.14 beta}}<br />
<br />
== Installation over Ubuntu 10.04/9.10 ==<br />
<br />
This section describes the procedure for installing VNX over Ubuntu 10.04 or 9.10. Open a root shell window and follow these steps:<br />
<ul><br />
<br />
<li>Install all packages required (basic development, virtualization, perl libraries and auxiliar packages):</li><br />
apt-get update<br />
apt-get install build-essential qemu-kvm libvirt-bin vlan xterm \<br />
bridge-utils screen virt-manager virt-viewer libxml-checker-perl \<br />
libxml-parser-perl libnetaddr-ip-perl libnet-pcap-perl \<br />
libnet-ipv6addr-perl liberror-perl libexception-class-perl \<br />
uml-utilities libxml-libxml-perl libxml2-dev libgnutls-dev \<br />
libdevmapper-dev libterm-readline-perl-perl libnet-telnet-perl \<br />
libnet-ip-perl libreadonly-perl libmath-round-perl libappconfig-perl \<br />
libdbi-perl graphviz libnl-dev genisoimage gnome-terminal libfile-homedir-perl<br />
<br />
<!--Note: for Ubuntu 9.04 change "qemu-kvm" package by "qemu kvm" --><br />
<li>If you use 64 bits version of Ubuntu, install 32 bits compatibility libraries:</li><br />
apt-get install ia32-libs<br />
<br />
<li>Install libvirt 0.8.5:</li><br />
/etc/init.d/libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.8.5.tar.gz<br />
tar xfvz libvirt-0.8.5.tar.gz<br />
cd libvirt-0.8.5<br />
./configure --without-xen --prefix=/usr && make && make install<br />
/etc/init.d/libvirt-bin start<br />
<br />
'''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.<br />
<br />
<li>Install Sys::Virt perl module:</li><br />
<ul><br />
<li>For Ubuntu 10.04, just install the libsys-virt-perl package</li><br />
apt-get install libsys-virt-perl<br />
<!--<br />
'''IMPORTANT NOTE''': Windows XP virtual machines started with VNX over Ubuntu 9.10 frequently hang when executing commands or with high traffic loads. The problem could be related with virtual network drivers. We are investigating the problem to find a solution. By now, Ubuntu 10.04 is the recomended platform to test VNX.<br />
--><br />
<li>For Ubuntu 9.10, as Sys::Virt library is not available as a package, install it manually:</li><br />
wget http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.2.3.tar.gz<br />
tar xfvz Sys-Virt-0.2.3.tar.gz <br />
cd Sys-Virt-0.2.3<br />
perl Makefile.PL<br />
make install<br />
</ul><br />
<br />
<li>Install VNX:</li><br />
mkdir /tmp/vnx-update<br />
cd /tmp/vnx-update<br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-latest.tgz<br />
tar xfvz vnx-latest.tgz<br />
cd vnx-*<br />
./install_vnx<br />
<br />
<li>Create the VNX config file (/etc/vnx.conf). You just can move the sample config file:</li><br />
mv /etc/vnx.conf.sample /etc/vnx.conf<br />
<br />
<li>Download root file systems from http://idefix.dit.upm.es/download/vnx/filesystems and copy them to /usr/share/vnx/filesystems directory:</li><br />
cd /usr/share/vnx/filesystems<br />
<br />
# ubuntu server<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.10-v01.qcow2.bz2<br />
bunzip2 root_fs_ubuntu-10.10-v01.qcow2.bz2<br />
ln -s root_fs_ubuntu-10.10-v01.qcow2 root_fs_ubuntu<br />
<br />
# ubuntu with gui<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.10-gui-v01.qcow2.bz2<br />
bunzip2 root_fs_ubuntu-10.10-gui-v01.qcow2.bz2<br />
ln -s root_fs_ubuntu-10.10-gui-v01.qcow2 root_fs_ubuntu-gui<br />
<br />
# freebsd server<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-8.1-v01.qcow2.bz2<br />
bunzip2 root_fs_freebsd-8.1-v01.qcow2.bz2<br />
ln -s root_fs_freebsd-8.1-v01.qcow2 root_fs_freebsd<br />
<br />
# freebsd gui<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-8.1-gui-v01.qcow2.bz2<br />
bunzip2 root_fs_freebsd-8.1-gui-v01.qcow2.bz2<br />
ln -s root_fs_freebsd-8.1-gui-v01.qcow2 root_fs_freebsd-gui<br />
<br />
# winxp and win7<br />
# Sorry! Unfortunately for legal reasons we cannot distribute windows XP<br />
# or Windows 7 root filesystems. See VNX documentation for detailed recipes<br />
# to create these root fylesystems from scratch<br />
<br />
<li>Additionally, if you plan to use VNUML root filesystem:</li><br />
# VNUML root_fs_tutorial and kernel<br />
cd /usr/share/vnx/filesystems<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_tutorial-0.6.0.bz2<br />
bunzip2 root_fs_tutorial-0.6.0.bz2<br />
ln -s root_fs_tutorial-0.6.0 root_fs_tutorial<br />
cd /usr/share/vnx/kernels<br />
wget -N http://jungla.dit.upm.es/~vnx/download/kernels/linux-2.6.18.1-bb2-xt-4m<br />
chmod +x linux-2.6.18.1-bb2-xt-4m<br />
ln -s linux-2.6.18.1-bb2-xt-4m linux<br />
<br />
</ul><br />
<br />
'''NOTE for Ubuntu 10.04.1''': It seems that an additional package has to be installed:<br />
apt-get install kvm-pxe<br />
<br />
=== Additional install steps for Dynamips support ===<br />
<br />
* Install Dynamips and Dynagen:<br />
apt-get install dynamips dynagen<br />
<br />
* Create a file /etc/init.d/dynamips (taken from http://7200emu.hacki.at/viewtopic.php?t=2198):<br />
<pre><br />
#!/bin/sh<br />
# Start/stop the dynamips program as a daemon.<br />
#<br />
### BEGIN INIT INFO<br />
# Provides: dynamips<br />
# Default-Start: 2 3 4 5<br />
# Default-Stop: 0 1 6<br />
# Short-Description: Cisco hardware emulator daemon<br />
### END INIT INFO<br />
<br />
DAEMON=/usr/bin/dynamips<br />
NAME=dynamips<br />
PORT=7200<br />
PIDFILE=/var/run/$NAME.pid <br />
LOGFILE=/var/log/$NAME.log<br />
DESC="Cisco Emulator"<br />
SCRIPTNAME=/etc/init.d/$NAME<br />
<br />
test -f $DAEMON || exit 0<br />
<br />
. /lib/lsb/init-functions<br />
<br />
<br />
case "$1" in<br />
start) log_daemon_msg "Starting $DESC " "$NAME"<br />
start-stop-daemon --start --chdir /tmp --background --make-pidfile --pidfile $PIDFILE --name $NAME --startas $DAEMON -- -H $PORT -l $LOGFILE<br />
log_end_msg $?<br />
;;<br />
stop) log_daemon_msg "Stopping $DESC " "$NAME"<br />
start-stop-daemon --stop --quiet --pidfile $PIDFILE --name $NAME<br />
log_end_msg $?<br />
;;<br />
restart) log_daemon_msg "Restarting $DESC " "$NAME"<br />
start-stop-daemon --stop --retry 5 --quiet --pidfile $PIDFILE --name $NAME<br />
start-stop-daemon --start --chdir /tmp --background --make-pidfile --pidfile $PIDFILE --name $NAME --startas $DAEMON -- -H $PORT -l $LOGFILE<br />
log_end_msg $?<br />
;;<br />
status)<br />
status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $? <br />
#status $NAME<br />
#RETVAL=$?<br />
;; <br />
*) log_action_msg "Usage: $SCRIPTNAME {start|stop|restart|status}"<br />
exit 2<br />
;;<br />
esac<br />
exit 0<br />
<br />
</pre><br />
<br />
* Set execution permissions for the script and add it to system start-up:<br />
chmod +x /etc/init.d/dynamips<br />
update-rc.d dynamips defaults<br />
/etc/init.d/dynamips start<br />
<br />
* Download and install cisco IOS image:<br />
cd /usr/share/vnx/filesystems<br />
# Cisco image<br />
wget ... c3640-js-mz.124-19.image<br />
ln -s c3640-js-mz.124-19.image c3640<br />
<br />
* Calculate the idle-pc value for your computer following the procedure in http://dynagen.org/tutorial.htm:<br />
dynagen /usr/share/vnx/examples/R.net<br />
console R # type 'no' to exit the config wizard and wait <br />
# for the router to completely start <br />
idle-pc get R<br />
Once you know the idle-pc value for your system, include it in /etc/vnx.conf file.<br />
<br />
=== Additional install steps for Olive support ===<br />
<br />
Several additional steps are needed to support Olive (Juniper) routers in VNX scenarios:<br />
<br />
<ul><br />
<br />
<!-- Ya no hace falta desde que se usa <qemu:commandline><br />
<br />
<li>Install a patched version of libvirt 0.8.5 with support to define the bios used by a virtual machine:</li><br />
<br />
<ul><br />
<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><br />
<pre><br />
diff -crB libvirt-0.8.5.orig/src/conf/domain_conf.c libvirt-0.8.5/src/conf/domain_conf.c<br />
*** libvirt-0.8.5.orig/src/conf/domain_conf.c 2010-11-22 11:38:08.000000000 +0100<br />
--- libvirt-0.8.5/src/conf/domain_conf.c 2010-11-22 11:47:41.000000000 +0100<br />
***************<br />
*** 4267,4272 ****<br />
--- 4267,4274 ----<br />
if (node)<br />
def->mem.hugepage_backed = 1;<br />
<br />
+ def->biosfile = virXPathString("string(./biosfile[1])", ctxt);<br />
+ <br />
/* Extract other memory tunables */<br />
if (virXPathULong("string(./memtune/hard_limit)", ctxt,<br />
&def->mem.hard_limit) < 0)<br />
diff -crB libvirt-0.8.5.orig/src/conf/domain_conf.h libvirt-0.8.5/src/conf/domain_conf.h<br />
*** libvirt-0.8.5.orig/src/conf/domain_conf.h 2010-11-22 11:38:08.000000000 +0100<br />
--- libvirt-0.8.5/src/conf/domain_conf.h 2010-11-22 11:40:18.000000000 +0100<br />
***************<br />
*** 885,890 ****<br />
--- 885,891 ----<br />
unsigned long min_guarantee;<br />
unsigned long swap_hard_limit;<br />
} mem;<br />
+ char *biosfile;<br />
unsigned short vcpus;<br />
unsigned short maxvcpus;<br />
int cpumasklen;<br />
diff -crB libvirt-0.8.5.orig/src/qemu/qemu_conf.c libvirt-0.8.5/src/qemu/qemu_conf.c<br />
*** libvirt-0.8.5.orig/src/qemu/qemu_conf.c 2010-11-22 11:38:08.000000000 +0100<br />
--- libvirt-0.8.5/src/qemu/qemu_conf.c 2010-11-22 11:41:05.000000000 +0100<br />
***************<br />
*** 3984,3989 ****<br />
--- 3984,3995 ----<br />
ADD_ARG_LIT(emulator);<br />
ADD_ARG_LIT("-S");<br />
<br />
+ if(def->biosfile)<br />
+ {<br />
+ ADD_ARG_LIT("-bios");<br />
+ ADD_ARG_LIT(def->biosfile);<br />
+ }<br />
+ <br />
/* This should *never* be NULL, since we always provide<br />
* a machine in the capabilities data for QEMU. So this<br />
* check is just here as a safety in case the unexpected<br />
</pre><br />
<br />
<li>Install libvirt 0.8.5 with that patch applied:</li><br />
service libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.8.5.tar.gz<br />
tar xfvz libvirt-0.8.5.tar.gz <br />
cd libvirt-0.8.5<br />
patch -p1 -i ../libvirt-0.8.5-biosfile.patch <br />
./configure --without-xen --prefix=/usr && make && make install<br />
service libvirt-bin start<br />
<br />
</ul><br />
--><br />
<li>Download old qemu bios from 0.10.6 version and copy it to /usr/share/qemu directory:</li><br />
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.10.6/qemu-kvm-0.10.6.tar.gz<br />
tar xfvz qemu-kvm-0.10.6.tar.gz<br />
cp qemu-kvm-0.10.6/pc-bios/bios.bin /usr/share/qemu-kvm/bios-0.10.6.bin<br />
<br />
<!-- Not needed, it seems to work without downloading this drivers<br />
<li>Download i82559 ROM from the latest qemu versions (Ubuntu 10.04 does not include that ROM in qemu-kvm package):</li><br />
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.12.5/qemu-kvm-0.12.5.tar.gz<br />
tar xfvz qemu-kvm-0.12.5.tar.gz<br />
cp qemu-kvm-0.12.5/pc-bios/pxe-i82559er.bin /usr/share/qemu-kvm/<br />
--><br />
</ul><br />
<br />
== Installation over Fedora 11 (Draft) ==<br />
<br />
Follow this steps to install VNX over Fedora 11:<br />
<ul><br />
<br />
<li>Install packages:</li><br />
yum -y groupinstall "Development Tools"<br />
yum install qemu-kvm libvirt virt-manager virt-viewer perl-XML-LibXML<br />
yum install perl-XML-DOM perl-NetAddr-IP perl-Readonly perl-TermReadKey<br />
yum install perl-Net-Pcap perl-Net-IPv6Addr perl-Net-Telnet perl-Error<br />
yum install perl-Exception-Class perl-ExtUtils-MakeMaker tunctl screen wget<br />
yum install libxml2-devel gnutls-devel device-mapper-devel uml_utilities <br />
yum install roxterm xterm graphviz perl-AppConfig<br />
<br />
<li>Install libvirt 0.8.5:</li><br />
/etc/init.d/libvirtd stop<br />
wget http://libvirt.org/sources/libvirt-0.8.5.tar.gz<br />
tar xfvz libvirt-0.8.5.tar.gz<br />
cd libvirt-0.8.5<br />
./configure --without-xen --prefix=/usr && make && make install<br />
/etc/init.d/libvirtd start<br />
<br />
<li>Install SysVirt manually:</li><br />
wget http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.2.4.tar.gz<br />
tar xfvz Sys-Virt-0.2.4.tar.gz<br />
cd Sys-Virt-0.2.4<br />
perl Makefile.PL<br />
make install<br />
<!--<br />
<li> Instalar VNUML sobre Fedora 11 siguiendo la receta en http://www.dit.upm.es/vnumlwiki/index.php/Fedora11</li><br />
<br />
<li> Instalar paquetes y librerías necesarias:</li><br />
yum install qemu-kvm libvirt virt-manager virt-viewer perl-XML-LibXML perl-Sys-Virt<br />
yum -y install bridge-utils readline-devel perl-Module-Build screen expat-devel libpcap-devel <br />
yum -y install perl-Net-Pcap perl-NetAddr-IP perl-Net-IPv6Addr perl-XML-DOM perl-Exception-Class<br />
yum -y install perl-TermReadKey perl-Error perl-CPAN uml_utilities xterm tunctl<br />
<br />
<li>Install XML::Checker perl library:</li><br />
perl -MCPAN -e shell<br />
install XML::Checker<br />
--><br />
<li>Add symbolic link for kvm:</li><br />
ln -s /usr/bin/qemu-kvm /usr/bin/kvm<br />
<br />
<li>Install VNX:</li><br />
mkdir /tmp/vnx-update<br />
cd /tmp/vnx-update<br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-latest.tgz<br />
tar xfvz vnx-latest.tgz<br />
cd vnx-*<br />
./install_vnx<br />
<br />
<li>Create the VNX config file (/etc/vnx.conf). You just can move the sample config file:</li><br />
mv /etc/vnx.conf.samble /etc/vnx.conf<br />
<br />
<li>Disable host firewall or, alternatively, configure "tun" type network interfaces as trusted interfaces (System->Firewall->Trusted Interfaces).</li><br />
<br />
<li>Download root file systems from http://idefix.dit.upm.es/download/vnx/filesystems and copy them to /usr/share/vnx/filesystems directory:</li><br />
cd /usr/share/vnx/filesystems<br />
<br />
# ubuntu server<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.10-v01.qcow2.bz2<br />
bunzip2 root_fs_ubuntu-10.10-v01.qcow2.bz2<br />
ln -s root_fs_ubuntu-10.10-v01.qcow2 root_fs_ubuntu<br />
<br />
# ubuntu with gui<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.10-gui-v01.qcow2.bz2<br />
bunzip2 root_fs_ubuntu-10.10-gui-v01.qcow2.bz2<br />
ln -s root_fs_ubuntu-10.10-gui-v01.qcow2 root_fs_ubuntu-gui<br />
<br />
# freebsd server<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-8.1-v01.qcow2.bz2<br />
bunzip2 root_fs_freebsd-8.1-v01.qcow2.bz2<br />
ln -s root_fs_freebsd-8.1-v01.qcow2 root_fs_freebsd<br />
<br />
# freebsd gui<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-8.1-gui-v01.qcow2.bz2<br />
bunzip2 root_fs_freebsd-8.1-gui-v01.qcow2.bz2<br />
ln -s root_fs_freebsd-8.1-gui-v01.qcow2 root_fs_freebsd-gui<br />
<br />
# winxp and win7<br />
# Sorry! Unfortunately for legal reasons we cannot distribute windows XP<br />
# or Windows 7 root filesystems. See VNX documentation for detailed recipes<br />
# to create these root fylesystems from scratch<br />
<br />
</ul><br />
<br />
=== Additional install steps for Dynamips support ===<br />
<br />
* Install Dynamips and Dynagen:<br />
wget http://downloads.sourceforge.net/project/dyna-gen/dynamips%20Linux%20RPM/0.2.8-RC2/dynamips-0.2.8RC2-1.i386.rpm<br />
rpm -i dynamips-0.2.8RC2-1.i386.rpm<br />
wget http://downloads.sourceforge.net/project/dyna-gen/dynagen%20source%20_%20Linux/dynagen%200.11.0/dynagen-0.11.0-1.fc9.noarch.rpm<br />
rpm -i dynagen-0.11.0-1.fc9.noarch.rpm<br />
<br />
* Set execution permissions for the script and add it to system start-up:<br />
chkconfig --add dynamips<br />
/etc/init.d/dynamips start<br />
<br />
* Download and install cisco IOS image:<br />
cd /usr/share/vnx/filesystems<br />
# Cisco image<br />
wget ... c3640-js-mz.124-19.image<br />
ln -s c3640-js-mz.124-19.image c3640<br />
<br />
* Calculate the idle-pc value for your computer following the procedure in http://dynagen.org/tutorial.htm:<br />
dynagen /usr/share/vnx/examples/R.net<br />
console R # type 'no' to exit the config wizard and wait <br />
# for the router to completely start <br />
idle-pc get R<br />
Once you know the idle-pc value for your system, include it in /etc/vnx.conf file.<br />
<br />
=== Additional install steps for Olive support ===<br />
<br />
Several additional steps are needed to support Olive (Juniper) routers in VNX scenarios:<br />
<br />
<ul><br />
<br />
<li>Download old qemu bios from 0.10.6 version and copy it to /usr/share/qemu directory:</li><br />
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.10.6/qemu-kvm-0.10.6.tar.gz<br />
tar xfvz qemu-kvm-0.10.6.tar.gz<br />
cp qemu-kvm-0.10.6/pc-bios/bios.bin /usr/share/qemu/bios-0.10.6.bin<br />
<br />
</ul><br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<!-- COSAS ANTIGUAS --><br />
<br />
<!--li>Modificar vnumlparser.pl, sustituyendo en la función mode_t la línea en ):</li><br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
<br />
por:<br />
<br />
if (! -e "/dev/net/tun") {<br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
}<br />
<br />
Explicación: el módulo tun se ha integrado en el kernel a partir de la 10.04, por lo que no es necesario cargarlo como hasta ahora mediante "modprobe tun". El cambio anterior simplemente comprueba si existe el dispositivo /dev/net/tun y carga el modulo en caso de que no exista.<br />
--><br />
<br />
<br />
<!--li>Modificar vnumlparser.pl, sustituyendo en la función mode_t la línea en ):</li><br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
<br />
por:<br />
<br />
if (! -e "/dev/net/tun") {<br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
}<br />
<br />
Explicación: el módulo tun se ha integrado en el kernel a partir de la 10.04, por lo que no es necesario cargarlo como hasta ahora mediante "modprobe tun". El cambio anterior simplemente comprueba si existe el dispositivo /dev/net/tun y carga el modulo en caso de que no exista.<br />
--><br />
<br />
<!--<br />
Pasos a seguir para instalar VNX sobre Ubuntu 9.10. <br />
<br />
'''Nota importante''': se han detectado importantes problemas de prestaciones cuando se utiliza el sistema de ficheros ext4 con Ubuntu 9.10. Por ello, y hasta que se localice el origen de dichas ineficiencias, se recomienda utilizar ext3. <br />
<ul><br />
<br />
<li> Instalar Ubuntu 9.10 y actualizar con:</li><br />
apt-get update; apt-get dist-upgrade<br />
--><br />
<!--<br />
<li>Añadir repositorios VNUML a /etc/apt/sources.lst:</li><br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian binary/" >> /etc/apt/sources.list<br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian-testing binary/" >> /etc/apt/sources.list<br />
--><br />
<!--<br />
<li>Install paquetes básicos de desarrollo, paquetes de virtualización (qemu-kvm, libvirt, vnuml) y librerías y paquetes auxiliares</li><br />
apt-get update<br />
apt-get install build-essential qemu-kvm libvirt-bin libvirt-dev \<br />
virt-manager virt-viewer vlan xterm bridge-utils screen uml-utilities \<br />
libxml-checker-perl libxml-parser-perl libnetaddr-ip-perl libnet-pcap-perl \<br />
libnet-ipv6addr-perl liberror-perl libexception-class-perl libxml-libxml-perl \<br />
libxml2-dev libgnutls-dev libdevmapper-dev libterm-readline-perl-perl <br />
<br />
<br />
<br />
curl vnuml linux-um <br />
<br />
<li>Si se usa la versión de Ubuntu de 64 bits hay que instalar las librerías de compatibilidad de 32 bits:</li><br />
apt-get install ia32-libs<br />
<br />
<li>Install qemu-kvm version 0.12.4 (version 0.11 which comes as apackage in 9.10 provokes hanging problems in Windows virtual machines when executing commands -something relates apparently with mounting cdroms in vms-):</li><br />
wget http://sourceforge.net/projects/kvm/files/qemu-kvm/0.11.1/qemu-kvm-0.11.1.tar.gz/download<br />
tar xfvz qemu-kvm-0.11.1.tar.gz<br />
cd qemu-kvm-0.11.1<br />
./configure --prefix=/usr && make && make install<br />
ln -s /usr/bin/qemu-system-x86_64 /usr/bin/kvm<br />
Editar /etc/modules y añadir:<br />
kvm <br />
kvm_intel<br />
<br />
wget http://sourceforge.net/projects/kvm/files/kvm-kmod/2.6.31.6b/kvm-kmod-2.6.31.6b.tar.bz2/download<br />
<br />
<li>Instalar libvirt 0.8.0:</li><br />
/etc/init.d/libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.8.0.tar.gz<br />
tar xfvz libvirt-0.8.0.tar.gz<br />
cd libvirt-0.8.0<br />
./configure --prefix=/usr && make && make install<br />
/etc/init.d/libvirt-bin start<br />
<br />
<li> Instalar la librería perl de acceso a libvirt (Sys::Virt) desde CPAN (dicha librería no esta disponible como paquete para Ubuntu 9.10):</li><br />
--><br />
<!-- wget http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.2.2.tar.gz<br />
tar xfvz Sys-Virt-0.2.2.tar.gz <br />
cd Sys-Virt-0.2.2<br />
perl Makefile.PL<br />
make install<br />
--><br />
<!--<br />
perl -MCPAN -e "CPAN::Shell->force(qw(install Sys::Virt));"<br />
Nota: constestar YES a la pregunta "Would you like me to configure as much as posible automatically?" y a "Is it OK to try to connect to the Internet?" <br />
<br />
<li>Instalar rootfilesystem de VNUML, enlaces del kernel y crear clave rsa:</li><br />
cd /usr/share/vnuml/filesystems<br />
wget http://www.dit.upm.es/vnuml/download/scripts/root-fs-installer<br />
perl root-fs-installer<br />
cd ../kernels<br />
ln -s linux-2.6.28.10-1m linux<br />
ssh-keygen -t rsa1<br />
<br />
<li>Instalar VNX:</li><br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-0.12b.tgz<br />
tar xfvz vnx-0.12b.tgz<br />
cd vnx-0.12b<br />
./install-vnx<br />
</ul><br />
<br />
Notas:<br />
http://www.ubuntu-es.org/node/128867<br />
175 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-headers-2.6.32-02063209_2.6.32-02063209_all.deb<br />
176 http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-image-2.6.32-02063209-generic_2.6.32-02063209_amd64.deb<br />
177 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-image-2.6.32-02063209-generic_2.6.32-02063209_amd64.deb<br />
178 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-headers-2.6.32-02063209-generic_2.6.32-02063209_amd64.deb<br />
--><br />
<br />
<!--<br />
=== Sobre Ubuntu 8.04 ===<br />
<br />
Pasos a seguir para instalar VNX sobre Ubuntu 8.04:<br />
<ul><br />
<br />
<li> Instalar Ubuntu 8.04 y actualizar con:</li><br />
apt-get update; apt-get dist-upgrade<br />
Rearrancar la máquina en caso de que se actualice la versión del kernel.<br />
<br />
<li> Añadir repositorio VNUML a /etc/apt/sources.lst:</li><br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian binary/" >> /etc/apt/sources.list<br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian-testing binary/" >> /etc/apt/sources.list<br />
<br />
<li> Instalar paquetes:</li><br />
apt-get update <br />
apt-get install virt-manager virt-viewer build-essential \<br />
libxml-libxml-perl vncviewer vlan xterm bridge-utils screen \<br />
curl vnuml linux-um libterm-readline-perl-perl zlib-bin zlib1g-dev \<br />
libxen3-dev libxml2-dev libgnutls-dev libsasl2-dev libsdl1.2-dev \<br />
libdevmapper-dev dnsmasq xbase-clients pkg-config<br />
<br />
<li>Si se usa la versión de Ubuntu de 64 bits hay que instalar las librerías de compatibilidad de 32 bits:</li><br />
apt-get install ia32-libs<br />
<br />
<li>Instalar qemu-kvm version 0.11.1 (la version 0.12.2 da errores):</li><br />
wget http://sourceforge.net/projects/kvm/files/qemu-kvm/0.11.1/qemu-kvm-0.11.1.tar.gz/download<br />
tar xfvz qemu-kvm-0.11.1.tar.gz<br />
cd qemu-kvm-0.11.1<br />
./configure --prefix=/usr && make && make install<br />
ln -s /usr/bin/qemu-system-x86_64 /usr/bin/kvm<br />
Editar /etc/modules y añadir:<br />
kvm <br />
kvm_intel<br />
<br />
<li>Instalar libvirt 0.7.6:</li><br />
apt-get install libvirt-bin<br />
/etc/init.d/libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.7.6.tar.gz<br />
tar xfvz libvirt-0.7.6.tar.gz<br />
cd libvirt-0.7.6<br />
./configure --prefix=/usr --without-storage-disk && make && make install<br />
/etc/init.d/libvirt-bin start<br />
<br />
<li>Instalar librería perl de acceso a libvirt (Sys::Virt) mediante CPAN (no está disponible como paquete ubuntu)</li><br />
perl -MCPAN -e "CPAN::Shell->force(qw(install Sys::Virt));"<br />
Note: answer NO to the question "Are you ready for manual configuration?"<br />
<br />
<li>Instalar rootfilesystem de VNUML, enlaces del kernel y crear clave rsa:</li><br />
cd /usr/share/vnuml/filesystems<br />
wget http://www.dit.upm.es/vnuml/download/scripts/root-fs-installer<br />
perl root-fs-installer<br />
cd ../kernels<br />
ln -s linux-2.6.28.10-1m linux<br />
ssh-keygen -t rsa1<br />
<br />
<li>Instalar VNX:</li><br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-0.12b.tgz<br />
tar xfvz vnx-0.12b.tgz<br />
cd vnx-0.12b<br />
./install-vnx<br />
</ul><br />
--></div>Davidhttps://web.dit.upm.es/vnumlwiki/index.php?title=Vnx-install&diff=4124Vnx-install2011-03-20T13:43:45Z<p>David: </p>
<hr />
<div>{{Title|VNX (Virtual Networks over X virtualization) v0.14 beta}}<br />
<br />
== Installation over Ubuntu 10.04/9.10 ==<br />
<br />
This section describes the procedure for installing VNX over Ubuntu 10.04 or 9.10. Open a root shell window and follow these steps:<br />
<ul><br />
<br />
<li>Install all packages required (basic development, virtualization, perl libraries and auxiliar packages):</li><br />
apt-get update<br />
apt-get install build-essential qemu-kvm libvirt-bin vlan xterm \<br />
bridge-utils screen virt-manager virt-viewer libxml-checker-perl \<br />
libxml-parser-perl libnetaddr-ip-perl libnet-pcap-perl \<br />
libnet-ipv6addr-perl liberror-perl libexception-class-perl \<br />
uml-utilities libxml-libxml-perl libxml2-dev libgnutls-dev \<br />
libdevmapper-dev libterm-readline-perl-perl libnet-telnet-perl \<br />
libnet-ip-perl libreadonly-perl libmath-round-perl libappconfig-perl \<br />
libdbi-perl graphviz libnl-dev genisoimage gnome-terminal libfile-homedir-perl<br />
<br />
<!--Note: for Ubuntu 9.04 change "qemu-kvm" package by "qemu kvm" --><br />
<li>If you use 64 bits version of Ubuntu, install 32 bits compatibility libraries:</li><br />
apt-get install ia32-libs<br />
<br />
<li>Install libvirt 0.8.5:</li><br />
/etc/init.d/libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.8.5.tar.gz<br />
tar xfvz libvirt-0.8.5.tar.gz<br />
cd libvirt-0.8.5<br />
./configure --without-xen --prefix=/usr && make && make install<br />
/etc/init.d/libvirt-bin start<br />
<br />
'''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.<br />
<br />
<li>Install Sys::Virt perl module:</li><br />
<ul><br />
<li>For Ubuntu 10.04, just install the libsys-virt-perl package</li><br />
apt-get install libsys-virt-perl<br />
<!--<br />
'''IMPORTANT NOTE''': Windows XP virtual machines started with VNX over Ubuntu 9.10 frequently hang when executing commands or with high traffic loads. The problem could be related with virtual network drivers. We are investigating the problem to find a solution. By now, Ubuntu 10.04 is the recomended platform to test VNX.<br />
--><br />
<li>For Ubuntu 9.10, as Sys::Virt library is not available as a package, install it manually:</li><br />
wget http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.2.3.tar.gz<br />
tar xfvz Sys-Virt-0.2.3.tar.gz <br />
cd Sys-Virt-0.2.3<br />
perl Makefile.PL<br />
make install<br />
</ul><br />
<br />
<li>Install VNX:</li><br />
mkdir /tmp/vnx-update<br />
cd /tmp/vnx-update<br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-latest.tgz<br />
tar xfvz vnx-latest.tgz<br />
cd vnx-*<br />
./install_vnx<br />
<br />
<li>Create the VNX config file (/etc/vnx.conf). You just can move the sample config file:</li><br />
mv /etc/vnx.conf.samble /etc/vnx.conf<br />
<br />
<li>Download root file systems from http://idefix.dit.upm.es/download/vnx/filesystems and copy them to /usr/share/vnx/filesystems directory:</li><br />
cd /usr/share/vnx/filesystems<br />
<br />
# ubuntu server<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.10-v01.qcow2.bz2<br />
bunzip2 root_fs_ubuntu-10.10-v01.qcow2.bz2<br />
ln -s root_fs_ubuntu-10.10-v01.qcow2 root_fs_ubuntu<br />
<br />
# ubuntu with gui<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.10-gui-v01.qcow2.bz2<br />
bunzip2 root_fs_ubuntu-10.10-gui-v01.qcow2.bz2<br />
ln -s root_fs_ubuntu-10.10-gui-v01.qcow2 root_fs_ubuntu-gui<br />
<br />
# freebsd server<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-8.1-v01.qcow2.bz2<br />
bunzip2 root_fs_freebsd-8.1-v01.qcow2.bz2<br />
ln -s root_fs_freebsd-8.1-v01.qcow2 root_fs_freebsd<br />
<br />
# freebsd gui<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-8.1-gui-v01.qcow2.bz2<br />
bunzip2 root_fs_freebsd-8.1-gui-v01.qcow2.bz2<br />
ln -s root_fs_freebsd-8.1-gui-v01.qcow2 root_fs_freebsd-gui<br />
<br />
# winxp and win7<br />
# Sorry! Unfortunately for legal reasons we cannot distribute windows XP<br />
# or Windows 7 root filesystems. See VNX documentation for detailed recipes<br />
# to create these root fylesystems from scratch<br />
<br />
<li>Additionally, if you plan to use VNUML root filesystem:</li><br />
# VNUML root_fs_tutorial and kernel<br />
cd /usr/share/vnx/filesystems<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_tutorial-0.6.0.bz2<br />
bunzip2 root_fs_tutorial-0.6.0.bz2<br />
ln -s root_fs_tutorial-0.6.0 root_fs_tutorial<br />
cd /usr/share/vnx/kernels<br />
wget -N http://jungla.dit.upm.es/~vnx/download/kernels/linux-2.6.18.1-bb2-xt-4m<br />
chmod +x linux-2.6.18.1-bb2-xt-4m<br />
ln -s linux-2.6.18.1-bb2-xt-4m linux<br />
<br />
</ul><br />
<br />
'''NOTE for Ubuntu 10.04.1''': It seems that an additional package has to be installed:<br />
apt-get install kvm-pxe<br />
<br />
=== Additional install steps for Dynamips support ===<br />
<br />
* Install Dynamips and Dynagen:<br />
apt-get install dynamips dynagen<br />
<br />
* Create a file /etc/init.d/dynamips (taken from http://7200emu.hacki.at/viewtopic.php?t=2198):<br />
<pre><br />
#!/bin/sh<br />
# Start/stop the dynamips program as a daemon.<br />
#<br />
### BEGIN INIT INFO<br />
# Provides: dynamips<br />
# Default-Start: 2 3 4 5<br />
# Default-Stop: 0 1 6<br />
# Short-Description: Cisco hardware emulator daemon<br />
### END INIT INFO<br />
<br />
DAEMON=/usr/bin/dynamips<br />
NAME=dynamips<br />
PORT=7200<br />
PIDFILE=/var/run/$NAME.pid <br />
LOGFILE=/var/log/$NAME.log<br />
DESC="Cisco Emulator"<br />
SCRIPTNAME=/etc/init.d/$NAME<br />
<br />
test -f $DAEMON || exit 0<br />
<br />
. /lib/lsb/init-functions<br />
<br />
<br />
case "$1" in<br />
start) log_daemon_msg "Starting $DESC " "$NAME"<br />
start-stop-daemon --start --chdir /tmp --background --make-pidfile --pidfile $PIDFILE --name $NAME --startas $DAEMON -- -H $PORT -l $LOGFILE<br />
log_end_msg $?<br />
;;<br />
stop) log_daemon_msg "Stopping $DESC " "$NAME"<br />
start-stop-daemon --stop --quiet --pidfile $PIDFILE --name $NAME<br />
log_end_msg $?<br />
;;<br />
restart) log_daemon_msg "Restarting $DESC " "$NAME"<br />
start-stop-daemon --stop --retry 5 --quiet --pidfile $PIDFILE --name $NAME<br />
start-stop-daemon --start --chdir /tmp --background --make-pidfile --pidfile $PIDFILE --name $NAME --startas $DAEMON -- -H $PORT -l $LOGFILE<br />
log_end_msg $?<br />
;;<br />
status)<br />
status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $? <br />
#status $NAME<br />
#RETVAL=$?<br />
;; <br />
*) log_action_msg "Usage: $SCRIPTNAME {start|stop|restart|status}"<br />
exit 2<br />
;;<br />
esac<br />
exit 0<br />
<br />
</pre><br />
<br />
* Set execution permissions for the script and add it to system start-up:<br />
chmod +x /etc/init.d/dynamips<br />
update-rc.d dynamips defaults<br />
/etc/init.d/dynamips start<br />
<br />
* Download and install cisco IOS image:<br />
cd /usr/share/vnx/filesystems<br />
# Cisco image<br />
wget ... c3640-js-mz.124-19.image<br />
ln -s c3640-js-mz.124-19.image c3640<br />
<br />
* Calculate the idle-pc value for your computer following the procedure in http://dynagen.org/tutorial.htm:<br />
dynagen /usr/share/vnx/examples/R.net<br />
console R # type 'no' to exit the config wizard and wait <br />
# for the router to completely start <br />
idle-pc get R<br />
Once you know the idle-pc value for your system, include it in /etc/vnx.conf file.<br />
<br />
=== Additional install steps for Olive support ===<br />
<br />
Several additional steps are needed to support Olive (Juniper) routers in VNX scenarios:<br />
<br />
<ul><br />
<br />
<!-- Ya no hace falta desde que se usa <qemu:commandline><br />
<br />
<li>Install a patched version of libvirt 0.8.5 with support to define the bios used by a virtual machine:</li><br />
<br />
<ul><br />
<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><br />
<pre><br />
diff -crB libvirt-0.8.5.orig/src/conf/domain_conf.c libvirt-0.8.5/src/conf/domain_conf.c<br />
*** libvirt-0.8.5.orig/src/conf/domain_conf.c 2010-11-22 11:38:08.000000000 +0100<br />
--- libvirt-0.8.5/src/conf/domain_conf.c 2010-11-22 11:47:41.000000000 +0100<br />
***************<br />
*** 4267,4272 ****<br />
--- 4267,4274 ----<br />
if (node)<br />
def->mem.hugepage_backed = 1;<br />
<br />
+ def->biosfile = virXPathString("string(./biosfile[1])", ctxt);<br />
+ <br />
/* Extract other memory tunables */<br />
if (virXPathULong("string(./memtune/hard_limit)", ctxt,<br />
&def->mem.hard_limit) < 0)<br />
diff -crB libvirt-0.8.5.orig/src/conf/domain_conf.h libvirt-0.8.5/src/conf/domain_conf.h<br />
*** libvirt-0.8.5.orig/src/conf/domain_conf.h 2010-11-22 11:38:08.000000000 +0100<br />
--- libvirt-0.8.5/src/conf/domain_conf.h 2010-11-22 11:40:18.000000000 +0100<br />
***************<br />
*** 885,890 ****<br />
--- 885,891 ----<br />
unsigned long min_guarantee;<br />
unsigned long swap_hard_limit;<br />
} mem;<br />
+ char *biosfile;<br />
unsigned short vcpus;<br />
unsigned short maxvcpus;<br />
int cpumasklen;<br />
diff -crB libvirt-0.8.5.orig/src/qemu/qemu_conf.c libvirt-0.8.5/src/qemu/qemu_conf.c<br />
*** libvirt-0.8.5.orig/src/qemu/qemu_conf.c 2010-11-22 11:38:08.000000000 +0100<br />
--- libvirt-0.8.5/src/qemu/qemu_conf.c 2010-11-22 11:41:05.000000000 +0100<br />
***************<br />
*** 3984,3989 ****<br />
--- 3984,3995 ----<br />
ADD_ARG_LIT(emulator);<br />
ADD_ARG_LIT("-S");<br />
<br />
+ if(def->biosfile)<br />
+ {<br />
+ ADD_ARG_LIT("-bios");<br />
+ ADD_ARG_LIT(def->biosfile);<br />
+ }<br />
+ <br />
/* This should *never* be NULL, since we always provide<br />
* a machine in the capabilities data for QEMU. So this<br />
* check is just here as a safety in case the unexpected<br />
</pre><br />
<br />
<li>Install libvirt 0.8.5 with that patch applied:</li><br />
service libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.8.5.tar.gz<br />
tar xfvz libvirt-0.8.5.tar.gz <br />
cd libvirt-0.8.5<br />
patch -p1 -i ../libvirt-0.8.5-biosfile.patch <br />
./configure --without-xen --prefix=/usr && make && make install<br />
service libvirt-bin start<br />
<br />
</ul><br />
--><br />
<li>Download old qemu bios from 0.10.6 version and copy it to /usr/share/qemu directory:</li><br />
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.10.6/qemu-kvm-0.10.6.tar.gz<br />
tar xfvz qemu-kvm-0.10.6.tar.gz<br />
cp qemu-kvm-0.10.6/pc-bios/bios.bin /usr/share/qemu-kvm/bios-0.10.6.bin<br />
<br />
<!-- Not needed, it seems to work without downloading this drivers<br />
<li>Download i82559 ROM from the latest qemu versions (Ubuntu 10.04 does not include that ROM in qemu-kvm package):</li><br />
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.12.5/qemu-kvm-0.12.5.tar.gz<br />
tar xfvz qemu-kvm-0.12.5.tar.gz<br />
cp qemu-kvm-0.12.5/pc-bios/pxe-i82559er.bin /usr/share/qemu-kvm/<br />
--><br />
</ul><br />
<br />
== Installation over Fedora 11 (Draft) ==<br />
<br />
Follow this steps to install VNX over Fedora 11:<br />
<ul><br />
<br />
<li>Install packages:</li><br />
yum -y groupinstall "Development Tools"<br />
yum install qemu-kvm libvirt virt-manager virt-viewer perl-XML-LibXML<br />
yum install perl-XML-DOM perl-NetAddr-IP perl-Readonly perl-TermReadKey<br />
yum install perl-Net-Pcap perl-Net-IPv6Addr perl-Net-Telnet perl-Error<br />
yum install perl-Exception-Class perl-ExtUtils-MakeMaker tunctl screen wget<br />
yum install libxml2-devel gnutls-devel device-mapper-devel uml_utilities <br />
yum install roxterm xterm graphviz perl-AppConfig<br />
<br />
<li>Install libvirt 0.8.5:</li><br />
/etc/init.d/libvirtd stop<br />
wget http://libvirt.org/sources/libvirt-0.8.5.tar.gz<br />
tar xfvz libvirt-0.8.5.tar.gz<br />
cd libvirt-0.8.5<br />
./configure --without-xen --prefix=/usr && make && make install<br />
/etc/init.d/libvirtd start<br />
<br />
<li>Install SysVirt manually:</li><br />
wget http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.2.4.tar.gz<br />
tar xfvz Sys-Virt-0.2.4.tar.gz<br />
cd Sys-Virt-0.2.4<br />
perl Makefile.PL<br />
make install<br />
<!--<br />
<li> Instalar VNUML sobre Fedora 11 siguiendo la receta en http://www.dit.upm.es/vnumlwiki/index.php/Fedora11</li><br />
<br />
<li> Instalar paquetes y librerías necesarias:</li><br />
yum install qemu-kvm libvirt virt-manager virt-viewer perl-XML-LibXML perl-Sys-Virt<br />
yum -y install bridge-utils readline-devel perl-Module-Build screen expat-devel libpcap-devel <br />
yum -y install perl-Net-Pcap perl-NetAddr-IP perl-Net-IPv6Addr perl-XML-DOM perl-Exception-Class<br />
yum -y install perl-TermReadKey perl-Error perl-CPAN uml_utilities xterm tunctl<br />
<br />
<li>Install XML::Checker perl library:</li><br />
perl -MCPAN -e shell<br />
install XML::Checker<br />
--><br />
<li>Add symbolic link for kvm:</li><br />
ln -s /usr/bin/qemu-kvm /usr/bin/kvm<br />
<br />
<li>Install VNX:</li><br />
mkdir /tmp/vnx-update<br />
cd /tmp/vnx-update<br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-latest.tgz<br />
tar xfvz vnx-latest.tgz<br />
cd vnx-*<br />
./install_vnx<br />
<br />
<li>Create the VNX config file (/etc/vnx.conf). You just can move the sample config file:</li><br />
mv /etc/vnx.conf.samble /etc/vnx.conf<br />
<br />
<li>Disable host firewall or, alternatively, configure "tun" type network interfaces as trusted interfaces (System->Firewall->Trusted Interfaces).</li><br />
<br />
<li>Download root file systems from http://idefix.dit.upm.es/download/vnx/filesystems and copy them to /usr/share/vnx/filesystems directory:</li><br />
cd /usr/share/vnx/filesystems<br />
<br />
# ubuntu server<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.10-v01.qcow2.bz2<br />
bunzip2 root_fs_ubuntu-10.10-v01.qcow2.bz2<br />
ln -s root_fs_ubuntu-10.10-v01.qcow2 root_fs_ubuntu<br />
<br />
# ubuntu with gui<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.10-gui-v01.qcow2.bz2<br />
bunzip2 root_fs_ubuntu-10.10-gui-v01.qcow2.bz2<br />
ln -s root_fs_ubuntu-10.10-gui-v01.qcow2 root_fs_ubuntu-gui<br />
<br />
# freebsd server<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-8.1-v01.qcow2.bz2<br />
bunzip2 root_fs_freebsd-8.1-v01.qcow2.bz2<br />
ln -s root_fs_freebsd-8.1-v01.qcow2 root_fs_freebsd<br />
<br />
# freebsd gui<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-8.1-gui-v01.qcow2.bz2<br />
bunzip2 root_fs_freebsd-8.1-gui-v01.qcow2.bz2<br />
ln -s root_fs_freebsd-8.1-gui-v01.qcow2 root_fs_freebsd-gui<br />
<br />
# winxp and win7<br />
# Sorry! Unfortunately for legal reasons we cannot distribute windows XP<br />
# or Windows 7 root filesystems. See VNX documentation for detailed recipes<br />
# to create these root fylesystems from scratch<br />
<br />
</ul><br />
<br />
=== Additional install steps for Dynamips support ===<br />
<br />
* Install Dynamips and Dynagen:<br />
wget http://downloads.sourceforge.net/project/dyna-gen/dynamips%20Linux%20RPM/0.2.8-RC2/dynamips-0.2.8RC2-1.i386.rpm<br />
rpm -i dynamips-0.2.8RC2-1.i386.rpm<br />
wget http://downloads.sourceforge.net/project/dyna-gen/dynagen%20source%20_%20Linux/dynagen%200.11.0/dynagen-0.11.0-1.fc9.noarch.rpm<br />
rpm -i dynagen-0.11.0-1.fc9.noarch.rpm<br />
<br />
* Set execution permissions for the script and add it to system start-up:<br />
chkconfig --add dynamips<br />
/etc/init.d/dynamips start<br />
<br />
* Download and install cisco IOS image:<br />
cd /usr/share/vnx/filesystems<br />
# Cisco image<br />
wget ... c3640-js-mz.124-19.image<br />
ln -s c3640-js-mz.124-19.image c3640<br />
<br />
* Calculate the idle-pc value for your computer following the procedure in http://dynagen.org/tutorial.htm:<br />
dynagen /usr/share/vnx/examples/R.net<br />
console R # type 'no' to exit the config wizard and wait <br />
# for the router to completely start <br />
idle-pc get R<br />
Once you know the idle-pc value for your system, include it in /etc/vnx.conf file.<br />
<br />
=== Additional install steps for Olive support ===<br />
<br />
Several additional steps are needed to support Olive (Juniper) routers in VNX scenarios:<br />
<br />
<ul><br />
<br />
<li>Download old qemu bios from 0.10.6 version and copy it to /usr/share/qemu directory:</li><br />
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.10.6/qemu-kvm-0.10.6.tar.gz<br />
tar xfvz qemu-kvm-0.10.6.tar.gz<br />
cp qemu-kvm-0.10.6/pc-bios/bios.bin /usr/share/qemu/bios-0.10.6.bin<br />
<br />
</ul><br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<!-- COSAS ANTIGUAS --><br />
<br />
<!--li>Modificar vnumlparser.pl, sustituyendo en la función mode_t la línea en ):</li><br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
<br />
por:<br />
<br />
if (! -e "/dev/net/tun") {<br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
}<br />
<br />
Explicación: el módulo tun se ha integrado en el kernel a partir de la 10.04, por lo que no es necesario cargarlo como hasta ahora mediante "modprobe tun". El cambio anterior simplemente comprueba si existe el dispositivo /dev/net/tun y carga el modulo en caso de que no exista.<br />
--><br />
<br />
<br />
<!--li>Modificar vnumlparser.pl, sustituyendo en la función mode_t la línea en ):</li><br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
<br />
por:<br />
<br />
if (! -e "/dev/net/tun") {<br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
}<br />
<br />
Explicación: el módulo tun se ha integrado en el kernel a partir de la 10.04, por lo que no es necesario cargarlo como hasta ahora mediante "modprobe tun". El cambio anterior simplemente comprueba si existe el dispositivo /dev/net/tun y carga el modulo en caso de que no exista.<br />
--><br />
<br />
<!--<br />
Pasos a seguir para instalar VNX sobre Ubuntu 9.10. <br />
<br />
'''Nota importante''': se han detectado importantes problemas de prestaciones cuando se utiliza el sistema de ficheros ext4 con Ubuntu 9.10. Por ello, y hasta que se localice el origen de dichas ineficiencias, se recomienda utilizar ext3. <br />
<ul><br />
<br />
<li> Instalar Ubuntu 9.10 y actualizar con:</li><br />
apt-get update; apt-get dist-upgrade<br />
--><br />
<!--<br />
<li>Añadir repositorios VNUML a /etc/apt/sources.lst:</li><br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian binary/" >> /etc/apt/sources.list<br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian-testing binary/" >> /etc/apt/sources.list<br />
--><br />
<!--<br />
<li>Install paquetes básicos de desarrollo, paquetes de virtualización (qemu-kvm, libvirt, vnuml) y librerías y paquetes auxiliares</li><br />
apt-get update<br />
apt-get install build-essential qemu-kvm libvirt-bin libvirt-dev \<br />
virt-manager virt-viewer vlan xterm bridge-utils screen uml-utilities \<br />
libxml-checker-perl libxml-parser-perl libnetaddr-ip-perl libnet-pcap-perl \<br />
libnet-ipv6addr-perl liberror-perl libexception-class-perl libxml-libxml-perl \<br />
libxml2-dev libgnutls-dev libdevmapper-dev libterm-readline-perl-perl <br />
<br />
<br />
<br />
curl vnuml linux-um <br />
<br />
<li>Si se usa la versión de Ubuntu de 64 bits hay que instalar las librerías de compatibilidad de 32 bits:</li><br />
apt-get install ia32-libs<br />
<br />
<li>Install qemu-kvm version 0.12.4 (version 0.11 which comes as apackage in 9.10 provokes hanging problems in Windows virtual machines when executing commands -something relates apparently with mounting cdroms in vms-):</li><br />
wget http://sourceforge.net/projects/kvm/files/qemu-kvm/0.11.1/qemu-kvm-0.11.1.tar.gz/download<br />
tar xfvz qemu-kvm-0.11.1.tar.gz<br />
cd qemu-kvm-0.11.1<br />
./configure --prefix=/usr && make && make install<br />
ln -s /usr/bin/qemu-system-x86_64 /usr/bin/kvm<br />
Editar /etc/modules y añadir:<br />
kvm <br />
kvm_intel<br />
<br />
wget http://sourceforge.net/projects/kvm/files/kvm-kmod/2.6.31.6b/kvm-kmod-2.6.31.6b.tar.bz2/download<br />
<br />
<li>Instalar libvirt 0.8.0:</li><br />
/etc/init.d/libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.8.0.tar.gz<br />
tar xfvz libvirt-0.8.0.tar.gz<br />
cd libvirt-0.8.0<br />
./configure --prefix=/usr && make && make install<br />
/etc/init.d/libvirt-bin start<br />
<br />
<li> Instalar la librería perl de acceso a libvirt (Sys::Virt) desde CPAN (dicha librería no esta disponible como paquete para Ubuntu 9.10):</li><br />
--><br />
<!-- wget http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.2.2.tar.gz<br />
tar xfvz Sys-Virt-0.2.2.tar.gz <br />
cd Sys-Virt-0.2.2<br />
perl Makefile.PL<br />
make install<br />
--><br />
<!--<br />
perl -MCPAN -e "CPAN::Shell->force(qw(install Sys::Virt));"<br />
Nota: constestar YES a la pregunta "Would you like me to configure as much as posible automatically?" y a "Is it OK to try to connect to the Internet?" <br />
<br />
<li>Instalar rootfilesystem de VNUML, enlaces del kernel y crear clave rsa:</li><br />
cd /usr/share/vnuml/filesystems<br />
wget http://www.dit.upm.es/vnuml/download/scripts/root-fs-installer<br />
perl root-fs-installer<br />
cd ../kernels<br />
ln -s linux-2.6.28.10-1m linux<br />
ssh-keygen -t rsa1<br />
<br />
<li>Instalar VNX:</li><br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-0.12b.tgz<br />
tar xfvz vnx-0.12b.tgz<br />
cd vnx-0.12b<br />
./install-vnx<br />
</ul><br />
<br />
Notas:<br />
http://www.ubuntu-es.org/node/128867<br />
175 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-headers-2.6.32-02063209_2.6.32-02063209_all.deb<br />
176 http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-image-2.6.32-02063209-generic_2.6.32-02063209_amd64.deb<br />
177 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-image-2.6.32-02063209-generic_2.6.32-02063209_amd64.deb<br />
178 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-headers-2.6.32-02063209-generic_2.6.32-02063209_amd64.deb<br />
--><br />
<br />
<!--<br />
=== Sobre Ubuntu 8.04 ===<br />
<br />
Pasos a seguir para instalar VNX sobre Ubuntu 8.04:<br />
<ul><br />
<br />
<li> Instalar Ubuntu 8.04 y actualizar con:</li><br />
apt-get update; apt-get dist-upgrade<br />
Rearrancar la máquina en caso de que se actualice la versión del kernel.<br />
<br />
<li> Añadir repositorio VNUML a /etc/apt/sources.lst:</li><br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian binary/" >> /etc/apt/sources.list<br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian-testing binary/" >> /etc/apt/sources.list<br />
<br />
<li> Instalar paquetes:</li><br />
apt-get update <br />
apt-get install virt-manager virt-viewer build-essential \<br />
libxml-libxml-perl vncviewer vlan xterm bridge-utils screen \<br />
curl vnuml linux-um libterm-readline-perl-perl zlib-bin zlib1g-dev \<br />
libxen3-dev libxml2-dev libgnutls-dev libsasl2-dev libsdl1.2-dev \<br />
libdevmapper-dev dnsmasq xbase-clients pkg-config<br />
<br />
<li>Si se usa la versión de Ubuntu de 64 bits hay que instalar las librerías de compatibilidad de 32 bits:</li><br />
apt-get install ia32-libs<br />
<br />
<li>Instalar qemu-kvm version 0.11.1 (la version 0.12.2 da errores):</li><br />
wget http://sourceforge.net/projects/kvm/files/qemu-kvm/0.11.1/qemu-kvm-0.11.1.tar.gz/download<br />
tar xfvz qemu-kvm-0.11.1.tar.gz<br />
cd qemu-kvm-0.11.1<br />
./configure --prefix=/usr && make && make install<br />
ln -s /usr/bin/qemu-system-x86_64 /usr/bin/kvm<br />
Editar /etc/modules y añadir:<br />
kvm <br />
kvm_intel<br />
<br />
<li>Instalar libvirt 0.7.6:</li><br />
apt-get install libvirt-bin<br />
/etc/init.d/libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.7.6.tar.gz<br />
tar xfvz libvirt-0.7.6.tar.gz<br />
cd libvirt-0.7.6<br />
./configure --prefix=/usr --without-storage-disk && make && make install<br />
/etc/init.d/libvirt-bin start<br />
<br />
<li>Instalar librería perl de acceso a libvirt (Sys::Virt) mediante CPAN (no está disponible como paquete ubuntu)</li><br />
perl -MCPAN -e "CPAN::Shell->force(qw(install Sys::Virt));"<br />
Note: answer NO to the question "Are you ready for manual configuration?"<br />
<br />
<li>Instalar rootfilesystem de VNUML, enlaces del kernel y crear clave rsa:</li><br />
cd /usr/share/vnuml/filesystems<br />
wget http://www.dit.upm.es/vnuml/download/scripts/root-fs-installer<br />
perl root-fs-installer<br />
cd ../kernels<br />
ln -s linux-2.6.28.10-1m linux<br />
ssh-keygen -t rsa1<br />
<br />
<li>Instalar VNX:</li><br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-0.12b.tgz<br />
tar xfvz vnx-0.12b.tgz<br />
cd vnx-0.12b<br />
./install-vnx<br />
</ul><br />
--></div>Davidhttps://web.dit.upm.es/vnumlwiki/index.php?title=Vnx-rootfsubuntu&diff=4123Vnx-rootfsubuntu2011-03-14T23:52:59Z<p>David: </p>
<hr />
<div>{{Title|How to create a Ubuntu root-file-system for VNX}}<br />
<br />
Follow this procedure to create a Ubuntu based root-file-system for VNX. The procedure has been tested with Ubuntu 9.10 and 10.04.<br />
<ul><br />
<li>Create the filesystem disk image:</li><br />
qemu-img create -f qcow2 root_fs_ubuntu-base.qcow2 5GB<br />
<li>Get Ubuntu installation CD. For example:</li><br />
wget ftp://ftp.rediris.es/mirror/ubuntu-releases/10.04.1/ubuntu-10.04.1-server-i386.iso<br />
cp ubuntu-10.04.1-server-i386.iso /almacen/iso<br />
<li>Create a libvirt XML definition (root_fs_ubuntu.xml) containing the virtual machine description:</li><br />
<pre><br />
<domain type='kvm'><br />
<name>Ubuntu</name><br />
<memory>524288</memory><br />
<vcpu>1</vcpu><br />
<os><br />
<type arch="i686">hvm</type><br />
<boot dev='hd'/><br />
<boot dev='cdrom'/><br />
</os><br />
<features><br />
<pae/><br />
<acpi/><br />
<apic/><br />
</features><br />
<clock sync="localtime"/><br />
<devices><br />
<emulator>/usr/bin/kvm</emulator><br />
<disk type='file' device='disk'><br />
<source file='/usr/share/vnx/filesystems/root_fs_ubuntu-base.qcow2'/><br />
<target dev='hda'/><br />
<driver name="qemu" type="qcow2"/><br />
</disk><br />
<disk type='file' device='cdrom'><br />
<source file='/almacen/iso/ubuntu-10.04.1-server-i386.iso'/><br />
<target dev='hdb'/><br />
</disk><br />
<interface type='network'><br />
<source network='default'/><br />
</interface><br />
<graphics type='vnc'/><br />
</devices><br />
</domain><br />
</pre><br />
Note: change "source file=" lines to whatever fits your case (use full paths). <br />
<br />
<li>Start the virtual machine with:</li><br />
virsh create root_fs_ubuntu.xml<br />
<li>Access virtual machine console with:</li><br />
virt-viewer Ubuntu<br />
Note: alternative you can start the machine and open the console at the same time with the command:<br />
/usr/share/vnx/bin/vnx_modify_rootfs root_fs_ubuntu.xml<br />
<li>Follow Ubuntu installation menus to install a basic system with ssh server. Once the installation is finished, stop the machine and edit root_fs_ubuntu.xml file and comment the following line in cdrom disk specification:</li><br />
<pre><br />
<!--source file='/almacen/iso/ubuntu-10.04-server-i386.iso'/--><br />
</pre><br />
<li>Start the virtual machine again and finish the installation:</li><br />
<ul><br />
<li>Access the console and sudo root: </li><br />
sudo su<br />
<li>Update the system</li><br />
apt-get update<br />
apt-get dist-upgrade<br />
<li>Install XML::DOM perl package and ACPI daemon:</li><br />
apt-get install libxml-dom-perl acpid<br />
<li>Only for Ubuntu 10.04:</li><br />
<ul><br />
<li>create /media/cdrom* directories:</li><br />
mkdir /media/cdrom0<br />
mkdir /media/cdrom1<br />
ln -s /media/cdrom0 /media/cdrom<br />
ln -s /cdrom /media/cdrom<br />
<li>add the following lines to /etc/fstab:</li><br />
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0<br />
/dev/scd1 /media/cdrom1 udf,iso9660 user,noauto,exec,utf8 0 0<br />
</ul><br />
<li>Configure a serial console on ttyS0:</li><br />
cd /etc/init<br />
cp tty1.conf ttyS0.conf<br />
sed -i -e 's/tty1/ttyS0/' ttyS0.conf<br />
<li>Activate startup traces on serial console by editting /boot/grub/grub.cfg file and adding "console=ttyS0" to the linux line. For example:</li><br />
linux /boot/vmlinuz-2.6.35-25-generic-pae root=UUID=eb1a0afb-48b2-4e42-ba6d-22bfae1055f3 ro quiet console=ttyS0<br />
<li>Install VNX autoconfiguration daemon:</li><br />
<ul><br />
<li>From the host execute:</li><br />
/usr/share/vnx/bin/vnx_update_aced Ubuntu /usr/share/vnx/aced/vnx-aced-lf-0.1b.tgz <br />
<li>From the virtual machine console:</li><br />
mount /media/cdrom<br />
/media/cdrom/install_vnxdaemon<br />
</ul><br />
<li>Delete udev rules files:</li><br />
rm /etc/udev/rules.d/70-persistent-net.rules<br />
rm /etc/udev/rules.d/70-persistent-cd.rules<br />
<li>Optional: install graphical user interface.</li><br />
<ul><br />
<li>Minimal:</li><br />
sudo apt-get install xorg gnome-core gksu gdm gnome-system-tools gnome-nettool firefox-gnome-support<br />
<li>Complete:</li><br />
sudo apt-get install ubuntu-desktop<br />
</ul><br />
<li>Optional: install other services:</li><br />
<ul><br />
<li>Apache server:</li><br />
sudo apt-get install apache2<br />
update-rc.d -f apache2 remove # to avoid automatic start<br />
<li>Other network tools</li><br />
sudo apt-get install traceroute<br />
</ul><br />
<li>Stop the machine with:</li><br />
halt<br />
</ul><br />
</ul><br />
<br />
If everything went well, your root filesystem will be ready to be used with VNX. You can make a simple test using the simple_ubuntu.xml scenario distributed with VNX. <br />
<br />
=== Installing additional software ===<br />
<br />
To install additional software or modify your root file system, you just have to start it as described above and make the operations required on the filesystem.<br />
* Start the virtual machine (directly using virsh or the vnx_modify_rootfs utility):<br />
/usr/share/vnx/bin/vnx_modify_rootfs root_fs_ubuntu.xml <br />
* Install the software:<br />
apt-get install ...<br />
* Delete udev rules files:<br />
rm /etc/udev/rules.d/70-persistent-net.rules<br />
rm /etc/udev/rules.d/70-persistent-cd.rules<br />
* Stop the machine with:<br />
halt<br />
<br />
=== Updating ACE daemon ===<br />
<br />
If you have a root filesystem with the autoconfiguration and command execution daemon (ACE) already installed, you can use the autoupdate functionallity to update the daemon to a newer version. Just follow this procedure:<br />
<br />
* Edit the xml described above and comment the line defining the Ubuntu iso file for the cdrom:<br />
<!--source file='/almacen/iso/ubuntu-10.04-server-i386.iso'/--><br />
* Start the virtual machine (directly using virsh or the vnx_modify_rootfs utility):<br />
/usr/share/vnx/bin/vnx_modify_rootfs root_fs_ubuntu.xml <br />
* Execute the update utility:<br />
/usr/share/vnx/bin/vnx_update_aced Ubuntu /usr/share/vnx/aced/vnx-aced-lf-0.1b.tgz <br />
* Once the ace daemon is updated the virtual machine will be rebooted automatically.<br />
<br />
=== Known problems ===<br />
<br />
<ul><br />
<li>Each a cdrom is mounted (for example, ehenever a command is executed on the virtual machine) the following error appear in the console:</li><br />
<pre><br />
Jul 27 22:33:31 vnx kernel: [ 4384.875886] ata1.01: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6<br />
Jul 27 22:33:31 vnx kernel: [ 4385.291374] ata1.01: BMDMA stat 0x5<br />
Jul 27 22:33:31 vnx kernel: [ 4385.493411] sr 0:0:1:0: [sr0] CDB: Read(10): 28 00 00 00 00 18 00 00 01 00<br />
Jul 27 22:33:31 vnx kernel: [ 4385.493460] ata1.01: cmd a0/01:00:00:00:08/00:00:00:00:00/b0 tag 0 dma 2048 in<br />
Jul 27 22:33:31 vnx kernel: [ 4385.493461] res 01/60:00:00:00:08/00:00:00:00:00/b0 Emask 0x3 (HSM violation)<br />
Jul 27 22:33:31 vnx kernel: [ 4386.263553] ata1.01: status: { ERR }<br />
</pre><br />
However, the command are executed correctly. This error does not appear on Ubuntu 9.10 filesystems.<br />
<br />
</ul></div>Davidhttps://web.dit.upm.es/vnumlwiki/index.php?title=VNX&diff=4122VNX2011-03-03T16:25:08Z<p>David: /* Downloading VNX */</p>
<hr />
<div>{{Title|VNX Project Documentation}}<br />
<br />
'''VNX (Virtualization over X)''' is the new release of the '''VNUML''' tool. VNX brings important new functionalities that overcome the most important limitations VNUML tool has:<br />
* Integration of new virtualization platforms to allow virtual machines running other operating systems (Windows, FreeBSD, etc) apart from Linux. In this sense:<br />
** VNX uses [http://libvirt.org libvirt] to interact with the virtualization capabilities, allowing the use of most of the virtualization platforms available for Linux (KVM, Xen, etc)<br />
** Integrates [http://www.ipflow.utc.fr/blog/ Dynamips] to allow limited emulation of CISCO routers<br />
* Restart of individual virtual machines<br />
* Autoconfiguration and command execution capabilities for several operating systems: Linux, FreeBSD and Windows (XP and 7).<br />
<br />
== Information for users ==<br />
* [[vnx-install|VNX Installation Guide]]<br />
* [[vnx-examples|Example scenarios]]<br />
* [[vnx-troubleshooting|Troubleshooting]]<br />
* Rootfilesystem creation How-to's:<br />
** [[vnx-rootfswinxp|How to create a Windows XP rootfilesystem for VNX]]<br />
** [[vnx-rootfswin7|How to create a Windows 7 rootfilesystem for VNX]]<br />
** [[vnx-rootfsubuntu|How to create a Ubuntu rootfilesytem for VNX]]<br />
** [[vnx-rootfsfreebsd|How to create a FreeBSD rootfilesytem for VNX]]<br />
** [[vnx-rootfsolive|How to create an Olive (juniper router) rootfilesystem for VNX]]<br />
<br />
== Downloading VNX ==<br />
<br />
You can download VNX from http://idefix.dit.upm.es/download/vnx<br />
<br />
VNX Root filesystems are temporarily hosted in http://idefix.dit.upm.es/download/vnx/filesystems</div>Davidhttps://web.dit.upm.es/vnumlwiki/index.php?title=VNX&diff=4121VNX2011-03-03T16:24:46Z<p>David: /* Downloading VNX */</p>
<hr />
<div>{{Title|VNX Project Documentation}}<br />
<br />
'''VNX (Virtualization over X)''' is the new release of the '''VNUML''' tool. VNX brings important new functionalities that overcome the most important limitations VNUML tool has:<br />
* Integration of new virtualization platforms to allow virtual machines running other operating systems (Windows, FreeBSD, etc) apart from Linux. In this sense:<br />
** VNX uses [http://libvirt.org libvirt] to interact with the virtualization capabilities, allowing the use of most of the virtualization platforms available for Linux (KVM, Xen, etc)<br />
** Integrates [http://www.ipflow.utc.fr/blog/ Dynamips] to allow limited emulation of CISCO routers<br />
* Restart of individual virtual machines<br />
* Autoconfiguration and command execution capabilities for several operating systems: Linux, FreeBSD and Windows (XP and 7).<br />
<br />
== Information for users ==<br />
* [[vnx-install|VNX Installation Guide]]<br />
* [[vnx-examples|Example scenarios]]<br />
* [[vnx-troubleshooting|Troubleshooting]]<br />
* Rootfilesystem creation How-to's:<br />
** [[vnx-rootfswinxp|How to create a Windows XP rootfilesystem for VNX]]<br />
** [[vnx-rootfswin7|How to create a Windows 7 rootfilesystem for VNX]]<br />
** [[vnx-rootfsubuntu|How to create a Ubuntu rootfilesytem for VNX]]<br />
** [[vnx-rootfsfreebsd|How to create a FreeBSD rootfilesytem for VNX]]<br />
** [[vnx-rootfsolive|How to create an Olive (juniper router) rootfilesystem for VNX]]<br />
<br />
== Downloading VNX ==<br />
<br />
You can download VNX from http://idefix.dit.upm.es/vnx/download<br />
<br />
VNX Root filesystems are temporarily hosted in http://idefix.dit.upm.es/download/vnx/filesystems</div>Davidhttps://web.dit.upm.es/vnumlwiki/index.php?title=Vnx-examples&diff=4120Vnx-examples2011-02-25T00:10:05Z<p>David: /* Simple scenarios (simple_XXXX.xml) */</p>
<hr />
<div>{{Title|VNX Example Scenarios}}<br />
<br />
Several example scenarios are distributed together with VNX to allow easily testing its functionalities (see /usr/share/vnx/examples directory).<br />
<br />
Three types of scenarios are included:<br />
<ul><br />
<li> '''simple-XXXX.xml''', which are a set of simple scenarios made of one virtual machine with one network interface.</li><br />
<ul><br />
<li> '''simple_uml.xml''': a single Linux virtual machine started using UML with address 10.0.0.2</li><br />
<li> '''simple_xp.xml''': a single Windows XP virtual machine started using libvirt with address 10.0.0.3</li><br />
<li> '''simple_win7.xml''': a single Windows 7 virtual machine started using libvirt with address 10.0.0.4</li><br />
<li> '''simple_ubuntu.xml''': a single Ubuntu 10.04.1 server virtual machine started using libvirt with address 10.0.0.5</li><br />
<li> '''simple_ubuntu-gui.xml''': a single Ubuntu 10.04.1 virtual machine with a minimal GNOME gui started using libvirt with address 10.0.0.6<br />
<li> '''simple_freebsd.xml''': a single FreeBSD 8.1 server virtual machine started using libvirt with address 10.0.0.7</li><br />
<li> '''simple_freebsd-gui.xml''': a single FreeBSD 8.1 virtual machine with a minimal GNOME gui started using libvirt with address 10.0.0.8</li><br />
All scenarios share the same network (Net0, 10.0.0.0/24) to allow connectivity among all the virtual machines and the host (which has address 10.0.0.1) <br />
</ul><br />
<li> '''tutorial_root1-XXXX.xml''', which are virtual scenarios based on the [http://www.dit.upm.es/vnumlwiki/index.php/Tutorial VNUML tutorial scenario] but starting virtual machines using other operating systems.</li><br />
<li> '''root_fs_XXX.xml''', which are libvirt specifications to start virtual machines with Internet connection (through a NAT) using the different VNX root file-systems. They are included to easily allow modifying root filesystems (for example, to install new software packages).</li><br />
</ul><br />
<br />
To test the scenarios:<br />
<ul><br />
<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><br />
ssh -X <host-addr><br />
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. Besides, as the access to the virtual machine consoles is tipically made using virt-viewer application (VNC protocol), you need a good connectivity between your machine and the host were VNX runs. <br />
</ul><br />
<br />
=== Simple scenarios (simple_XXXX.xml) ===<br />
<ul><br />
<li>Start simple scenarios by means of:</li><br />
sudo vnx -f /usr/share/vnx/examples/simple_XXXX.xml -v --create<br />
For example, to start an XP virtual machine type:<br />
sudo vnx -f /usr/share/vnx/examples/simple_xp.xml -v --create<br />
Just after the execution, you will see the console of the Windows XP machine starting. Once the machine has completely started, the VNX autoconfiguration daemon will configure its name and the network interfaces and restart the machine for the changes to take effect. After the restart, the virtual machine will be available for interacting with it.<br />
<br />
Note: virt-viewer console application "captures" the mouse when interacting with the virtual machines. You have to type "Ctrl-Alt" to release the mouse.<br />
<br />
<li>Once started, you can test the network connectivity form the host to the virtual machine:<br />
<pre><br />
root@tutatis:/usr/share/vnx/examples# ping -c 4 10.0.0.3<br />
PING 10.0.0.3 (10.0.0.3) 56(84) bytes of data.<br />
64 bytes from 10.0.0.3: icmp_seq=1 ttl=128 time=0.312 ms<br />
64 bytes from 10.0.0.3: icmp_seq=2 ttl=128 time=0.376 ms<br />
64 bytes from 10.0.0.3: icmp_seq=3 ttl=128 time=0.249 ms<br />
64 bytes from 10.0.0.3: icmp_seq=4 ttl=128 time=0.260 ms<br />
<br />
--- 10.0.0.3 ping statistics ---<br />
4 packets transmitted, 4 received, 0% packet loss, time 2999ms<br />
rtt min/avg/max/mdev = 0.249/0.299/0.376/0.051 ms<br />
</pre><br />
<br />
<li>You can also execute commands on the virtual machine from the host. For example, you can start the calculator on the Windows XP machine by issuing:</li><br />
sudo vnx -f /usr/share/vnx/examples/simple_xp.xml -v --exe calc<br />
This command has been specified inside the simple_xp.xml file in the line:<br />
<exec seq="calc" type="verbatim" mode="system">calc.exe</exec><br />
Note: the previous command does not end till you close the calc application.<br />
<br />
You can also copy a text file from the host to the virtual machine and show it using Notepad by issuing:<br />
sudo vnx -f /usr/share/vnx/examples/simple_xp.xml -v --exe vnxtxt<br />
This command is specified using the following two lines:<br />
<filetree seq="vnxtxt" root="c:\temp">conf/txtfile</filetree><br />
<exec seq="vnxtxt" type="verbatim" mode="system">start /max notepad c:\temp\vnx.txt</exec><br />
<br />
<li>You can start a Linux Ubuntu server with:</li><br />
sudo vnx -f /usr/share/vnx/examples/simple_ubuntu.xml -v --create<br />
And start a web server inside it with:<br />
sudo vnx -f /usr/share/vnx/examples/simple_ubuntu.xml -v --exe start-www<br />
And test the web server access from the XP virtual machine by manually opening a web navigator and loading URL http://10.0.0.4.<br />
<br />
<center><br />
[[Image:Vnx-simple_xp.png|400px]]<br />
</center><br />
<br />
<li>You can find more example commands by having a look at <exec> and <filetree> tags in simple_XXXX.xml files.</li><br />
<br />
<li>To stop the scenario preserving the changes made:</li><br />
sudo vnx -f /usr/share/vnx/examples/simple_xp.xml -v --shutdown<br />
You can later restart the scenario with:<br />
sudo vnx -f /usr/share/vnx/examples/simple_xp.xml -v --create<br />
<br />
<li>To stop the scenario discarding the changes made:</li><br />
sudo vnx -f /usr/share/vnx/examples/simple_xp.xml -v --destroy<br />
</ul><br />
<br />
=== Tutorial scenarios (tutorial_root1_XXXX.xml) ===<br />
<br />
<ul><br />
<br />
<li>To start the tutorial scenario with linux, FreeBSD, XP and Win7 virtual machines just type:</li><br />
sudo vnx -f tutorial_root1_all.xml -v --create<br />
<br />
<li>Once the scenario has completely started (remenber that libvirt machines have to be restarted for the autoconfiguration to complete), you should see all the virtual machine consoles:</li><br />
<center><br />
[[Image:Vnx-tutorial_root1_all-s.png|400px]]<br />
</center><br />
<br />
<li>You can test the network connectivity, for example, accesing '''h1''' machine and tracing to '''h4''':<br />
traceroute -n 10.0.2.3<br />
<br />
<li>To stop and restart a virtual machine without loosing the modifications you have made you can type::<br />
sudo vnx -f tutorial_root1_all.xml -v --shutdown -M uml4<br />
sudo vnx -f tutorial_root1_all.xml -v --create -M uml4<br />
<br />
<li>The same but loosing the changes made and returning to a fresh virtual machine state:<br />
sudo vnx -f tutorial_root1_all.xml -v --destroy -M uml4<br />
sudo vnx -f tutorial_root1_all.xml -v --create -M uml4<br />
<br />
</ul><br />
<br />
=== Other interesting options ===<br />
<br />
You can see a graphical map of the virtual scenario using the --show-map option:<br />
sudo vnx -f tutorial_root1_all.xml -v --show-map<br />
<br />
=== Modify root filesystem scenarios (root_fs_XXX.xml) ===<br />
<br />
To modify a root filesystem, for example, installing new software packages, just start the associated libvirt scenario with:<br />
virsh create root_fs_XXX.xml<br />
<br />
And open the console using:<br />
virt-viewer VMNAME<br />
being VMNAME the name assigned to the virtual machine (you can get it with "virsh list" command or just looking for the <name> tag in root_fs_XXX.xml file).<br />
<br />
To easy the process, you can use the vnx_modify_rootfs simple script that starts the virtual machine and opens the console:<br />
<br />
/usr/share/vnx/bin/vnx_modify_rootfs root_fs_XXX.xml</div>Davidhttps://web.dit.upm.es/vnumlwiki/index.php?title=Vnx-examples&diff=4119Vnx-examples2011-02-25T00:09:13Z<p>David: /* Tutorial scenarios (tutorial_root1_XXXX.xml) */</p>
<hr />
<div>{{Title|VNX Example Scenarios}}<br />
<br />
Several example scenarios are distributed together with VNX to allow easily testing its functionalities (see /usr/share/vnx/examples directory).<br />
<br />
Three types of scenarios are included:<br />
<ul><br />
<li> '''simple-XXXX.xml''', which are a set of simple scenarios made of one virtual machine with one network interface.</li><br />
<ul><br />
<li> '''simple_uml.xml''': a single Linux virtual machine started using UML with address 10.0.0.2</li><br />
<li> '''simple_xp.xml''': a single Windows XP virtual machine started using libvirt with address 10.0.0.3</li><br />
<li> '''simple_win7.xml''': a single Windows 7 virtual machine started using libvirt with address 10.0.0.4</li><br />
<li> '''simple_ubuntu.xml''': a single Ubuntu 10.04.1 server virtual machine started using libvirt with address 10.0.0.5</li><br />
<li> '''simple_ubuntu-gui.xml''': a single Ubuntu 10.04.1 virtual machine with a minimal GNOME gui started using libvirt with address 10.0.0.6<br />
<li> '''simple_freebsd.xml''': a single FreeBSD 8.1 server virtual machine started using libvirt with address 10.0.0.7</li><br />
<li> '''simple_freebsd-gui.xml''': a single FreeBSD 8.1 virtual machine with a minimal GNOME gui started using libvirt with address 10.0.0.8</li><br />
All scenarios share the same network (Net0, 10.0.0.0/24) to allow connectivity among all the virtual machines and the host (which has address 10.0.0.1) <br />
</ul><br />
<li> '''tutorial_root1-XXXX.xml''', which are virtual scenarios based on the [http://www.dit.upm.es/vnumlwiki/index.php/Tutorial VNUML tutorial scenario] but starting virtual machines using other operating systems.</li><br />
<li> '''root_fs_XXX.xml''', which are libvirt specifications to start virtual machines with Internet connection (through a NAT) using the different VNX root file-systems. They are included to easily allow modifying root filesystems (for example, to install new software packages).</li><br />
</ul><br />
<br />
To test the scenarios:<br />
<ul><br />
<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><br />
ssh -X <host-addr><br />
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. Besides, as the access to the virtual machine consoles is tipically made using virt-viewer application (VNC protocol), you need a good connectivity between your machine and the host were VNX runs. <br />
</ul><br />
<br />
=== Simple scenarios (simple_XXXX.xml) ===<br />
<ul><br />
<li>Start simple scenarios by means of:</li><br />
sudo vnx -f /usr/share/vnx/examples/simple_XXXX.xml -v --create<br />
For example, to start an XP virtual machine type:<br />
sudo vnx -f /usr/share/vnx/examples/simple_xp.xml -v --create<br />
Just after the execution, you will see the console of the Windows XP machine starting. Once the machine has completely started, the VNX autoconfiguration daemon will configure its name and the network interfaces and restart the machine for the changes to take effect. After the restart, the virtual machine will be available for interacting with it.<br />
<br />
Note: virt-viewer console application "captures" the mouse when interacting with the virtual machines. You have to type "Ctrl-Alt" to release the mouse.<br />
<br />
<li>Once started, you can test the network connectivity form the host to the virtual machine:<br />
<pre><br />
root@tutatis:/usr/share/vnx/examples# ping -c 4 10.0.0.3<br />
PING 10.0.0.3 (10.0.0.3) 56(84) bytes of data.<br />
64 bytes from 10.0.0.3: icmp_seq=1 ttl=128 time=0.312 ms<br />
64 bytes from 10.0.0.3: icmp_seq=2 ttl=128 time=0.376 ms<br />
64 bytes from 10.0.0.3: icmp_seq=3 ttl=128 time=0.249 ms<br />
64 bytes from 10.0.0.3: icmp_seq=4 ttl=128 time=0.260 ms<br />
<br />
--- 10.0.0.3 ping statistics ---<br />
4 packets transmitted, 4 received, 0% packet loss, time 2999ms<br />
rtt min/avg/max/mdev = 0.249/0.299/0.376/0.051 ms<br />
</pre><br />
<br />
<li>You can also execute commands on the virtual machine from the host. For example, you can start the calculator on the Windows XP machine by issuing:</li><br />
sudo vnx -f /usr/share/vnx/examples/simple_xp.xml -v --exe calc<br />
This command has been specified inside the simple_xp.xml file in the line:<br />
<exec seq="calc" type="verbatim" mode="system">calc.exe</exec><br />
Note: the previous command does not end till you close the calc application.<br />
<br />
You can also copy a text file from the host to the virtual machine and show it using Notepad by issuing:<br />
sudo vnx -f /usr/share/vnx/examples/simple_xp.xml -v -u root --exe vnxtxt<br />
This command is specified using the following two lines:<br />
<filetree seq="vnxtxt" root="c:\temp">conf/txtfile</filetree><br />
<exec seq="vnxtxt" type="verbatim" mode="system">start /max notepad c:\temp\vnx.txt</exec><br />
<br />
<li>You can start a Linux Ubuntu server with:</li><br />
sudo vnx -f /usr/share/vnx/examples/simple_ubuntu.xml -v --create<br />
And start a web server inside it with:<br />
sudo vnx -f /usr/share/vnx/examples/simple_ubuntu.xml -v --exe start-www<br />
And test the web server access from the XP virtual machine by manually opening a web navigator and loading URL http://10.0.0.4.<br />
<br />
<center><br />
[[Image:Vnx-simple_xp.png|400px]]<br />
</center><br />
<br />
<li>You can find more example commands by having a look at <exec> and <filetree> tags in simple_XXXX.xml files.</li><br />
<br />
<li>To stop the scenario preserving the changes made:</li><br />
sudo vnx -f /usr/share/vnx/examples/simple_xp.xml -v --shutdown<br />
You can later restart the scenario with:<br />
sudo vnx -f /usr/share/vnx/examples/simple_xp.xml -v --create<br />
<br />
<li>To stop the scenario discarding the changes made:</li><br />
sudo vnx -f /usr/share/vnx/examples/simple_xp.xml -v --destroy<br />
</ul><br />
<br />
=== Tutorial scenarios (tutorial_root1_XXXX.xml) ===<br />
<br />
<ul><br />
<br />
<li>To start the tutorial scenario with linux, FreeBSD, XP and Win7 virtual machines just type:</li><br />
sudo vnx -f tutorial_root1_all.xml -v --create<br />
<br />
<li>Once the scenario has completely started (remenber that libvirt machines have to be restarted for the autoconfiguration to complete), you should see all the virtual machine consoles:</li><br />
<center><br />
[[Image:Vnx-tutorial_root1_all-s.png|400px]]<br />
</center><br />
<br />
<li>You can test the network connectivity, for example, accesing '''h1''' machine and tracing to '''h4''':<br />
traceroute -n 10.0.2.3<br />
<br />
<li>To stop and restart a virtual machine without loosing the modifications you have made you can type::<br />
sudo vnx -f tutorial_root1_all.xml -v --shutdown -M uml4<br />
sudo vnx -f tutorial_root1_all.xml -v --create -M uml4<br />
<br />
<li>The same but loosing the changes made and returning to a fresh virtual machine state:<br />
sudo vnx -f tutorial_root1_all.xml -v --destroy -M uml4<br />
sudo vnx -f tutorial_root1_all.xml -v --create -M uml4<br />
<br />
</ul><br />
<br />
=== Other interesting options ===<br />
<br />
You can see a graphical map of the virtual scenario using the --show-map option:<br />
sudo vnx -f tutorial_root1_all.xml -v --show-map<br />
<br />
=== Modify root filesystem scenarios (root_fs_XXX.xml) ===<br />
<br />
To modify a root filesystem, for example, installing new software packages, just start the associated libvirt scenario with:<br />
virsh create root_fs_XXX.xml<br />
<br />
And open the console using:<br />
virt-viewer VMNAME<br />
being VMNAME the name assigned to the virtual machine (you can get it with "virsh list" command or just looking for the <name> tag in root_fs_XXX.xml file).<br />
<br />
To easy the process, you can use the vnx_modify_rootfs simple script that starts the virtual machine and opens the console:<br />
<br />
/usr/share/vnx/bin/vnx_modify_rootfs root_fs_XXX.xml</div>Davidhttps://web.dit.upm.es/vnumlwiki/index.php?title=Vnx-examples&diff=4118Vnx-examples2011-02-25T00:03:38Z<p>David: /* Modify root filesystem scenarios (root_fs_XXX.xml) */</p>
<hr />
<div>{{Title|VNX Example Scenarios}}<br />
<br />
Several example scenarios are distributed together with VNX to allow easily testing its functionalities (see /usr/share/vnx/examples directory).<br />
<br />
Three types of scenarios are included:<br />
<ul><br />
<li> '''simple-XXXX.xml''', which are a set of simple scenarios made of one virtual machine with one network interface.</li><br />
<ul><br />
<li> '''simple_uml.xml''': a single Linux virtual machine started using UML with address 10.0.0.2</li><br />
<li> '''simple_xp.xml''': a single Windows XP virtual machine started using libvirt with address 10.0.0.3</li><br />
<li> '''simple_win7.xml''': a single Windows 7 virtual machine started using libvirt with address 10.0.0.4</li><br />
<li> '''simple_ubuntu.xml''': a single Ubuntu 10.04.1 server virtual machine started using libvirt with address 10.0.0.5</li><br />
<li> '''simple_ubuntu-gui.xml''': a single Ubuntu 10.04.1 virtual machine with a minimal GNOME gui started using libvirt with address 10.0.0.6<br />
<li> '''simple_freebsd.xml''': a single FreeBSD 8.1 server virtual machine started using libvirt with address 10.0.0.7</li><br />
<li> '''simple_freebsd-gui.xml''': a single FreeBSD 8.1 virtual machine with a minimal GNOME gui started using libvirt with address 10.0.0.8</li><br />
All scenarios share the same network (Net0, 10.0.0.0/24) to allow connectivity among all the virtual machines and the host (which has address 10.0.0.1) <br />
</ul><br />
<li> '''tutorial_root1-XXXX.xml''', which are virtual scenarios based on the [http://www.dit.upm.es/vnumlwiki/index.php/Tutorial VNUML tutorial scenario] but starting virtual machines using other operating systems.</li><br />
<li> '''root_fs_XXX.xml''', which are libvirt specifications to start virtual machines with Internet connection (through a NAT) using the different VNX root file-systems. They are included to easily allow modifying root filesystems (for example, to install new software packages).</li><br />
</ul><br />
<br />
To test the scenarios:<br />
<ul><br />
<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><br />
ssh -X <host-addr><br />
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. Besides, as the access to the virtual machine consoles is tipically made using virt-viewer application (VNC protocol), you need a good connectivity between your machine and the host were VNX runs. <br />
</ul><br />
<br />
=== Simple scenarios (simple_XXXX.xml) ===<br />
<ul><br />
<li>Start simple scenarios by means of:</li><br />
sudo vnx -f /usr/share/vnx/examples/simple_XXXX.xml -v --create<br />
For example, to start an XP virtual machine type:<br />
sudo vnx -f /usr/share/vnx/examples/simple_xp.xml -v --create<br />
Just after the execution, you will see the console of the Windows XP machine starting. Once the machine has completely started, the VNX autoconfiguration daemon will configure its name and the network interfaces and restart the machine for the changes to take effect. After the restart, the virtual machine will be available for interacting with it.<br />
<br />
Note: virt-viewer console application "captures" the mouse when interacting with the virtual machines. You have to type "Ctrl-Alt" to release the mouse.<br />
<br />
<li>Once started, you can test the network connectivity form the host to the virtual machine:<br />
<pre><br />
root@tutatis:/usr/share/vnx/examples# ping -c 4 10.0.0.3<br />
PING 10.0.0.3 (10.0.0.3) 56(84) bytes of data.<br />
64 bytes from 10.0.0.3: icmp_seq=1 ttl=128 time=0.312 ms<br />
64 bytes from 10.0.0.3: icmp_seq=2 ttl=128 time=0.376 ms<br />
64 bytes from 10.0.0.3: icmp_seq=3 ttl=128 time=0.249 ms<br />
64 bytes from 10.0.0.3: icmp_seq=4 ttl=128 time=0.260 ms<br />
<br />
--- 10.0.0.3 ping statistics ---<br />
4 packets transmitted, 4 received, 0% packet loss, time 2999ms<br />
rtt min/avg/max/mdev = 0.249/0.299/0.376/0.051 ms<br />
</pre><br />
<br />
<li>You can also execute commands on the virtual machine from the host. For example, you can start the calculator on the Windows XP machine by issuing:</li><br />
sudo vnx -f /usr/share/vnx/examples/simple_xp.xml -v --exe calc<br />
This command has been specified inside the simple_xp.xml file in the line:<br />
<exec seq="calc" type="verbatim" mode="system">calc.exe</exec><br />
Note: the previous command does not end till you close the calc application.<br />
<br />
You can also copy a text file from the host to the virtual machine and show it using Notepad by issuing:<br />
sudo vnx -f /usr/share/vnx/examples/simple_xp.xml -v -u root --exe vnxtxt<br />
This command is specified using the following two lines:<br />
<filetree seq="vnxtxt" root="c:\temp">conf/txtfile</filetree><br />
<exec seq="vnxtxt" type="verbatim" mode="system">start /max notepad c:\temp\vnx.txt</exec><br />
<br />
<li>You can start a Linux Ubuntu server with:</li><br />
sudo vnx -f /usr/share/vnx/examples/simple_ubuntu.xml -v --create<br />
And start a web server inside it with:<br />
sudo vnx -f /usr/share/vnx/examples/simple_ubuntu.xml -v --exe start-www<br />
And test the web server access from the XP virtual machine by manually opening a web navigator and loading URL http://10.0.0.4.<br />
<br />
<center><br />
[[Image:Vnx-simple_xp.png|400px]]<br />
</center><br />
<br />
<li>You can find more example commands by having a look at <exec> and <filetree> tags in simple_XXXX.xml files.</li><br />
<br />
<li>To stop the scenario preserving the changes made:</li><br />
sudo vnx -f /usr/share/vnx/examples/simple_xp.xml -v --shutdown<br />
You can later restart the scenario with:<br />
sudo vnx -f /usr/share/vnx/examples/simple_xp.xml -v --create<br />
<br />
<li>To stop the scenario discarding the changes made:</li><br />
sudo vnx -f /usr/share/vnx/examples/simple_xp.xml -v --destroy<br />
</ul><br />
<br />
=== Tutorial scenarios (tutorial_root1_XXXX.xml) ===<br />
<br />
<ul><br />
<br />
<li>To start the tutorial scenario with linux, FreeBSD, XP and Win7 virtual machines just type:</li><br />
sudo vnx -f tutorial_root1_all.xml -v --create<br />
<br />
<li>Once the scenario has completely started (remenber that libvirt machines have to be restarted for the autoconfiguration to complete), you should see all the virtual machine consoles:</li><br />
<center><br />
[[Image:Vnx-tutorial_root1_all-s.png|400px]]<br />
</center><br />
<br />
<li>You can test the network connectivity, for example, accesing '''h1''' machine and tracing to '''h4''':<br />
traceroute -n 10.0.2.3<br />
<br />
<li>To stop and restart a virtual machine without loosing the modifications you have made you can type::<br />
sudo vnx -d examples/tutorial_root1_xp.xml -v -M uml4<br />
sudo vnx -t examples/tutorial_root1_xp.xml -v -M uml4<br />
<br />
<li>The same but loosing the changes made and returning to a fresh virtual machine state:<br />
sudo vnx -P examples/tutorial_root1_xp.xml -v -M uml4<br />
sudo vnx -t examples/tutorial_root1_xp.xml -v -M uml4<br />
<br />
</ul><br />
<br />
=== Modify root filesystem scenarios (root_fs_XXX.xml) ===<br />
<br />
To modify a root filesystem, for example, installing new software packages, just start the associated libvirt scenario with:<br />
virsh create root_fs_XXX.xml<br />
<br />
And open the console using:<br />
virt-viewer VMNAME<br />
being VMNAME the name assigned to the virtual machine (you can get it with "virsh list" command or just looking for the <name> tag in root_fs_XXX.xml file).<br />
<br />
To easy the process, you can use the vnx_modify_rootfs simple script that starts the virtual machine and opens the console:<br />
<br />
/usr/share/vnx/bin/vnx_modify_rootfs root_fs_XXX.xml</div>Davidhttps://web.dit.upm.es/vnumlwiki/index.php?title=Vnx-examples&diff=4117Vnx-examples2011-02-25T00:02:21Z<p>David: /* Tutorial scenarios (tutorial_root1_XXXX.xml) */</p>
<hr />
<div>{{Title|VNX Example Scenarios}}<br />
<br />
Several example scenarios are distributed together with VNX to allow easily testing its functionalities (see /usr/share/vnx/examples directory).<br />
<br />
Three types of scenarios are included:<br />
<ul><br />
<li> '''simple-XXXX.xml''', which are a set of simple scenarios made of one virtual machine with one network interface.</li><br />
<ul><br />
<li> '''simple_uml.xml''': a single Linux virtual machine started using UML with address 10.0.0.2</li><br />
<li> '''simple_xp.xml''': a single Windows XP virtual machine started using libvirt with address 10.0.0.3</li><br />
<li> '''simple_win7.xml''': a single Windows 7 virtual machine started using libvirt with address 10.0.0.4</li><br />
<li> '''simple_ubuntu.xml''': a single Ubuntu 10.04.1 server virtual machine started using libvirt with address 10.0.0.5</li><br />
<li> '''simple_ubuntu-gui.xml''': a single Ubuntu 10.04.1 virtual machine with a minimal GNOME gui started using libvirt with address 10.0.0.6<br />
<li> '''simple_freebsd.xml''': a single FreeBSD 8.1 server virtual machine started using libvirt with address 10.0.0.7</li><br />
<li> '''simple_freebsd-gui.xml''': a single FreeBSD 8.1 virtual machine with a minimal GNOME gui started using libvirt with address 10.0.0.8</li><br />
All scenarios share the same network (Net0, 10.0.0.0/24) to allow connectivity among all the virtual machines and the host (which has address 10.0.0.1) <br />
</ul><br />
<li> '''tutorial_root1-XXXX.xml''', which are virtual scenarios based on the [http://www.dit.upm.es/vnumlwiki/index.php/Tutorial VNUML tutorial scenario] but starting virtual machines using other operating systems.</li><br />
<li> '''root_fs_XXX.xml''', which are libvirt specifications to start virtual machines with Internet connection (through a NAT) using the different VNX root file-systems. They are included to easily allow modifying root filesystems (for example, to install new software packages).</li><br />
</ul><br />
<br />
To test the scenarios:<br />
<ul><br />
<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><br />
ssh -X <host-addr><br />
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. Besides, as the access to the virtual machine consoles is tipically made using virt-viewer application (VNC protocol), you need a good connectivity between your machine and the host were VNX runs. <br />
</ul><br />
<br />
=== Simple scenarios (simple_XXXX.xml) ===<br />
<ul><br />
<li>Start simple scenarios by means of:</li><br />
sudo vnx -f /usr/share/vnx/examples/simple_XXXX.xml -v --create<br />
For example, to start an XP virtual machine type:<br />
sudo vnx -f /usr/share/vnx/examples/simple_xp.xml -v --create<br />
Just after the execution, you will see the console of the Windows XP machine starting. Once the machine has completely started, the VNX autoconfiguration daemon will configure its name and the network interfaces and restart the machine for the changes to take effect. After the restart, the virtual machine will be available for interacting with it.<br />
<br />
Note: virt-viewer console application "captures" the mouse when interacting with the virtual machines. You have to type "Ctrl-Alt" to release the mouse.<br />
<br />
<li>Once started, you can test the network connectivity form the host to the virtual machine:<br />
<pre><br />
root@tutatis:/usr/share/vnx/examples# ping -c 4 10.0.0.3<br />
PING 10.0.0.3 (10.0.0.3) 56(84) bytes of data.<br />
64 bytes from 10.0.0.3: icmp_seq=1 ttl=128 time=0.312 ms<br />
64 bytes from 10.0.0.3: icmp_seq=2 ttl=128 time=0.376 ms<br />
64 bytes from 10.0.0.3: icmp_seq=3 ttl=128 time=0.249 ms<br />
64 bytes from 10.0.0.3: icmp_seq=4 ttl=128 time=0.260 ms<br />
<br />
--- 10.0.0.3 ping statistics ---<br />
4 packets transmitted, 4 received, 0% packet loss, time 2999ms<br />
rtt min/avg/max/mdev = 0.249/0.299/0.376/0.051 ms<br />
</pre><br />
<br />
<li>You can also execute commands on the virtual machine from the host. For example, you can start the calculator on the Windows XP machine by issuing:</li><br />
sudo vnx -f /usr/share/vnx/examples/simple_xp.xml -v --exe calc<br />
This command has been specified inside the simple_xp.xml file in the line:<br />
<exec seq="calc" type="verbatim" mode="system">calc.exe</exec><br />
Note: the previous command does not end till you close the calc application.<br />
<br />
You can also copy a text file from the host to the virtual machine and show it using Notepad by issuing:<br />
sudo vnx -f /usr/share/vnx/examples/simple_xp.xml -v -u root --exe vnxtxt<br />
This command is specified using the following two lines:<br />
<filetree seq="vnxtxt" root="c:\temp">conf/txtfile</filetree><br />
<exec seq="vnxtxt" type="verbatim" mode="system">start /max notepad c:\temp\vnx.txt</exec><br />
<br />
<li>You can start a Linux Ubuntu server with:</li><br />
sudo vnx -f /usr/share/vnx/examples/simple_ubuntu.xml -v --create<br />
And start a web server inside it with:<br />
sudo vnx -f /usr/share/vnx/examples/simple_ubuntu.xml -v --exe start-www<br />
And test the web server access from the XP virtual machine by manually opening a web navigator and loading URL http://10.0.0.4.<br />
<br />
<center><br />
[[Image:Vnx-simple_xp.png|400px]]<br />
</center><br />
<br />
<li>You can find more example commands by having a look at <exec> and <filetree> tags in simple_XXXX.xml files.</li><br />
<br />
<li>To stop the scenario preserving the changes made:</li><br />
sudo vnx -f /usr/share/vnx/examples/simple_xp.xml -v --shutdown<br />
You can later restart the scenario with:<br />
sudo vnx -f /usr/share/vnx/examples/simple_xp.xml -v --create<br />
<br />
<li>To stop the scenario discarding the changes made:</li><br />
sudo vnx -f /usr/share/vnx/examples/simple_xp.xml -v --destroy<br />
</ul><br />
<br />
=== Tutorial scenarios (tutorial_root1_XXXX.xml) ===<br />
<br />
<ul><br />
<br />
<li>To start the tutorial scenario with linux, FreeBSD, XP and Win7 virtual machines just type:</li><br />
sudo vnx -f tutorial_root1_all.xml -v --create<br />
<br />
<li>Once the scenario has completely started (remenber that libvirt machines have to be restarted for the autoconfiguration to complete), you should see all the virtual machine consoles:</li><br />
<center><br />
[[Image:Vnx-tutorial_root1_all-s.png|400px]]<br />
</center><br />
<br />
<li>You can test the network connectivity, for example, accesing '''h1''' machine and tracing to '''h4''':<br />
traceroute -n 10.0.2.3<br />
<br />
<li>To stop and restart a virtual machine without loosing the modifications you have made you can type::<br />
sudo vnx -d examples/tutorial_root1_xp.xml -v -M uml4<br />
sudo vnx -t examples/tutorial_root1_xp.xml -v -M uml4<br />
<br />
<li>The same but loosing the changes made and returning to a fresh virtual machine state:<br />
sudo vnx -P examples/tutorial_root1_xp.xml -v -M uml4<br />
sudo vnx -t examples/tutorial_root1_xp.xml -v -M uml4<br />
<br />
</ul><br />
<br />
=== Modify root filesystem scenarios (root_fs_XXX.xml) ===<br />
<br />
To modify a root filesystem, for example, installing new software packages, just start the associated libvirt scenario with:<br />
virsh create root_fs_XXX.xml<br />
<br />
And open the console using:<br />
virt-viewer VMNAME<br />
being VMNAME the name assigned to the virtual machine (you can get it with "virsh list" command or just looking for the <name> tag in root_fs_XXX.xml file).<br />
<br />
To easy the process, you can use the following script that starts the virtual machine and opens the console:<br />
<br />
<pre><br />
#/bin/bash<br />
<br />
XMLFILE=$1<br />
echo $XMLFILE<br />
# Find tag in the xml, convert tabs to spaces, remove leading spaces, remove the tag.<br />
VMNAME=$( grep "<name>" $XMLFILE | \<br />
tr '\011' '\040' | \<br />
sed -e 's/^[ ]*//' \<br />
-e 's/^<.*>\([^<].*\)<.*>$/\1/' )<br />
echo Starting $VMNAME virtual machine<br />
virsh create $XMLFILE && virt-viewer $VMNAME &<br />
</pre><br />
<br />
Just copy the previous script to a file named vnx_modify_rootfs (or whatever you want) and invoke it with:<br />
vnx_modify_rootfs root_fs_XXX.xml</div>Davidhttps://web.dit.upm.es/vnumlwiki/index.php?title=Vnx-examples&diff=4116Vnx-examples2011-02-25T00:01:19Z<p>David: /* Simple scenarios (simple_XXXX.xml) */</p>
<hr />
<div>{{Title|VNX Example Scenarios}}<br />
<br />
Several example scenarios are distributed together with VNX to allow easily testing its functionalities (see /usr/share/vnx/examples directory).<br />
<br />
Three types of scenarios are included:<br />
<ul><br />
<li> '''simple-XXXX.xml''', which are a set of simple scenarios made of one virtual machine with one network interface.</li><br />
<ul><br />
<li> '''simple_uml.xml''': a single Linux virtual machine started using UML with address 10.0.0.2</li><br />
<li> '''simple_xp.xml''': a single Windows XP virtual machine started using libvirt with address 10.0.0.3</li><br />
<li> '''simple_win7.xml''': a single Windows 7 virtual machine started using libvirt with address 10.0.0.4</li><br />
<li> '''simple_ubuntu.xml''': a single Ubuntu 10.04.1 server virtual machine started using libvirt with address 10.0.0.5</li><br />
<li> '''simple_ubuntu-gui.xml''': a single Ubuntu 10.04.1 virtual machine with a minimal GNOME gui started using libvirt with address 10.0.0.6<br />
<li> '''simple_freebsd.xml''': a single FreeBSD 8.1 server virtual machine started using libvirt with address 10.0.0.7</li><br />
<li> '''simple_freebsd-gui.xml''': a single FreeBSD 8.1 virtual machine with a minimal GNOME gui started using libvirt with address 10.0.0.8</li><br />
All scenarios share the same network (Net0, 10.0.0.0/24) to allow connectivity among all the virtual machines and the host (which has address 10.0.0.1) <br />
</ul><br />
<li> '''tutorial_root1-XXXX.xml''', which are virtual scenarios based on the [http://www.dit.upm.es/vnumlwiki/index.php/Tutorial VNUML tutorial scenario] but starting virtual machines using other operating systems.</li><br />
<li> '''root_fs_XXX.xml''', which are libvirt specifications to start virtual machines with Internet connection (through a NAT) using the different VNX root file-systems. They are included to easily allow modifying root filesystems (for example, to install new software packages).</li><br />
</ul><br />
<br />
To test the scenarios:<br />
<ul><br />
<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><br />
ssh -X <host-addr><br />
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. Besides, as the access to the virtual machine consoles is tipically made using virt-viewer application (VNC protocol), you need a good connectivity between your machine and the host were VNX runs. <br />
</ul><br />
<br />
=== Simple scenarios (simple_XXXX.xml) ===<br />
<ul><br />
<li>Start simple scenarios by means of:</li><br />
sudo vnx -f /usr/share/vnx/examples/simple_XXXX.xml -v --create<br />
For example, to start an XP virtual machine type:<br />
sudo vnx -f /usr/share/vnx/examples/simple_xp.xml -v --create<br />
Just after the execution, you will see the console of the Windows XP machine starting. Once the machine has completely started, the VNX autoconfiguration daemon will configure its name and the network interfaces and restart the machine for the changes to take effect. After the restart, the virtual machine will be available for interacting with it.<br />
<br />
Note: virt-viewer console application "captures" the mouse when interacting with the virtual machines. You have to type "Ctrl-Alt" to release the mouse.<br />
<br />
<li>Once started, you can test the network connectivity form the host to the virtual machine:<br />
<pre><br />
root@tutatis:/usr/share/vnx/examples# ping -c 4 10.0.0.3<br />
PING 10.0.0.3 (10.0.0.3) 56(84) bytes of data.<br />
64 bytes from 10.0.0.3: icmp_seq=1 ttl=128 time=0.312 ms<br />
64 bytes from 10.0.0.3: icmp_seq=2 ttl=128 time=0.376 ms<br />
64 bytes from 10.0.0.3: icmp_seq=3 ttl=128 time=0.249 ms<br />
64 bytes from 10.0.0.3: icmp_seq=4 ttl=128 time=0.260 ms<br />
<br />
--- 10.0.0.3 ping statistics ---<br />
4 packets transmitted, 4 received, 0% packet loss, time 2999ms<br />
rtt min/avg/max/mdev = 0.249/0.299/0.376/0.051 ms<br />
</pre><br />
<br />
<li>You can also execute commands on the virtual machine from the host. For example, you can start the calculator on the Windows XP machine by issuing:</li><br />
sudo vnx -f /usr/share/vnx/examples/simple_xp.xml -v --exe calc<br />
This command has been specified inside the simple_xp.xml file in the line:<br />
<exec seq="calc" type="verbatim" mode="system">calc.exe</exec><br />
Note: the previous command does not end till you close the calc application.<br />
<br />
You can also copy a text file from the host to the virtual machine and show it using Notepad by issuing:<br />
sudo vnx -f /usr/share/vnx/examples/simple_xp.xml -v -u root --exe vnxtxt<br />
This command is specified using the following two lines:<br />
<filetree seq="vnxtxt" root="c:\temp">conf/txtfile</filetree><br />
<exec seq="vnxtxt" type="verbatim" mode="system">start /max notepad c:\temp\vnx.txt</exec><br />
<br />
<li>You can start a Linux Ubuntu server with:</li><br />
sudo vnx -f /usr/share/vnx/examples/simple_ubuntu.xml -v --create<br />
And start a web server inside it with:<br />
sudo vnx -f /usr/share/vnx/examples/simple_ubuntu.xml -v --exe start-www<br />
And test the web server access from the XP virtual machine by manually opening a web navigator and loading URL http://10.0.0.4.<br />
<br />
<center><br />
[[Image:Vnx-simple_xp.png|400px]]<br />
</center><br />
<br />
<li>You can find more example commands by having a look at <exec> and <filetree> tags in simple_XXXX.xml files.</li><br />
<br />
<li>To stop the scenario preserving the changes made:</li><br />
sudo vnx -f /usr/share/vnx/examples/simple_xp.xml -v --shutdown<br />
You can later restart the scenario with:<br />
sudo vnx -f /usr/share/vnx/examples/simple_xp.xml -v --create<br />
<br />
<li>To stop the scenario discarding the changes made:</li><br />
sudo vnx -f /usr/share/vnx/examples/simple_xp.xml -v --destroy<br />
</ul><br />
<br />
=== Tutorial scenarios (tutorial_root1_XXXX.xml) ===<br />
<br />
<ul><br />
<br />
<li>To start the tutorial scenario with linux, FreeBSD, XP and Win7 virtual machines just type:</li><br />
vnx -f tutorial_root1_all.xml -v -u root --create<br />
<br />
<li>Once the scenario has completely started (remenber that libvirt machines have to be restarted for the autoconfiguration to complete), you should see all the virtual machine consoles:</li><br />
<center><br />
[[Image:Vnx-tutorial_root1_all-s.png|400px]]<br />
</center><br />
<br />
<li>You can test the network connectivity, for example, accesing '''h1''' machine and tracing to '''h4''':<br />
traceroute -n 10.0.2.3<br />
<br />
<li>To stop and restart a virtual machine without loosing the modifications you have made you can type::<br />
vnx -d examples/tutorial_root1_xp.xml -v -u root -M uml4<br />
vnx -t examples/tutorial_root1_xp.xml -v -u root -M uml4<br />
<br />
<li>The same but loosing the changes made and returning to a fresh virtual machine state:<br />
vnx -P examples/tutorial_root1_xp.xml -v -u root -M uml4<br />
vnx -t examples/tutorial_root1_xp.xml -v -u root -M uml4<br />
<br />
</ul><br />
<br />
=== Modify root filesystem scenarios (root_fs_XXX.xml) ===<br />
<br />
To modify a root filesystem, for example, installing new software packages, just start the associated libvirt scenario with:<br />
virsh create root_fs_XXX.xml<br />
<br />
And open the console using:<br />
virt-viewer VMNAME<br />
being VMNAME the name assigned to the virtual machine (you can get it with "virsh list" command or just looking for the <name> tag in root_fs_XXX.xml file).<br />
<br />
To easy the process, you can use the following script that starts the virtual machine and opens the console:<br />
<br />
<pre><br />
#/bin/bash<br />
<br />
XMLFILE=$1<br />
echo $XMLFILE<br />
# Find tag in the xml, convert tabs to spaces, remove leading spaces, remove the tag.<br />
VMNAME=$( grep "<name>" $XMLFILE | \<br />
tr '\011' '\040' | \<br />
sed -e 's/^[ ]*//' \<br />
-e 's/^<.*>\([^<].*\)<.*>$/\1/' )<br />
echo Starting $VMNAME virtual machine<br />
virsh create $XMLFILE && virt-viewer $VMNAME &<br />
</pre><br />
<br />
Just copy the previous script to a file named vnx_modify_rootfs (or whatever you want) and invoke it with:<br />
vnx_modify_rootfs root_fs_XXX.xml</div>Davidhttps://web.dit.upm.es/vnumlwiki/index.php?title=Vnx-install&diff=4115Vnx-install2011-02-24T19:07:27Z<p>David: /* Installation over Fedora 11 (Draft) */</p>
<hr />
<div>{{Title|VNX (Virtual Networks over X virtualization) v0.14 beta}}<br />
<br />
== Installation over Ubuntu 10.04/9.10 ==<br />
<br />
This section describes the procedure for installing VNX over Ubuntu 10.04 or 9.10. Open a root shell window and follow these steps:<br />
<ul><br />
<br />
<li>Install all packages required (basic development, virtualization, perl libraries and auxiliar packages):</li><br />
apt-get update<br />
apt-get install build-essential qemu-kvm libvirt-bin vlan xterm \<br />
bridge-utils screen virt-manager virt-viewer libxml-checker-perl \<br />
libxml-parser-perl libnetaddr-ip-perl libnet-pcap-perl \<br />
libnet-ipv6addr-perl liberror-perl libexception-class-perl \<br />
uml-utilities libxml-libxml-perl libxml2-dev libgnutls-dev \<br />
libdevmapper-dev libterm-readline-perl-perl libnet-telnet-perl \<br />
libnet-ip-perl libreadonly-perl libmath-round-perl libappconfig-perl \<br />
libdbi-perl graphviz libnl-dev genisoimage gnome-terminal<br />
<br />
<!--Note: for Ubuntu 9.04 change "qemu-kvm" package by "qemu kvm" --><br />
<li>If you use 64 bits version of Ubuntu, install 32 bits compatibility libraries:</li><br />
apt-get install ia32-libs<br />
<br />
<li>Install libvirt 0.8.5:</li><br />
/etc/init.d/libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.8.5.tar.gz<br />
tar xfvz libvirt-0.8.5.tar.gz<br />
cd libvirt-0.8.5<br />
./configure --without-xen --prefix=/usr && make && make install<br />
/etc/init.d/libvirt-bin start<br />
<br />
'''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.<br />
<br />
<li>Install Sys::Virt perl module:</li><br />
<ul><br />
<li>For Ubuntu 10.04, just install the libsys-virt-perl package</li><br />
apt-get install libsys-virt-perl<br />
<!--<br />
'''IMPORTANT NOTE''': Windows XP virtual machines started with VNX over Ubuntu 9.10 frequently hang when executing commands or with high traffic loads. The problem could be related with virtual network drivers. We are investigating the problem to find a solution. By now, Ubuntu 10.04 is the recomended platform to test VNX.<br />
--><br />
<li>For Ubuntu 9.10, as Sys::Virt library is not available as a package, install it manually:</li><br />
wget http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.2.3.tar.gz<br />
tar xfvz Sys-Virt-0.2.3.tar.gz <br />
cd Sys-Virt-0.2.3<br />
perl Makefile.PL<br />
make install<br />
</ul><br />
<br />
<li>Install VNX:</li><br />
mkdir /tmp/vnx-update<br />
cd /tmp/vnx-update<br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-latest.tgz<br />
tar xfvz vnx-latest.tgz<br />
cd vnx-*<br />
./install_vnx<br />
<br />
<li>Create the VNX config file (/etc/vnx.conf). You just can move the sample config file:</li><br />
mv /etc/vnx.conf.samble /etc/vnx.conf<br />
<br />
<li>Download root file systems from http://idefix.dit.upm.es/download/vnx/filesystems and copy them to /usr/share/vnx/filesystems directory:</li><br />
cd /usr/share/vnx/filesystems<br />
<br />
# ubuntu server<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.10-v01.qcow2.bz2<br />
bunzip2 root_fs_ubuntu-10.10-v01.qcow2.bz2<br />
ln -s root_fs_ubuntu-10.10-v01.qcow2 root_fs_ubuntu<br />
<br />
# ubuntu with gui<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.10-gui-v01.qcow2.bz2<br />
bunzip2 root_fs_ubuntu-10.10-gui-v01.qcow2.bz2<br />
ln -s root_fs_ubuntu-10.10-gui-v01.qcow2 root_fs_ubuntu-gui<br />
<br />
# freebsd server<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-8.1-v01.qcow2.bz2<br />
bunzip2 root_fs_freebsd-8.1-v01.qcow2.bz2<br />
ln -s root_fs_freebsd-8.1-v01.qcow2 root_fs_freebsd<br />
<br />
# freebsd gui<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-8.1-gui-v01.qcow2.bz2<br />
bunzip2 root_fs_freebsd-8.1-gui-v01.qcow2.bz2<br />
ln -s root_fs_freebsd-8.1-gui-v01.qcow2 root_fs_freebsd-gui<br />
<br />
# winxp and win7<br />
# Sorry! Unfortunately for legal reasons we cannot distribute windows XP<br />
# or Windows 7 root filesystems. See VNX documentation for detailed recipes<br />
# to create these root fylesystems from scratch<br />
<br />
<li>Additionally, if you plan to use VNUML root filesystem:</li><br />
# VNUML root_fs_tutorial and kernel<br />
cd /usr/share/vnx/filesystems<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_tutorial-0.6.0.bz2<br />
bunzip2 root_fs_tutorial-0.6.0.bz2<br />
ln -s root_fs_tutorial-0.6.0 root_fs_tutorial<br />
cd /usr/share/vnx/kernels<br />
wget -N http://jungla.dit.upm.es/~vnx/download/kernels/linux-2.6.18.1-bb2-xt-4m<br />
chmod +x linux-2.6.18.1-bb2-xt-4m<br />
ln -s linux-2.6.18.1-bb2-xt-4m linux<br />
<br />
</ul><br />
<br />
'''NOTE for Ubuntu 10.04.1''': It seems that an additional package has to be installed:<br />
apt-get install kvm-pxe<br />
<br />
=== Additional install steps for Dynamips support ===<br />
<br />
* Install Dynamips and Dynagen:<br />
apt-get install dynamips dynagen<br />
<br />
* Create a file /etc/init.d/dynamips (taken from http://7200emu.hacki.at/viewtopic.php?t=2198):<br />
<pre><br />
#!/bin/sh<br />
# Start/stop the dynamips program as a daemon.<br />
#<br />
### BEGIN INIT INFO<br />
# Provides: dynamips<br />
# Default-Start: 2 3 4 5<br />
# Default-Stop: 0 1 6<br />
# Short-Description: Cisco hardware emulator daemon<br />
### END INIT INFO<br />
<br />
DAEMON=/usr/bin/dynamips<br />
NAME=dynamips<br />
PORT=7200<br />
PIDFILE=/var/run/$NAME.pid <br />
LOGFILE=/var/log/$NAME.log<br />
DESC="Cisco Emulator"<br />
SCRIPTNAME=/etc/init.d/$NAME<br />
<br />
test -f $DAEMON || exit 0<br />
<br />
. /lib/lsb/init-functions<br />
<br />
<br />
case "$1" in<br />
start) log_daemon_msg "Starting $DESC " "$NAME"<br />
start-stop-daemon --start --chdir /tmp --background --make-pidfile --pidfile $PIDFILE --name $NAME --startas $DAEMON -- -H $PORT -l $LOGFILE<br />
log_end_msg $?<br />
;;<br />
stop) log_daemon_msg "Stopping $DESC " "$NAME"<br />
start-stop-daemon --stop --quiet --pidfile $PIDFILE --name $NAME<br />
log_end_msg $?<br />
;;<br />
restart) log_daemon_msg "Restarting $DESC " "$NAME"<br />
start-stop-daemon --stop --retry 5 --quiet --pidfile $PIDFILE --name $NAME<br />
start-stop-daemon --start --chdir /tmp --background --make-pidfile --pidfile $PIDFILE --name $NAME --startas $DAEMON -- -H $PORT -l $LOGFILE<br />
log_end_msg $?<br />
;;<br />
status)<br />
status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $? <br />
#status $NAME<br />
#RETVAL=$?<br />
;; <br />
*) log_action_msg "Usage: $SCRIPTNAME {start|stop|restart|status}"<br />
exit 2<br />
;;<br />
esac<br />
exit 0<br />
<br />
</pre><br />
<br />
* Set execution permissions for the script and add it to system start-up:<br />
chmod +x /etc/init.d/dynamips<br />
update-rc.d dynamips defaults<br />
/etc/init.d/dynamips start<br />
<br />
* Download and install cisco IOS image:<br />
cd /usr/share/vnx/filesystems<br />
# Cisco image<br />
wget ... c3640-js-mz.124-19.image<br />
ln -s c3640-js-mz.124-19.image c3640<br />
<br />
* Calculate the idle-pc value for your computer following the procedure in http://dynagen.org/tutorial.htm:<br />
dynagen /usr/share/vnx/examples/R.net<br />
console R # type 'no' to exit the config wizard and wait <br />
# for the router to completely start <br />
idle-pc get R<br />
Once you know the idle-pc value for your system, include it in /etc/vnx.conf file.<br />
<br />
=== Additional install steps for Olive support ===<br />
<br />
Several additional steps are needed to support Olive (Juniper) routers in VNX scenarios:<br />
<br />
<ul><br />
<br />
<!-- Ya no hace falta desde que se usa <qemu:commandline><br />
<br />
<li>Install a patched version of libvirt 0.8.5 with support to define the bios used by a virtual machine:</li><br />
<br />
<ul><br />
<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><br />
<pre><br />
diff -crB libvirt-0.8.5.orig/src/conf/domain_conf.c libvirt-0.8.5/src/conf/domain_conf.c<br />
*** libvirt-0.8.5.orig/src/conf/domain_conf.c 2010-11-22 11:38:08.000000000 +0100<br />
--- libvirt-0.8.5/src/conf/domain_conf.c 2010-11-22 11:47:41.000000000 +0100<br />
***************<br />
*** 4267,4272 ****<br />
--- 4267,4274 ----<br />
if (node)<br />
def->mem.hugepage_backed = 1;<br />
<br />
+ def->biosfile = virXPathString("string(./biosfile[1])", ctxt);<br />
+ <br />
/* Extract other memory tunables */<br />
if (virXPathULong("string(./memtune/hard_limit)", ctxt,<br />
&def->mem.hard_limit) < 0)<br />
diff -crB libvirt-0.8.5.orig/src/conf/domain_conf.h libvirt-0.8.5/src/conf/domain_conf.h<br />
*** libvirt-0.8.5.orig/src/conf/domain_conf.h 2010-11-22 11:38:08.000000000 +0100<br />
--- libvirt-0.8.5/src/conf/domain_conf.h 2010-11-22 11:40:18.000000000 +0100<br />
***************<br />
*** 885,890 ****<br />
--- 885,891 ----<br />
unsigned long min_guarantee;<br />
unsigned long swap_hard_limit;<br />
} mem;<br />
+ char *biosfile;<br />
unsigned short vcpus;<br />
unsigned short maxvcpus;<br />
int cpumasklen;<br />
diff -crB libvirt-0.8.5.orig/src/qemu/qemu_conf.c libvirt-0.8.5/src/qemu/qemu_conf.c<br />
*** libvirt-0.8.5.orig/src/qemu/qemu_conf.c 2010-11-22 11:38:08.000000000 +0100<br />
--- libvirt-0.8.5/src/qemu/qemu_conf.c 2010-11-22 11:41:05.000000000 +0100<br />
***************<br />
*** 3984,3989 ****<br />
--- 3984,3995 ----<br />
ADD_ARG_LIT(emulator);<br />
ADD_ARG_LIT("-S");<br />
<br />
+ if(def->biosfile)<br />
+ {<br />
+ ADD_ARG_LIT("-bios");<br />
+ ADD_ARG_LIT(def->biosfile);<br />
+ }<br />
+ <br />
/* This should *never* be NULL, since we always provide<br />
* a machine in the capabilities data for QEMU. So this<br />
* check is just here as a safety in case the unexpected<br />
</pre><br />
<br />
<li>Install libvirt 0.8.5 with that patch applied:</li><br />
service libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.8.5.tar.gz<br />
tar xfvz libvirt-0.8.5.tar.gz <br />
cd libvirt-0.8.5<br />
patch -p1 -i ../libvirt-0.8.5-biosfile.patch <br />
./configure --without-xen --prefix=/usr && make && make install<br />
service libvirt-bin start<br />
<br />
</ul><br />
--><br />
<li>Download old qemu bios from 0.10.6 version and copy it to /usr/share/qemu directory:</li><br />
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.10.6/qemu-kvm-0.10.6.tar.gz<br />
tar xfvz qemu-kvm-0.10.6.tar.gz<br />
cp qemu-kvm-0.10.6/pc-bios/bios.bin /usr/share/qemu-kvm/bios-0.10.6.bin<br />
<br />
<!-- Not needed, it seems to work without downloading this drivers<br />
<li>Download i82559 ROM from the latest qemu versions (Ubuntu 10.04 does not include that ROM in qemu-kvm package):</li><br />
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.12.5/qemu-kvm-0.12.5.tar.gz<br />
tar xfvz qemu-kvm-0.12.5.tar.gz<br />
cp qemu-kvm-0.12.5/pc-bios/pxe-i82559er.bin /usr/share/qemu-kvm/<br />
--><br />
</ul><br />
<br />
== Installation over Fedora 11 (Draft) ==<br />
<br />
Follow this steps to install VNX over Fedora 11:<br />
<ul><br />
<br />
<li>Install packages:</li><br />
yum -y groupinstall "Development Tools"<br />
yum install qemu-kvm libvirt virt-manager virt-viewer perl-XML-LibXML<br />
yum install perl-XML-DOM perl-NetAddr-IP perl-Readonly perl-TermReadKey<br />
yum install perl-Net-Pcap perl-Net-IPv6Addr perl-Net-Telnet perl-Error<br />
yum install perl-Exception-Class perl-ExtUtils-MakeMaker tunctl screen wget<br />
yum install libxml2-devel gnutls-devel device-mapper-devel uml_utilities <br />
yum install roxterm xterm graphviz perl-AppConfig<br />
<br />
<li>Install libvirt 0.8.5:</li><br />
/etc/init.d/libvirtd stop<br />
wget http://libvirt.org/sources/libvirt-0.8.5.tar.gz<br />
tar xfvz libvirt-0.8.5.tar.gz<br />
cd libvirt-0.8.5<br />
./configure --without-xen --prefix=/usr && make && make install<br />
/etc/init.d/libvirtd start<br />
<br />
<li>Install SysVirt manually:</li><br />
wget http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.2.4.tar.gz<br />
tar xfvz Sys-Virt-0.2.4.tar.gz<br />
cd Sys-Virt-0.2.4<br />
perl Makefile.PL<br />
make install<br />
<!--<br />
<li> Instalar VNUML sobre Fedora 11 siguiendo la receta en http://www.dit.upm.es/vnumlwiki/index.php/Fedora11</li><br />
<br />
<li> Instalar paquetes y librerías necesarias:</li><br />
yum install qemu-kvm libvirt virt-manager virt-viewer perl-XML-LibXML perl-Sys-Virt<br />
yum -y install bridge-utils readline-devel perl-Module-Build screen expat-devel libpcap-devel <br />
yum -y install perl-Net-Pcap perl-NetAddr-IP perl-Net-IPv6Addr perl-XML-DOM perl-Exception-Class<br />
yum -y install perl-TermReadKey perl-Error perl-CPAN uml_utilities xterm tunctl<br />
<br />
<li>Install XML::Checker perl library:</li><br />
perl -MCPAN -e shell<br />
install XML::Checker<br />
--><br />
<li>Add symbolic link for kvm:</li><br />
ln -s /usr/bin/qemu-kvm /usr/bin/kvm<br />
<br />
<li>Install VNX:</li><br />
mkdir /tmp/vnx-update<br />
cd /tmp/vnx-update<br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-latest.tgz<br />
tar xfvz vnx-latest.tgz<br />
cd vnx-*<br />
./install_vnx<br />
<br />
<li>Create the VNX config file (/etc/vnx.conf). You just can move the sample config file:</li><br />
mv /etc/vnx.conf.samble /etc/vnx.conf<br />
<br />
<li>Disable host firewall or, alternatively, configure "tun" type network interfaces as trusted interfaces (System->Firewall->Trusted Interfaces).</li><br />
<br />
<li>Download root file systems from http://idefix.dit.upm.es/download/vnx/filesystems and copy them to /usr/share/vnx/filesystems directory:</li><br />
cd /usr/share/vnx/filesystems<br />
<br />
# ubuntu server<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.10-v01.qcow2.bz2<br />
bunzip2 root_fs_ubuntu-10.10-v01.qcow2.bz2<br />
ln -s root_fs_ubuntu-10.10-v01.qcow2 root_fs_ubuntu<br />
<br />
# ubuntu with gui<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.10-gui-v01.qcow2.bz2<br />
bunzip2 root_fs_ubuntu-10.10-gui-v01.qcow2.bz2<br />
ln -s root_fs_ubuntu-10.10-gui-v01.qcow2 root_fs_ubuntu-gui<br />
<br />
# freebsd server<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-8.1-v01.qcow2.bz2<br />
bunzip2 root_fs_freebsd-8.1-v01.qcow2.bz2<br />
ln -s root_fs_freebsd-8.1-v01.qcow2 root_fs_freebsd<br />
<br />
# freebsd gui<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-8.1-gui-v01.qcow2.bz2<br />
bunzip2 root_fs_freebsd-8.1-gui-v01.qcow2.bz2<br />
ln -s root_fs_freebsd-8.1-gui-v01.qcow2 root_fs_freebsd-gui<br />
<br />
# winxp and win7<br />
# Sorry! Unfortunately for legal reasons we cannot distribute windows XP<br />
# or Windows 7 root filesystems. See VNX documentation for detailed recipes<br />
# to create these root fylesystems from scratch<br />
<br />
</ul><br />
<br />
=== Additional install steps for Dynamips support ===<br />
<br />
* Install Dynamips and Dynagen:<br />
wget http://downloads.sourceforge.net/project/dyna-gen/dynamips%20Linux%20RPM/0.2.8-RC2/dynamips-0.2.8RC2-1.i386.rpm<br />
rpm -i dynamips-0.2.8RC2-1.i386.rpm<br />
wget http://downloads.sourceforge.net/project/dyna-gen/dynagen%20source%20_%20Linux/dynagen%200.11.0/dynagen-0.11.0-1.fc9.noarch.rpm<br />
rpm -i dynagen-0.11.0-1.fc9.noarch.rpm<br />
<br />
* Set execution permissions for the script and add it to system start-up:<br />
chkconfig --add dynamips<br />
/etc/init.d/dynamips start<br />
<br />
* Download and install cisco IOS image:<br />
cd /usr/share/vnx/filesystems<br />
# Cisco image<br />
wget ... c3640-js-mz.124-19.image<br />
ln -s c3640-js-mz.124-19.image c3640<br />
<br />
* Calculate the idle-pc value for your computer following the procedure in http://dynagen.org/tutorial.htm:<br />
dynagen /usr/share/vnx/examples/R.net<br />
console R # type 'no' to exit the config wizard and wait <br />
# for the router to completely start <br />
idle-pc get R<br />
Once you know the idle-pc value for your system, include it in /etc/vnx.conf file.<br />
<br />
=== Additional install steps for Olive support ===<br />
<br />
Several additional steps are needed to support Olive (Juniper) routers in VNX scenarios:<br />
<br />
<ul><br />
<br />
<li>Download old qemu bios from 0.10.6 version and copy it to /usr/share/qemu directory:</li><br />
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.10.6/qemu-kvm-0.10.6.tar.gz<br />
tar xfvz qemu-kvm-0.10.6.tar.gz<br />
cp qemu-kvm-0.10.6/pc-bios/bios.bin /usr/share/qemu/bios-0.10.6.bin<br />
<br />
</ul><br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<!-- COSAS ANTIGUAS --><br />
<br />
<!--li>Modificar vnumlparser.pl, sustituyendo en la función mode_t la línea en ):</li><br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
<br />
por:<br />
<br />
if (! -e "/dev/net/tun") {<br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
}<br />
<br />
Explicación: el módulo tun se ha integrado en el kernel a partir de la 10.04, por lo que no es necesario cargarlo como hasta ahora mediante "modprobe tun". El cambio anterior simplemente comprueba si existe el dispositivo /dev/net/tun y carga el modulo en caso de que no exista.<br />
--><br />
<br />
<br />
<!--li>Modificar vnumlparser.pl, sustituyendo en la función mode_t la línea en ):</li><br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
<br />
por:<br />
<br />
if (! -e "/dev/net/tun") {<br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
}<br />
<br />
Explicación: el módulo tun se ha integrado en el kernel a partir de la 10.04, por lo que no es necesario cargarlo como hasta ahora mediante "modprobe tun". El cambio anterior simplemente comprueba si existe el dispositivo /dev/net/tun y carga el modulo en caso de que no exista.<br />
--><br />
<br />
<!--<br />
Pasos a seguir para instalar VNX sobre Ubuntu 9.10. <br />
<br />
'''Nota importante''': se han detectado importantes problemas de prestaciones cuando se utiliza el sistema de ficheros ext4 con Ubuntu 9.10. Por ello, y hasta que se localice el origen de dichas ineficiencias, se recomienda utilizar ext3. <br />
<ul><br />
<br />
<li> Instalar Ubuntu 9.10 y actualizar con:</li><br />
apt-get update; apt-get dist-upgrade<br />
--><br />
<!--<br />
<li>Añadir repositorios VNUML a /etc/apt/sources.lst:</li><br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian binary/" >> /etc/apt/sources.list<br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian-testing binary/" >> /etc/apt/sources.list<br />
--><br />
<!--<br />
<li>Install paquetes básicos de desarrollo, paquetes de virtualización (qemu-kvm, libvirt, vnuml) y librerías y paquetes auxiliares</li><br />
apt-get update<br />
apt-get install build-essential qemu-kvm libvirt-bin libvirt-dev \<br />
virt-manager virt-viewer vlan xterm bridge-utils screen uml-utilities \<br />
libxml-checker-perl libxml-parser-perl libnetaddr-ip-perl libnet-pcap-perl \<br />
libnet-ipv6addr-perl liberror-perl libexception-class-perl libxml-libxml-perl \<br />
libxml2-dev libgnutls-dev libdevmapper-dev libterm-readline-perl-perl <br />
<br />
<br />
<br />
curl vnuml linux-um <br />
<br />
<li>Si se usa la versión de Ubuntu de 64 bits hay que instalar las librerías de compatibilidad de 32 bits:</li><br />
apt-get install ia32-libs<br />
<br />
<li>Install qemu-kvm version 0.12.4 (version 0.11 which comes as apackage in 9.10 provokes hanging problems in Windows virtual machines when executing commands -something relates apparently with mounting cdroms in vms-):</li><br />
wget http://sourceforge.net/projects/kvm/files/qemu-kvm/0.11.1/qemu-kvm-0.11.1.tar.gz/download<br />
tar xfvz qemu-kvm-0.11.1.tar.gz<br />
cd qemu-kvm-0.11.1<br />
./configure --prefix=/usr && make && make install<br />
ln -s /usr/bin/qemu-system-x86_64 /usr/bin/kvm<br />
Editar /etc/modules y añadir:<br />
kvm <br />
kvm_intel<br />
<br />
wget http://sourceforge.net/projects/kvm/files/kvm-kmod/2.6.31.6b/kvm-kmod-2.6.31.6b.tar.bz2/download<br />
<br />
<li>Instalar libvirt 0.8.0:</li><br />
/etc/init.d/libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.8.0.tar.gz<br />
tar xfvz libvirt-0.8.0.tar.gz<br />
cd libvirt-0.8.0<br />
./configure --prefix=/usr && make && make install<br />
/etc/init.d/libvirt-bin start<br />
<br />
<li> Instalar la librería perl de acceso a libvirt (Sys::Virt) desde CPAN (dicha librería no esta disponible como paquete para Ubuntu 9.10):</li><br />
--><br />
<!-- wget http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.2.2.tar.gz<br />
tar xfvz Sys-Virt-0.2.2.tar.gz <br />
cd Sys-Virt-0.2.2<br />
perl Makefile.PL<br />
make install<br />
--><br />
<!--<br />
perl -MCPAN -e "CPAN::Shell->force(qw(install Sys::Virt));"<br />
Nota: constestar YES a la pregunta "Would you like me to configure as much as posible automatically?" y a "Is it OK to try to connect to the Internet?" <br />
<br />
<li>Instalar rootfilesystem de VNUML, enlaces del kernel y crear clave rsa:</li><br />
cd /usr/share/vnuml/filesystems<br />
wget http://www.dit.upm.es/vnuml/download/scripts/root-fs-installer<br />
perl root-fs-installer<br />
cd ../kernels<br />
ln -s linux-2.6.28.10-1m linux<br />
ssh-keygen -t rsa1<br />
<br />
<li>Instalar VNX:</li><br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-0.12b.tgz<br />
tar xfvz vnx-0.12b.tgz<br />
cd vnx-0.12b<br />
./install-vnx<br />
</ul><br />
<br />
Notas:<br />
http://www.ubuntu-es.org/node/128867<br />
175 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-headers-2.6.32-02063209_2.6.32-02063209_all.deb<br />
176 http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-image-2.6.32-02063209-generic_2.6.32-02063209_amd64.deb<br />
177 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-image-2.6.32-02063209-generic_2.6.32-02063209_amd64.deb<br />
178 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-headers-2.6.32-02063209-generic_2.6.32-02063209_amd64.deb<br />
--><br />
<br />
<!--<br />
=== Sobre Ubuntu 8.04 ===<br />
<br />
Pasos a seguir para instalar VNX sobre Ubuntu 8.04:<br />
<ul><br />
<br />
<li> Instalar Ubuntu 8.04 y actualizar con:</li><br />
apt-get update; apt-get dist-upgrade<br />
Rearrancar la máquina en caso de que se actualice la versión del kernel.<br />
<br />
<li> Añadir repositorio VNUML a /etc/apt/sources.lst:</li><br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian binary/" >> /etc/apt/sources.list<br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian-testing binary/" >> /etc/apt/sources.list<br />
<br />
<li> Instalar paquetes:</li><br />
apt-get update <br />
apt-get install virt-manager virt-viewer build-essential \<br />
libxml-libxml-perl vncviewer vlan xterm bridge-utils screen \<br />
curl vnuml linux-um libterm-readline-perl-perl zlib-bin zlib1g-dev \<br />
libxen3-dev libxml2-dev libgnutls-dev libsasl2-dev libsdl1.2-dev \<br />
libdevmapper-dev dnsmasq xbase-clients pkg-config<br />
<br />
<li>Si se usa la versión de Ubuntu de 64 bits hay que instalar las librerías de compatibilidad de 32 bits:</li><br />
apt-get install ia32-libs<br />
<br />
<li>Instalar qemu-kvm version 0.11.1 (la version 0.12.2 da errores):</li><br />
wget http://sourceforge.net/projects/kvm/files/qemu-kvm/0.11.1/qemu-kvm-0.11.1.tar.gz/download<br />
tar xfvz qemu-kvm-0.11.1.tar.gz<br />
cd qemu-kvm-0.11.1<br />
./configure --prefix=/usr && make && make install<br />
ln -s /usr/bin/qemu-system-x86_64 /usr/bin/kvm<br />
Editar /etc/modules y añadir:<br />
kvm <br />
kvm_intel<br />
<br />
<li>Instalar libvirt 0.7.6:</li><br />
apt-get install libvirt-bin<br />
/etc/init.d/libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.7.6.tar.gz<br />
tar xfvz libvirt-0.7.6.tar.gz<br />
cd libvirt-0.7.6<br />
./configure --prefix=/usr --without-storage-disk && make && make install<br />
/etc/init.d/libvirt-bin start<br />
<br />
<li>Instalar librería perl de acceso a libvirt (Sys::Virt) mediante CPAN (no está disponible como paquete ubuntu)</li><br />
perl -MCPAN -e "CPAN::Shell->force(qw(install Sys::Virt));"<br />
Note: answer NO to the question "Are you ready for manual configuration?"<br />
<br />
<li>Instalar rootfilesystem de VNUML, enlaces del kernel y crear clave rsa:</li><br />
cd /usr/share/vnuml/filesystems<br />
wget http://www.dit.upm.es/vnuml/download/scripts/root-fs-installer<br />
perl root-fs-installer<br />
cd ../kernels<br />
ln -s linux-2.6.28.10-1m linux<br />
ssh-keygen -t rsa1<br />
<br />
<li>Instalar VNX:</li><br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-0.12b.tgz<br />
tar xfvz vnx-0.12b.tgz<br />
cd vnx-0.12b<br />
./install-vnx<br />
</ul><br />
--></div>Davidhttps://web.dit.upm.es/vnumlwiki/index.php?title=Vnx-install&diff=4114Vnx-install2011-02-24T19:06:41Z<p>David: /* Installation over Fedora 11 (Draft) */</p>
<hr />
<div>{{Title|VNX (Virtual Networks over X virtualization) v0.14 beta}}<br />
<br />
== Installation over Ubuntu 10.04/9.10 ==<br />
<br />
This section describes the procedure for installing VNX over Ubuntu 10.04 or 9.10. Open a root shell window and follow these steps:<br />
<ul><br />
<br />
<li>Install all packages required (basic development, virtualization, perl libraries and auxiliar packages):</li><br />
apt-get update<br />
apt-get install build-essential qemu-kvm libvirt-bin vlan xterm \<br />
bridge-utils screen virt-manager virt-viewer libxml-checker-perl \<br />
libxml-parser-perl libnetaddr-ip-perl libnet-pcap-perl \<br />
libnet-ipv6addr-perl liberror-perl libexception-class-perl \<br />
uml-utilities libxml-libxml-perl libxml2-dev libgnutls-dev \<br />
libdevmapper-dev libterm-readline-perl-perl libnet-telnet-perl \<br />
libnet-ip-perl libreadonly-perl libmath-round-perl libappconfig-perl \<br />
libdbi-perl graphviz libnl-dev genisoimage gnome-terminal<br />
<br />
<!--Note: for Ubuntu 9.04 change "qemu-kvm" package by "qemu kvm" --><br />
<li>If you use 64 bits version of Ubuntu, install 32 bits compatibility libraries:</li><br />
apt-get install ia32-libs<br />
<br />
<li>Install libvirt 0.8.5:</li><br />
/etc/init.d/libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.8.5.tar.gz<br />
tar xfvz libvirt-0.8.5.tar.gz<br />
cd libvirt-0.8.5<br />
./configure --without-xen --prefix=/usr && make && make install<br />
/etc/init.d/libvirt-bin start<br />
<br />
'''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.<br />
<br />
<li>Install Sys::Virt perl module:</li><br />
<ul><br />
<li>For Ubuntu 10.04, just install the libsys-virt-perl package</li><br />
apt-get install libsys-virt-perl<br />
<!--<br />
'''IMPORTANT NOTE''': Windows XP virtual machines started with VNX over Ubuntu 9.10 frequently hang when executing commands or with high traffic loads. The problem could be related with virtual network drivers. We are investigating the problem to find a solution. By now, Ubuntu 10.04 is the recomended platform to test VNX.<br />
--><br />
<li>For Ubuntu 9.10, as Sys::Virt library is not available as a package, install it manually:</li><br />
wget http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.2.3.tar.gz<br />
tar xfvz Sys-Virt-0.2.3.tar.gz <br />
cd Sys-Virt-0.2.3<br />
perl Makefile.PL<br />
make install<br />
</ul><br />
<br />
<li>Install VNX:</li><br />
mkdir /tmp/vnx-update<br />
cd /tmp/vnx-update<br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-latest.tgz<br />
tar xfvz vnx-latest.tgz<br />
cd vnx-*<br />
./install_vnx<br />
<br />
<li>Create the VNX config file (/etc/vnx.conf). You just can move the sample config file:</li><br />
mv /etc/vnx.conf.samble /etc/vnx.conf<br />
<br />
<li>Download root file systems from http://idefix.dit.upm.es/download/vnx/filesystems and copy them to /usr/share/vnx/filesystems directory:</li><br />
cd /usr/share/vnx/filesystems<br />
<br />
# ubuntu server<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.10-v01.qcow2.bz2<br />
bunzip2 root_fs_ubuntu-10.10-v01.qcow2.bz2<br />
ln -s root_fs_ubuntu-10.10-v01.qcow2 root_fs_ubuntu<br />
<br />
# ubuntu with gui<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.10-gui-v01.qcow2.bz2<br />
bunzip2 root_fs_ubuntu-10.10-gui-v01.qcow2.bz2<br />
ln -s root_fs_ubuntu-10.10-gui-v01.qcow2 root_fs_ubuntu-gui<br />
<br />
# freebsd server<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-8.1-v01.qcow2.bz2<br />
bunzip2 root_fs_freebsd-8.1-v01.qcow2.bz2<br />
ln -s root_fs_freebsd-8.1-v01.qcow2 root_fs_freebsd<br />
<br />
# freebsd gui<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-8.1-gui-v01.qcow2.bz2<br />
bunzip2 root_fs_freebsd-8.1-gui-v01.qcow2.bz2<br />
ln -s root_fs_freebsd-8.1-gui-v01.qcow2 root_fs_freebsd-gui<br />
<br />
# winxp and win7<br />
# Sorry! Unfortunately for legal reasons we cannot distribute windows XP<br />
# or Windows 7 root filesystems. See VNX documentation for detailed recipes<br />
# to create these root fylesystems from scratch<br />
<br />
<li>Additionally, if you plan to use VNUML root filesystem:</li><br />
# VNUML root_fs_tutorial and kernel<br />
cd /usr/share/vnx/filesystems<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_tutorial-0.6.0.bz2<br />
bunzip2 root_fs_tutorial-0.6.0.bz2<br />
ln -s root_fs_tutorial-0.6.0 root_fs_tutorial<br />
cd /usr/share/vnx/kernels<br />
wget -N http://jungla.dit.upm.es/~vnx/download/kernels/linux-2.6.18.1-bb2-xt-4m<br />
chmod +x linux-2.6.18.1-bb2-xt-4m<br />
ln -s linux-2.6.18.1-bb2-xt-4m linux<br />
<br />
</ul><br />
<br />
'''NOTE for Ubuntu 10.04.1''': It seems that an additional package has to be installed:<br />
apt-get install kvm-pxe<br />
<br />
=== Additional install steps for Dynamips support ===<br />
<br />
* Install Dynamips and Dynagen:<br />
apt-get install dynamips dynagen<br />
<br />
* Create a file /etc/init.d/dynamips (taken from http://7200emu.hacki.at/viewtopic.php?t=2198):<br />
<pre><br />
#!/bin/sh<br />
# Start/stop the dynamips program as a daemon.<br />
#<br />
### BEGIN INIT INFO<br />
# Provides: dynamips<br />
# Default-Start: 2 3 4 5<br />
# Default-Stop: 0 1 6<br />
# Short-Description: Cisco hardware emulator daemon<br />
### END INIT INFO<br />
<br />
DAEMON=/usr/bin/dynamips<br />
NAME=dynamips<br />
PORT=7200<br />
PIDFILE=/var/run/$NAME.pid <br />
LOGFILE=/var/log/$NAME.log<br />
DESC="Cisco Emulator"<br />
SCRIPTNAME=/etc/init.d/$NAME<br />
<br />
test -f $DAEMON || exit 0<br />
<br />
. /lib/lsb/init-functions<br />
<br />
<br />
case "$1" in<br />
start) log_daemon_msg "Starting $DESC " "$NAME"<br />
start-stop-daemon --start --chdir /tmp --background --make-pidfile --pidfile $PIDFILE --name $NAME --startas $DAEMON -- -H $PORT -l $LOGFILE<br />
log_end_msg $?<br />
;;<br />
stop) log_daemon_msg "Stopping $DESC " "$NAME"<br />
start-stop-daemon --stop --quiet --pidfile $PIDFILE --name $NAME<br />
log_end_msg $?<br />
;;<br />
restart) log_daemon_msg "Restarting $DESC " "$NAME"<br />
start-stop-daemon --stop --retry 5 --quiet --pidfile $PIDFILE --name $NAME<br />
start-stop-daemon --start --chdir /tmp --background --make-pidfile --pidfile $PIDFILE --name $NAME --startas $DAEMON -- -H $PORT -l $LOGFILE<br />
log_end_msg $?<br />
;;<br />
status)<br />
status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $? <br />
#status $NAME<br />
#RETVAL=$?<br />
;; <br />
*) log_action_msg "Usage: $SCRIPTNAME {start|stop|restart|status}"<br />
exit 2<br />
;;<br />
esac<br />
exit 0<br />
<br />
</pre><br />
<br />
* Set execution permissions for the script and add it to system start-up:<br />
chmod +x /etc/init.d/dynamips<br />
update-rc.d dynamips defaults<br />
/etc/init.d/dynamips start<br />
<br />
* Download and install cisco IOS image:<br />
cd /usr/share/vnx/filesystems<br />
# Cisco image<br />
wget ... c3640-js-mz.124-19.image<br />
ln -s c3640-js-mz.124-19.image c3640<br />
<br />
* Calculate the idle-pc value for your computer following the procedure in http://dynagen.org/tutorial.htm:<br />
dynagen /usr/share/vnx/examples/R.net<br />
console R # type 'no' to exit the config wizard and wait <br />
# for the router to completely start <br />
idle-pc get R<br />
Once you know the idle-pc value for your system, include it in /etc/vnx.conf file.<br />
<br />
=== Additional install steps for Olive support ===<br />
<br />
Several additional steps are needed to support Olive (Juniper) routers in VNX scenarios:<br />
<br />
<ul><br />
<br />
<!-- Ya no hace falta desde que se usa <qemu:commandline><br />
<br />
<li>Install a patched version of libvirt 0.8.5 with support to define the bios used by a virtual machine:</li><br />
<br />
<ul><br />
<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><br />
<pre><br />
diff -crB libvirt-0.8.5.orig/src/conf/domain_conf.c libvirt-0.8.5/src/conf/domain_conf.c<br />
*** libvirt-0.8.5.orig/src/conf/domain_conf.c 2010-11-22 11:38:08.000000000 +0100<br />
--- libvirt-0.8.5/src/conf/domain_conf.c 2010-11-22 11:47:41.000000000 +0100<br />
***************<br />
*** 4267,4272 ****<br />
--- 4267,4274 ----<br />
if (node)<br />
def->mem.hugepage_backed = 1;<br />
<br />
+ def->biosfile = virXPathString("string(./biosfile[1])", ctxt);<br />
+ <br />
/* Extract other memory tunables */<br />
if (virXPathULong("string(./memtune/hard_limit)", ctxt,<br />
&def->mem.hard_limit) < 0)<br />
diff -crB libvirt-0.8.5.orig/src/conf/domain_conf.h libvirt-0.8.5/src/conf/domain_conf.h<br />
*** libvirt-0.8.5.orig/src/conf/domain_conf.h 2010-11-22 11:38:08.000000000 +0100<br />
--- libvirt-0.8.5/src/conf/domain_conf.h 2010-11-22 11:40:18.000000000 +0100<br />
***************<br />
*** 885,890 ****<br />
--- 885,891 ----<br />
unsigned long min_guarantee;<br />
unsigned long swap_hard_limit;<br />
} mem;<br />
+ char *biosfile;<br />
unsigned short vcpus;<br />
unsigned short maxvcpus;<br />
int cpumasklen;<br />
diff -crB libvirt-0.8.5.orig/src/qemu/qemu_conf.c libvirt-0.8.5/src/qemu/qemu_conf.c<br />
*** libvirt-0.8.5.orig/src/qemu/qemu_conf.c 2010-11-22 11:38:08.000000000 +0100<br />
--- libvirt-0.8.5/src/qemu/qemu_conf.c 2010-11-22 11:41:05.000000000 +0100<br />
***************<br />
*** 3984,3989 ****<br />
--- 3984,3995 ----<br />
ADD_ARG_LIT(emulator);<br />
ADD_ARG_LIT("-S");<br />
<br />
+ if(def->biosfile)<br />
+ {<br />
+ ADD_ARG_LIT("-bios");<br />
+ ADD_ARG_LIT(def->biosfile);<br />
+ }<br />
+ <br />
/* This should *never* be NULL, since we always provide<br />
* a machine in the capabilities data for QEMU. So this<br />
* check is just here as a safety in case the unexpected<br />
</pre><br />
<br />
<li>Install libvirt 0.8.5 with that patch applied:</li><br />
service libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.8.5.tar.gz<br />
tar xfvz libvirt-0.8.5.tar.gz <br />
cd libvirt-0.8.5<br />
patch -p1 -i ../libvirt-0.8.5-biosfile.patch <br />
./configure --without-xen --prefix=/usr && make && make install<br />
service libvirt-bin start<br />
<br />
</ul><br />
--><br />
<li>Download old qemu bios from 0.10.6 version and copy it to /usr/share/qemu directory:</li><br />
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.10.6/qemu-kvm-0.10.6.tar.gz<br />
tar xfvz qemu-kvm-0.10.6.tar.gz<br />
cp qemu-kvm-0.10.6/pc-bios/bios.bin /usr/share/qemu-kvm/bios-0.10.6.bin<br />
<br />
<!-- Not needed, it seems to work without downloading this drivers<br />
<li>Download i82559 ROM from the latest qemu versions (Ubuntu 10.04 does not include that ROM in qemu-kvm package):</li><br />
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.12.5/qemu-kvm-0.12.5.tar.gz<br />
tar xfvz qemu-kvm-0.12.5.tar.gz<br />
cp qemu-kvm-0.12.5/pc-bios/pxe-i82559er.bin /usr/share/qemu-kvm/<br />
--><br />
</ul><br />
<br />
== Installation over Fedora 11 (Draft) ==<br />
<br />
Follow this steps to install VNX over Fedora 11:<br />
<ul><br />
<br />
<li>Install packages:</li><br />
yum -y groupinstall "Development Tools"<br />
yum install qemu-kvm libvirt virt-manager virt-viewer perl-XML-LibXML<br />
yum install perl-XML-DOM perl-NetAddr-IP perl-Readonly perl-TermReadKey<br />
yum install perl-Net-Pcap perl-Net-IPv6Addr perl-Net-Telnet perl-Error<br />
yum install perl-Exception-Class perl-ExtUtils-MakeMaker tunctl screen wget<br />
yum install libxml2-devel gnutls-devel device-mapper-devel uml_utilities <br />
yum install roxterm xterm graphviz perl-AppConfig<br />
<br />
<li>Install libvirt 0.8.5:</li><br />
/etc/init.d/libvirtd stop<br />
wget http://libvirt.org/sources/libvirt-0.8.5.tar.gz<br />
tar xfvz libvirt-0.8.5.tar.gz<br />
cd libvirt-0.8.5<br />
./configure --without-xen --prefix=/usr && make && make install<br />
/etc/init.d/libvirtd start<br />
<br />
<li>Install SysVirt manually:</li><br />
wget http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.2.4.tar.gz<br />
tar xfvz Sys-Virt-0.2.4.tar.gz<br />
cd Sys-Virt-0.2.4<br />
perl Makefile.PL<br />
make install<br />
<!--<br />
<li> Instalar VNUML sobre Fedora 11 siguiendo la receta en http://www.dit.upm.es/vnumlwiki/index.php/Fedora11</li><br />
<br />
<li> Instalar paquetes y librerías necesarias:</li><br />
yum install qemu-kvm libvirt virt-manager virt-viewer perl-XML-LibXML perl-Sys-Virt<br />
yum -y install bridge-utils readline-devel perl-Module-Build screen expat-devel libpcap-devel <br />
yum -y install perl-Net-Pcap perl-NetAddr-IP perl-Net-IPv6Addr perl-XML-DOM perl-Exception-Class<br />
yum -y install perl-TermReadKey perl-Error perl-CPAN uml_utilities xterm tunctl<br />
<br />
<li>Install XML::Checker perl library:</li><br />
perl -MCPAN -e shell<br />
install XML::Checker<br />
--><br />
<li>Add symbolic link for kvm:</li><br />
ln -s /usr/bin/qemu-kvm /usr/bin/kvm<br />
<br />
<li>Install VNX:</li><br />
mkdir /tmp/vnx-update<br />
cd /tmp/vnx-update<br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-latest.tgz<br />
tar xfvz vnx-latest.tgz<br />
cd vnx-*<br />
./install_vnx<br />
<br />
<li>Create the VNX config file (/etc/vnx.conf). You just can move the sample config file:</li><br />
mv /etc/vnx.conf.samble /etc/vnx.conf<br />
<br />
<li>Disable host firewall or, alternatively, configure "tun" type network interfaces as trusted interfaces (System->Firewall->Trusted Interfaces).</li><br />
<br />
<li>Download root file systems from http://idefix.dit.upm.es/download/vnx/filesystems and copy them to /usr/share/vnx/filesystems directory:</li><br />
cd /usr/share/vnx/filesystems<br />
<br />
# ubuntu server<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.10-v01.qcow2.bz2<br />
bunzip2 root_fs_ubuntu-10.10-v01.qcow2.bz2<br />
ln -s root_fs_ubuntu-10.10-v01.qcow2 root_fs_ubuntu<br />
<br />
# ubuntu with gui<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.10-gui-v01.qcow2.bz2<br />
bunzip2 root_fs_ubuntu-10.10-gui-v01.qcow2.bz2<br />
ln -s root_fs_ubuntu-10.10-gui-v01.qcow2 root_fs_ubuntu-gui<br />
<br />
# freebsd server<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-8.1-v01.qcow2.bz2<br />
bunzip2 root_fs_freebsd-8.1-v01.qcow2.bz2<br />
ln -s root_fs_freebsd-8.1-v01.qcow2 root_fs_freebsd<br />
<br />
# freebsd gui<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-8.1-gui-v01.qcow2.bz2<br />
bunzip2 root_fs_freebsd-8.1-gui-v01.qcow2.bz2<br />
ln -s root_fs_freebsd-8.1-gui-v01.qcow2 root_fs_freebsd-gui<br />
<br />
# winxp and win7<br />
# Sorry! Unfortunately for legal reasons we cannot distribute windows XP<br />
# or Windows 7 root filesystems. See VNX documentation for detailed recipes<br />
# to create these root fylesystems from scratch<br />
<br />
</ul><br />
<br />
=== Additional install steps for Dynamips support ===<br />
<br />
* Install Dynamips and Dynagen:<br />
wget http://downloads.sourceforge.net/project/dyna-gen/dynamips%20Linux%20RPM/0.2.8-RC2/dynamips-0.2.8RC2-1.i386.rpm<br />
rpm -i dynamips-0.2.8RC2-1.i386.rpm<br />
wget http://downloads.sourceforge.net/project/dyna-gen/dynagen%20source%20_%20Linux/dynagen%200.11.0/dynagen-0.11.0-1.fc9.noarch.rpm<br />
rpm -i dynagen-0.11.0-1.fc9.noarch.rpm<br />
<br />
* Set execution permissions for the script and add it to system start-up:<br />
chkconfig --add dynamips<br />
/etc/init.d/dynamips start<br />
<br />
* Download and install cisco IOS image:<br />
cd /usr/share/vnx/filesystems<br />
# Cisco image<br />
wget ... c3640-js-mz.124-19.image<br />
ln -s c3640-js-mz.124-19.image c3640<br />
<br />
* Calculate the idle-pc value for your computer following the procedure in http://dynagen.org/tutorial.htm:<br />
dynagen /usr/share/vnx/examples/R.net<br />
console R # type 'no' to exit the config wizard and wait <br />
# for the router to completely start <br />
idle-pc get R<br />
Once you know the idle-pc value for your system, include it in /etc/vnx.conf file.<br />
<br />
=== Additional install steps for Olive support ===<br />
<br />
Several additional steps are needed to support Olive (Juniper) routers in VNX scenarios:<br />
<br />
<ul><br />
<br />
<li>Download old qemu bios from 0.10.6 version and copy it to /usr/share/qemu directory:</li><br />
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.10.6/qemu-kvm-0.10.6.tar.gz<br />
tar xfvz qemu-kvm-0.10.6.tar.gz<br />
cp qemu-kvm-0.10.6/pc-bios/bios.bin /usr/share/qemu/bios-0.10.6.bin<br />
<br />
</ul><br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<!-- COSAS ANTIGUAS --><br />
<br />
<!--li>Modificar vnumlparser.pl, sustituyendo en la función mode_t la línea en ):</li><br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
<br />
por:<br />
<br />
if (! -e "/dev/net/tun") {<br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
}<br />
<br />
Explicación: el módulo tun se ha integrado en el kernel a partir de la 10.04, por lo que no es necesario cargarlo como hasta ahora mediante "modprobe tun". El cambio anterior simplemente comprueba si existe el dispositivo /dev/net/tun y carga el modulo en caso de que no exista.<br />
--><br />
<br />
<br />
<!--li>Modificar vnumlparser.pl, sustituyendo en la función mode_t la línea en ):</li><br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
<br />
por:<br />
<br />
if (! -e "/dev/net/tun") {<br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
}<br />
<br />
Explicación: el módulo tun se ha integrado en el kernel a partir de la 10.04, por lo que no es necesario cargarlo como hasta ahora mediante "modprobe tun". El cambio anterior simplemente comprueba si existe el dispositivo /dev/net/tun y carga el modulo en caso de que no exista.<br />
--><br />
<br />
<!--<br />
Pasos a seguir para instalar VNX sobre Ubuntu 9.10. <br />
<br />
'''Nota importante''': se han detectado importantes problemas de prestaciones cuando se utiliza el sistema de ficheros ext4 con Ubuntu 9.10. Por ello, y hasta que se localice el origen de dichas ineficiencias, se recomienda utilizar ext3. <br />
<ul><br />
<br />
<li> Instalar Ubuntu 9.10 y actualizar con:</li><br />
apt-get update; apt-get dist-upgrade<br />
--><br />
<!--<br />
<li>Añadir repositorios VNUML a /etc/apt/sources.lst:</li><br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian binary/" >> /etc/apt/sources.list<br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian-testing binary/" >> /etc/apt/sources.list<br />
--><br />
<!--<br />
<li>Install paquetes básicos de desarrollo, paquetes de virtualización (qemu-kvm, libvirt, vnuml) y librerías y paquetes auxiliares</li><br />
apt-get update<br />
apt-get install build-essential qemu-kvm libvirt-bin libvirt-dev \<br />
virt-manager virt-viewer vlan xterm bridge-utils screen uml-utilities \<br />
libxml-checker-perl libxml-parser-perl libnetaddr-ip-perl libnet-pcap-perl \<br />
libnet-ipv6addr-perl liberror-perl libexception-class-perl libxml-libxml-perl \<br />
libxml2-dev libgnutls-dev libdevmapper-dev libterm-readline-perl-perl <br />
<br />
<br />
<br />
curl vnuml linux-um <br />
<br />
<li>Si se usa la versión de Ubuntu de 64 bits hay que instalar las librerías de compatibilidad de 32 bits:</li><br />
apt-get install ia32-libs<br />
<br />
<li>Install qemu-kvm version 0.12.4 (version 0.11 which comes as apackage in 9.10 provokes hanging problems in Windows virtual machines when executing commands -something relates apparently with mounting cdroms in vms-):</li><br />
wget http://sourceforge.net/projects/kvm/files/qemu-kvm/0.11.1/qemu-kvm-0.11.1.tar.gz/download<br />
tar xfvz qemu-kvm-0.11.1.tar.gz<br />
cd qemu-kvm-0.11.1<br />
./configure --prefix=/usr && make && make install<br />
ln -s /usr/bin/qemu-system-x86_64 /usr/bin/kvm<br />
Editar /etc/modules y añadir:<br />
kvm <br />
kvm_intel<br />
<br />
wget http://sourceforge.net/projects/kvm/files/kvm-kmod/2.6.31.6b/kvm-kmod-2.6.31.6b.tar.bz2/download<br />
<br />
<li>Instalar libvirt 0.8.0:</li><br />
/etc/init.d/libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.8.0.tar.gz<br />
tar xfvz libvirt-0.8.0.tar.gz<br />
cd libvirt-0.8.0<br />
./configure --prefix=/usr && make && make install<br />
/etc/init.d/libvirt-bin start<br />
<br />
<li> Instalar la librería perl de acceso a libvirt (Sys::Virt) desde CPAN (dicha librería no esta disponible como paquete para Ubuntu 9.10):</li><br />
--><br />
<!-- wget http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.2.2.tar.gz<br />
tar xfvz Sys-Virt-0.2.2.tar.gz <br />
cd Sys-Virt-0.2.2<br />
perl Makefile.PL<br />
make install<br />
--><br />
<!--<br />
perl -MCPAN -e "CPAN::Shell->force(qw(install Sys::Virt));"<br />
Nota: constestar YES a la pregunta "Would you like me to configure as much as posible automatically?" y a "Is it OK to try to connect to the Internet?" <br />
<br />
<li>Instalar rootfilesystem de VNUML, enlaces del kernel y crear clave rsa:</li><br />
cd /usr/share/vnuml/filesystems<br />
wget http://www.dit.upm.es/vnuml/download/scripts/root-fs-installer<br />
perl root-fs-installer<br />
cd ../kernels<br />
ln -s linux-2.6.28.10-1m linux<br />
ssh-keygen -t rsa1<br />
<br />
<li>Instalar VNX:</li><br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-0.12b.tgz<br />
tar xfvz vnx-0.12b.tgz<br />
cd vnx-0.12b<br />
./install-vnx<br />
</ul><br />
<br />
Notas:<br />
http://www.ubuntu-es.org/node/128867<br />
175 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-headers-2.6.32-02063209_2.6.32-02063209_all.deb<br />
176 http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-image-2.6.32-02063209-generic_2.6.32-02063209_amd64.deb<br />
177 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-image-2.6.32-02063209-generic_2.6.32-02063209_amd64.deb<br />
178 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-headers-2.6.32-02063209-generic_2.6.32-02063209_amd64.deb<br />
--><br />
<br />
<!--<br />
=== Sobre Ubuntu 8.04 ===<br />
<br />
Pasos a seguir para instalar VNX sobre Ubuntu 8.04:<br />
<ul><br />
<br />
<li> Instalar Ubuntu 8.04 y actualizar con:</li><br />
apt-get update; apt-get dist-upgrade<br />
Rearrancar la máquina en caso de que se actualice la versión del kernel.<br />
<br />
<li> Añadir repositorio VNUML a /etc/apt/sources.lst:</li><br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian binary/" >> /etc/apt/sources.list<br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian-testing binary/" >> /etc/apt/sources.list<br />
<br />
<li> Instalar paquetes:</li><br />
apt-get update <br />
apt-get install virt-manager virt-viewer build-essential \<br />
libxml-libxml-perl vncviewer vlan xterm bridge-utils screen \<br />
curl vnuml linux-um libterm-readline-perl-perl zlib-bin zlib1g-dev \<br />
libxen3-dev libxml2-dev libgnutls-dev libsasl2-dev libsdl1.2-dev \<br />
libdevmapper-dev dnsmasq xbase-clients pkg-config<br />
<br />
<li>Si se usa la versión de Ubuntu de 64 bits hay que instalar las librerías de compatibilidad de 32 bits:</li><br />
apt-get install ia32-libs<br />
<br />
<li>Instalar qemu-kvm version 0.11.1 (la version 0.12.2 da errores):</li><br />
wget http://sourceforge.net/projects/kvm/files/qemu-kvm/0.11.1/qemu-kvm-0.11.1.tar.gz/download<br />
tar xfvz qemu-kvm-0.11.1.tar.gz<br />
cd qemu-kvm-0.11.1<br />
./configure --prefix=/usr && make && make install<br />
ln -s /usr/bin/qemu-system-x86_64 /usr/bin/kvm<br />
Editar /etc/modules y añadir:<br />
kvm <br />
kvm_intel<br />
<br />
<li>Instalar libvirt 0.7.6:</li><br />
apt-get install libvirt-bin<br />
/etc/init.d/libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.7.6.tar.gz<br />
tar xfvz libvirt-0.7.6.tar.gz<br />
cd libvirt-0.7.6<br />
./configure --prefix=/usr --without-storage-disk && make && make install<br />
/etc/init.d/libvirt-bin start<br />
<br />
<li>Instalar librería perl de acceso a libvirt (Sys::Virt) mediante CPAN (no está disponible como paquete ubuntu)</li><br />
perl -MCPAN -e "CPAN::Shell->force(qw(install Sys::Virt));"<br />
Note: answer NO to the question "Are you ready for manual configuration?"<br />
<br />
<li>Instalar rootfilesystem de VNUML, enlaces del kernel y crear clave rsa:</li><br />
cd /usr/share/vnuml/filesystems<br />
wget http://www.dit.upm.es/vnuml/download/scripts/root-fs-installer<br />
perl root-fs-installer<br />
cd ../kernels<br />
ln -s linux-2.6.28.10-1m linux<br />
ssh-keygen -t rsa1<br />
<br />
<li>Instalar VNX:</li><br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-0.12b.tgz<br />
tar xfvz vnx-0.12b.tgz<br />
cd vnx-0.12b<br />
./install-vnx<br />
</ul><br />
--></div>Davidhttps://web.dit.upm.es/vnumlwiki/index.php?title=Vnx-install&diff=4113Vnx-install2011-02-24T19:03:34Z<p>David: /* Installation over Fedora 11 (Draft) */</p>
<hr />
<div>{{Title|VNX (Virtual Networks over X virtualization) v0.14 beta}}<br />
<br />
== Installation over Ubuntu 10.04/9.10 ==<br />
<br />
This section describes the procedure for installing VNX over Ubuntu 10.04 or 9.10. Open a root shell window and follow these steps:<br />
<ul><br />
<br />
<li>Install all packages required (basic development, virtualization, perl libraries and auxiliar packages):</li><br />
apt-get update<br />
apt-get install build-essential qemu-kvm libvirt-bin vlan xterm \<br />
bridge-utils screen virt-manager virt-viewer libxml-checker-perl \<br />
libxml-parser-perl libnetaddr-ip-perl libnet-pcap-perl \<br />
libnet-ipv6addr-perl liberror-perl libexception-class-perl \<br />
uml-utilities libxml-libxml-perl libxml2-dev libgnutls-dev \<br />
libdevmapper-dev libterm-readline-perl-perl libnet-telnet-perl \<br />
libnet-ip-perl libreadonly-perl libmath-round-perl libappconfig-perl \<br />
libdbi-perl graphviz libnl-dev genisoimage gnome-terminal<br />
<br />
<!--Note: for Ubuntu 9.04 change "qemu-kvm" package by "qemu kvm" --><br />
<li>If you use 64 bits version of Ubuntu, install 32 bits compatibility libraries:</li><br />
apt-get install ia32-libs<br />
<br />
<li>Install libvirt 0.8.5:</li><br />
/etc/init.d/libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.8.5.tar.gz<br />
tar xfvz libvirt-0.8.5.tar.gz<br />
cd libvirt-0.8.5<br />
./configure --without-xen --prefix=/usr && make && make install<br />
/etc/init.d/libvirt-bin start<br />
<br />
'''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.<br />
<br />
<li>Install Sys::Virt perl module:</li><br />
<ul><br />
<li>For Ubuntu 10.04, just install the libsys-virt-perl package</li><br />
apt-get install libsys-virt-perl<br />
<!--<br />
'''IMPORTANT NOTE''': Windows XP virtual machines started with VNX over Ubuntu 9.10 frequently hang when executing commands or with high traffic loads. The problem could be related with virtual network drivers. We are investigating the problem to find a solution. By now, Ubuntu 10.04 is the recomended platform to test VNX.<br />
--><br />
<li>For Ubuntu 9.10, as Sys::Virt library is not available as a package, install it manually:</li><br />
wget http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.2.3.tar.gz<br />
tar xfvz Sys-Virt-0.2.3.tar.gz <br />
cd Sys-Virt-0.2.3<br />
perl Makefile.PL<br />
make install<br />
</ul><br />
<br />
<li>Install VNX:</li><br />
mkdir /tmp/vnx-update<br />
cd /tmp/vnx-update<br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-latest.tgz<br />
tar xfvz vnx-latest.tgz<br />
cd vnx-*<br />
./install_vnx<br />
<br />
<li>Create the VNX config file (/etc/vnx.conf). You just can move the sample config file:</li><br />
mv /etc/vnx.conf.samble /etc/vnx.conf<br />
<br />
<li>Download root file systems from http://idefix.dit.upm.es/download/vnx/filesystems and copy them to /usr/share/vnx/filesystems directory:</li><br />
cd /usr/share/vnx/filesystems<br />
<br />
# ubuntu server<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.10-v01.qcow2.bz2<br />
bunzip2 root_fs_ubuntu-10.10-v01.qcow2.bz2<br />
ln -s root_fs_ubuntu-10.10-v01.qcow2 root_fs_ubuntu<br />
<br />
# ubuntu with gui<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.10-gui-v01.qcow2.bz2<br />
bunzip2 root_fs_ubuntu-10.10-gui-v01.qcow2.bz2<br />
ln -s root_fs_ubuntu-10.10-gui-v01.qcow2 root_fs_ubuntu-gui<br />
<br />
# freebsd server<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-8.1-v01.qcow2.bz2<br />
bunzip2 root_fs_freebsd-8.1-v01.qcow2.bz2<br />
ln -s root_fs_freebsd-8.1-v01.qcow2 root_fs_freebsd<br />
<br />
# freebsd gui<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-8.1-gui-v01.qcow2.bz2<br />
bunzip2 root_fs_freebsd-8.1-gui-v01.qcow2.bz2<br />
ln -s root_fs_freebsd-8.1-gui-v01.qcow2 root_fs_freebsd-gui<br />
<br />
# winxp and win7<br />
# Sorry! Unfortunately for legal reasons we cannot distribute windows XP<br />
# or Windows 7 root filesystems. See VNX documentation for detailed recipes<br />
# to create these root fylesystems from scratch<br />
<br />
<li>Additionally, if you plan to use VNUML root filesystem:</li><br />
# VNUML root_fs_tutorial and kernel<br />
cd /usr/share/vnx/filesystems<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_tutorial-0.6.0.bz2<br />
bunzip2 root_fs_tutorial-0.6.0.bz2<br />
ln -s root_fs_tutorial-0.6.0 root_fs_tutorial<br />
cd /usr/share/vnx/kernels<br />
wget -N http://jungla.dit.upm.es/~vnx/download/kernels/linux-2.6.18.1-bb2-xt-4m<br />
chmod +x linux-2.6.18.1-bb2-xt-4m<br />
ln -s linux-2.6.18.1-bb2-xt-4m linux<br />
<br />
</ul><br />
<br />
'''NOTE for Ubuntu 10.04.1''': It seems that an additional package has to be installed:<br />
apt-get install kvm-pxe<br />
<br />
=== Additional install steps for Dynamips support ===<br />
<br />
* Install Dynamips and Dynagen:<br />
apt-get install dynamips dynagen<br />
<br />
* Create a file /etc/init.d/dynamips (taken from http://7200emu.hacki.at/viewtopic.php?t=2198):<br />
<pre><br />
#!/bin/sh<br />
# Start/stop the dynamips program as a daemon.<br />
#<br />
### BEGIN INIT INFO<br />
# Provides: dynamips<br />
# Default-Start: 2 3 4 5<br />
# Default-Stop: 0 1 6<br />
# Short-Description: Cisco hardware emulator daemon<br />
### END INIT INFO<br />
<br />
DAEMON=/usr/bin/dynamips<br />
NAME=dynamips<br />
PORT=7200<br />
PIDFILE=/var/run/$NAME.pid <br />
LOGFILE=/var/log/$NAME.log<br />
DESC="Cisco Emulator"<br />
SCRIPTNAME=/etc/init.d/$NAME<br />
<br />
test -f $DAEMON || exit 0<br />
<br />
. /lib/lsb/init-functions<br />
<br />
<br />
case "$1" in<br />
start) log_daemon_msg "Starting $DESC " "$NAME"<br />
start-stop-daemon --start --chdir /tmp --background --make-pidfile --pidfile $PIDFILE --name $NAME --startas $DAEMON -- -H $PORT -l $LOGFILE<br />
log_end_msg $?<br />
;;<br />
stop) log_daemon_msg "Stopping $DESC " "$NAME"<br />
start-stop-daemon --stop --quiet --pidfile $PIDFILE --name $NAME<br />
log_end_msg $?<br />
;;<br />
restart) log_daemon_msg "Restarting $DESC " "$NAME"<br />
start-stop-daemon --stop --retry 5 --quiet --pidfile $PIDFILE --name $NAME<br />
start-stop-daemon --start --chdir /tmp --background --make-pidfile --pidfile $PIDFILE --name $NAME --startas $DAEMON -- -H $PORT -l $LOGFILE<br />
log_end_msg $?<br />
;;<br />
status)<br />
status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $? <br />
#status $NAME<br />
#RETVAL=$?<br />
;; <br />
*) log_action_msg "Usage: $SCRIPTNAME {start|stop|restart|status}"<br />
exit 2<br />
;;<br />
esac<br />
exit 0<br />
<br />
</pre><br />
<br />
* Set execution permissions for the script and add it to system start-up:<br />
chmod +x /etc/init.d/dynamips<br />
update-rc.d dynamips defaults<br />
/etc/init.d/dynamips start<br />
<br />
* Download and install cisco IOS image:<br />
cd /usr/share/vnx/filesystems<br />
# Cisco image<br />
wget ... c3640-js-mz.124-19.image<br />
ln -s c3640-js-mz.124-19.image c3640<br />
<br />
* Calculate the idle-pc value for your computer following the procedure in http://dynagen.org/tutorial.htm:<br />
dynagen /usr/share/vnx/examples/R.net<br />
console R # type 'no' to exit the config wizard and wait <br />
# for the router to completely start <br />
idle-pc get R<br />
Once you know the idle-pc value for your system, include it in /etc/vnx.conf file.<br />
<br />
=== Additional install steps for Olive support ===<br />
<br />
Several additional steps are needed to support Olive (Juniper) routers in VNX scenarios:<br />
<br />
<ul><br />
<br />
<!-- Ya no hace falta desde que se usa <qemu:commandline><br />
<br />
<li>Install a patched version of libvirt 0.8.5 with support to define the bios used by a virtual machine:</li><br />
<br />
<ul><br />
<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><br />
<pre><br />
diff -crB libvirt-0.8.5.orig/src/conf/domain_conf.c libvirt-0.8.5/src/conf/domain_conf.c<br />
*** libvirt-0.8.5.orig/src/conf/domain_conf.c 2010-11-22 11:38:08.000000000 +0100<br />
--- libvirt-0.8.5/src/conf/domain_conf.c 2010-11-22 11:47:41.000000000 +0100<br />
***************<br />
*** 4267,4272 ****<br />
--- 4267,4274 ----<br />
if (node)<br />
def->mem.hugepage_backed = 1;<br />
<br />
+ def->biosfile = virXPathString("string(./biosfile[1])", ctxt);<br />
+ <br />
/* Extract other memory tunables */<br />
if (virXPathULong("string(./memtune/hard_limit)", ctxt,<br />
&def->mem.hard_limit) < 0)<br />
diff -crB libvirt-0.8.5.orig/src/conf/domain_conf.h libvirt-0.8.5/src/conf/domain_conf.h<br />
*** libvirt-0.8.5.orig/src/conf/domain_conf.h 2010-11-22 11:38:08.000000000 +0100<br />
--- libvirt-0.8.5/src/conf/domain_conf.h 2010-11-22 11:40:18.000000000 +0100<br />
***************<br />
*** 885,890 ****<br />
--- 885,891 ----<br />
unsigned long min_guarantee;<br />
unsigned long swap_hard_limit;<br />
} mem;<br />
+ char *biosfile;<br />
unsigned short vcpus;<br />
unsigned short maxvcpus;<br />
int cpumasklen;<br />
diff -crB libvirt-0.8.5.orig/src/qemu/qemu_conf.c libvirt-0.8.5/src/qemu/qemu_conf.c<br />
*** libvirt-0.8.5.orig/src/qemu/qemu_conf.c 2010-11-22 11:38:08.000000000 +0100<br />
--- libvirt-0.8.5/src/qemu/qemu_conf.c 2010-11-22 11:41:05.000000000 +0100<br />
***************<br />
*** 3984,3989 ****<br />
--- 3984,3995 ----<br />
ADD_ARG_LIT(emulator);<br />
ADD_ARG_LIT("-S");<br />
<br />
+ if(def->biosfile)<br />
+ {<br />
+ ADD_ARG_LIT("-bios");<br />
+ ADD_ARG_LIT(def->biosfile);<br />
+ }<br />
+ <br />
/* This should *never* be NULL, since we always provide<br />
* a machine in the capabilities data for QEMU. So this<br />
* check is just here as a safety in case the unexpected<br />
</pre><br />
<br />
<li>Install libvirt 0.8.5 with that patch applied:</li><br />
service libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.8.5.tar.gz<br />
tar xfvz libvirt-0.8.5.tar.gz <br />
cd libvirt-0.8.5<br />
patch -p1 -i ../libvirt-0.8.5-biosfile.patch <br />
./configure --without-xen --prefix=/usr && make && make install<br />
service libvirt-bin start<br />
<br />
</ul><br />
--><br />
<li>Download old qemu bios from 0.10.6 version and copy it to /usr/share/qemu directory:</li><br />
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.10.6/qemu-kvm-0.10.6.tar.gz<br />
tar xfvz qemu-kvm-0.10.6.tar.gz<br />
cp qemu-kvm-0.10.6/pc-bios/bios.bin /usr/share/qemu-kvm/bios-0.10.6.bin<br />
<br />
<!-- Not needed, it seems to work without downloading this drivers<br />
<li>Download i82559 ROM from the latest qemu versions (Ubuntu 10.04 does not include that ROM in qemu-kvm package):</li><br />
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.12.5/qemu-kvm-0.12.5.tar.gz<br />
tar xfvz qemu-kvm-0.12.5.tar.gz<br />
cp qemu-kvm-0.12.5/pc-bios/pxe-i82559er.bin /usr/share/qemu-kvm/<br />
--><br />
</ul><br />
<br />
== Installation over Fedora 11 (Draft) ==<br />
<br />
Follow this steps to install VNX over Fedora 11:<br />
<ul><br />
<br />
<li>Install packages:</li><br />
yum -y groupinstall "Development Tools"<br />
yum install qemu-kvm libvirt virt-manager virt-viewer perl-XML-LibXML<br />
yum install perl-XML-DOM perl-NetAddr-IP perl-Readonly perl-TermReadKey<br />
yum install perl-Net-Pcap perl-Net-IPv6Addr perl-Net-Telnet perl-Error<br />
yum install perl-Exception-Class perl-ExtUtils-MakeMaker tunctl screen wget<br />
yum install libxml2-devel gnutls-devel device-mapper-devel uml_utilities <br />
yum install roxterm xterm graphviz perl-AppConfig<br />
<br />
<li>Install libvirt 0.8.5:</li><br />
/etc/init.d/libvirtd stop<br />
wget http://libvirt.org/sources/libvirt-0.8.5.tar.gz<br />
tar xfvz libvirt-0.8.5.tar.gz<br />
cd libvirt-0.8.5<br />
./configure --without-xen --prefix=/usr && make && make install<br />
/etc/init.d/libvirtd start<br />
<br />
<li>Install SysVirt manually:</li><br />
wget http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.2.4.tar.gz<br />
tar xfvz Sys-Virt-0.2.4.tar.gz<br />
cd Sys-Virt-0.2.4<br />
perl Makefile.PL<br />
make install<br />
<!--<br />
<li> Instalar VNUML sobre Fedora 11 siguiendo la receta en http://www.dit.upm.es/vnumlwiki/index.php/Fedora11</li><br />
<br />
<li> Instalar paquetes y librerías necesarias:</li><br />
yum install qemu-kvm libvirt virt-manager virt-viewer perl-XML-LibXML perl-Sys-Virt<br />
yum -y install bridge-utils readline-devel perl-Module-Build screen expat-devel libpcap-devel <br />
yum -y install perl-Net-Pcap perl-NetAddr-IP perl-Net-IPv6Addr perl-XML-DOM perl-Exception-Class<br />
yum -y install perl-TermReadKey perl-Error perl-CPAN uml_utilities xterm tunctl<br />
<br />
<li>Install XML::Checker perl library:</li><br />
perl -MCPAN -e shell<br />
install XML::Checker<br />
--><br />
<li>Add symbolic link for kvm:</li><br />
ln -s /usr/bin/qemu-kvm /usr/bin/kvm<br />
<br />
<li>Install VNX:</li><br />
mkdir /tmp/vnx-update<br />
cd /tmp/vnx-update<br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-latest.tgz<br />
tar xfvz vnx-latest.tgz<br />
cd vnx-*<br />
./install_vnx<br />
<br />
<li>Create the VNX config file (/etc/vnx.conf). You just can move the sample config file:</li><br />
mv /etc/vnx.conf.samble /etc/vnx.conf<br />
<br />
<li>Diseble host firewall or, alternatively, configure "tun" type network interfaces as como confiables (Sistema->Firewall->Interfaces Confiables").</li><br />
<br />
# ubuntu server<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.10-v01.qcow2.bz2<br />
bunzip2 root_fs_ubuntu-10.10-v01.qcow2.bz2<br />
ln -s root_fs_ubuntu-10.10-v01.qcow2 root_fs_ubuntu<br />
<br />
# ubuntu with gui<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.10-gui-v01.qcow2.bz2<br />
bunzip2 root_fs_ubuntu-10.10-gui-v01.qcow2.bz2<br />
ln -s root_fs_ubuntu-10.10-gui-v01.qcow2 root_fs_ubuntu-gui<br />
<br />
# freebsd server<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-8.1-v01.qcow2.bz2<br />
bunzip2 root_fs_freebsd-8.1-v01.qcow2.bz2<br />
ln -s root_fs_freebsd-8.1-v01.qcow2 root_fs_freebsd<br />
<br />
# freebsd gui<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-8.1-gui-v01.qcow2.bz2<br />
bunzip2 root_fs_freebsd-8.1-gui-v01.qcow2.bz2<br />
ln -s root_fs_freebsd-8.1-gui-v01.qcow2 root_fs_freebsd-gui<br />
<br />
# winxp and win7<br />
# Sorry! Unfortunately for legal reasons we cannot distribute windows XP<br />
# or Windows 7 root filesystems. See VNX documentation for detailed recipes<br />
# to create these root fylesystems from scratch<br />
<br />
</ul><br />
<br />
=== Additional install steps for Dynamips support ===<br />
<br />
* Install Dynamips and Dynagen:<br />
wget http://downloads.sourceforge.net/project/dyna-gen/dynamips%20Linux%20RPM/0.2.8-RC2/dynamips-0.2.8RC2-1.i386.rpm<br />
rpm -i dynamips-0.2.8RC2-1.i386.rpm<br />
wget http://downloads.sourceforge.net/project/dyna-gen/dynagen%20source%20_%20Linux/dynagen%200.11.0/dynagen-0.11.0-1.fc9.noarch.rpm<br />
rpm -i dynagen-0.11.0-1.fc9.noarch.rpm<br />
<br />
* Set execution permissions for the script and add it to system start-up:<br />
chkconfig --add dynamips<br />
/etc/init.d/dynamips start<br />
<br />
* Download and install cisco IOS image:<br />
cd /usr/share/vnx/filesystems<br />
# Cisco image<br />
wget ... c3640-js-mz.124-19.image<br />
ln -s c3640-js-mz.124-19.image c3640<br />
<br />
* Calculate the idle-pc value for your computer following the procedure in http://dynagen.org/tutorial.htm:<br />
dynagen /usr/share/vnx/examples/R.net<br />
console R # type 'no' to exit the config wizard and wait <br />
# for the router to completely start <br />
idle-pc get R<br />
Once you know the idle-pc value for your system, include it in /etc/vnx.conf file.<br />
<br />
=== Additional install steps for Olive support ===<br />
<br />
Several additional steps are needed to support Olive (Juniper) routers in VNX scenarios:<br />
<br />
<ul><br />
<br />
<li>Download old qemu bios from 0.10.6 version and copy it to /usr/share/qemu directory:</li><br />
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.10.6/qemu-kvm-0.10.6.tar.gz<br />
tar xfvz qemu-kvm-0.10.6.tar.gz<br />
cp qemu-kvm-0.10.6/pc-bios/bios.bin /usr/share/qemu/bios-0.10.6.bin<br />
<br />
</ul><br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<!-- COSAS ANTIGUAS --><br />
<br />
<!--li>Modificar vnumlparser.pl, sustituyendo en la función mode_t la línea en ):</li><br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
<br />
por:<br />
<br />
if (! -e "/dev/net/tun") {<br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
}<br />
<br />
Explicación: el módulo tun se ha integrado en el kernel a partir de la 10.04, por lo que no es necesario cargarlo como hasta ahora mediante "modprobe tun". El cambio anterior simplemente comprueba si existe el dispositivo /dev/net/tun y carga el modulo en caso de que no exista.<br />
--><br />
<br />
<br />
<!--li>Modificar vnumlparser.pl, sustituyendo en la función mode_t la línea en ):</li><br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
<br />
por:<br />
<br />
if (! -e "/dev/net/tun") {<br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
}<br />
<br />
Explicación: el módulo tun se ha integrado en el kernel a partir de la 10.04, por lo que no es necesario cargarlo como hasta ahora mediante "modprobe tun". El cambio anterior simplemente comprueba si existe el dispositivo /dev/net/tun y carga el modulo en caso de que no exista.<br />
--><br />
<br />
<!--<br />
Pasos a seguir para instalar VNX sobre Ubuntu 9.10. <br />
<br />
'''Nota importante''': se han detectado importantes problemas de prestaciones cuando se utiliza el sistema de ficheros ext4 con Ubuntu 9.10. Por ello, y hasta que se localice el origen de dichas ineficiencias, se recomienda utilizar ext3. <br />
<ul><br />
<br />
<li> Instalar Ubuntu 9.10 y actualizar con:</li><br />
apt-get update; apt-get dist-upgrade<br />
--><br />
<!--<br />
<li>Añadir repositorios VNUML a /etc/apt/sources.lst:</li><br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian binary/" >> /etc/apt/sources.list<br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian-testing binary/" >> /etc/apt/sources.list<br />
--><br />
<!--<br />
<li>Install paquetes básicos de desarrollo, paquetes de virtualización (qemu-kvm, libvirt, vnuml) y librerías y paquetes auxiliares</li><br />
apt-get update<br />
apt-get install build-essential qemu-kvm libvirt-bin libvirt-dev \<br />
virt-manager virt-viewer vlan xterm bridge-utils screen uml-utilities \<br />
libxml-checker-perl libxml-parser-perl libnetaddr-ip-perl libnet-pcap-perl \<br />
libnet-ipv6addr-perl liberror-perl libexception-class-perl libxml-libxml-perl \<br />
libxml2-dev libgnutls-dev libdevmapper-dev libterm-readline-perl-perl <br />
<br />
<br />
<br />
curl vnuml linux-um <br />
<br />
<li>Si se usa la versión de Ubuntu de 64 bits hay que instalar las librerías de compatibilidad de 32 bits:</li><br />
apt-get install ia32-libs<br />
<br />
<li>Install qemu-kvm version 0.12.4 (version 0.11 which comes as apackage in 9.10 provokes hanging problems in Windows virtual machines when executing commands -something relates apparently with mounting cdroms in vms-):</li><br />
wget http://sourceforge.net/projects/kvm/files/qemu-kvm/0.11.1/qemu-kvm-0.11.1.tar.gz/download<br />
tar xfvz qemu-kvm-0.11.1.tar.gz<br />
cd qemu-kvm-0.11.1<br />
./configure --prefix=/usr && make && make install<br />
ln -s /usr/bin/qemu-system-x86_64 /usr/bin/kvm<br />
Editar /etc/modules y añadir:<br />
kvm <br />
kvm_intel<br />
<br />
wget http://sourceforge.net/projects/kvm/files/kvm-kmod/2.6.31.6b/kvm-kmod-2.6.31.6b.tar.bz2/download<br />
<br />
<li>Instalar libvirt 0.8.0:</li><br />
/etc/init.d/libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.8.0.tar.gz<br />
tar xfvz libvirt-0.8.0.tar.gz<br />
cd libvirt-0.8.0<br />
./configure --prefix=/usr && make && make install<br />
/etc/init.d/libvirt-bin start<br />
<br />
<li> Instalar la librería perl de acceso a libvirt (Sys::Virt) desde CPAN (dicha librería no esta disponible como paquete para Ubuntu 9.10):</li><br />
--><br />
<!-- wget http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.2.2.tar.gz<br />
tar xfvz Sys-Virt-0.2.2.tar.gz <br />
cd Sys-Virt-0.2.2<br />
perl Makefile.PL<br />
make install<br />
--><br />
<!--<br />
perl -MCPAN -e "CPAN::Shell->force(qw(install Sys::Virt));"<br />
Nota: constestar YES a la pregunta "Would you like me to configure as much as posible automatically?" y a "Is it OK to try to connect to the Internet?" <br />
<br />
<li>Instalar rootfilesystem de VNUML, enlaces del kernel y crear clave rsa:</li><br />
cd /usr/share/vnuml/filesystems<br />
wget http://www.dit.upm.es/vnuml/download/scripts/root-fs-installer<br />
perl root-fs-installer<br />
cd ../kernels<br />
ln -s linux-2.6.28.10-1m linux<br />
ssh-keygen -t rsa1<br />
<br />
<li>Instalar VNX:</li><br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-0.12b.tgz<br />
tar xfvz vnx-0.12b.tgz<br />
cd vnx-0.12b<br />
./install-vnx<br />
</ul><br />
<br />
Notas:<br />
http://www.ubuntu-es.org/node/128867<br />
175 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-headers-2.6.32-02063209_2.6.32-02063209_all.deb<br />
176 http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-image-2.6.32-02063209-generic_2.6.32-02063209_amd64.deb<br />
177 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-image-2.6.32-02063209-generic_2.6.32-02063209_amd64.deb<br />
178 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-headers-2.6.32-02063209-generic_2.6.32-02063209_amd64.deb<br />
--><br />
<br />
<!--<br />
=== Sobre Ubuntu 8.04 ===<br />
<br />
Pasos a seguir para instalar VNX sobre Ubuntu 8.04:<br />
<ul><br />
<br />
<li> Instalar Ubuntu 8.04 y actualizar con:</li><br />
apt-get update; apt-get dist-upgrade<br />
Rearrancar la máquina en caso de que se actualice la versión del kernel.<br />
<br />
<li> Añadir repositorio VNUML a /etc/apt/sources.lst:</li><br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian binary/" >> /etc/apt/sources.list<br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian-testing binary/" >> /etc/apt/sources.list<br />
<br />
<li> Instalar paquetes:</li><br />
apt-get update <br />
apt-get install virt-manager virt-viewer build-essential \<br />
libxml-libxml-perl vncviewer vlan xterm bridge-utils screen \<br />
curl vnuml linux-um libterm-readline-perl-perl zlib-bin zlib1g-dev \<br />
libxen3-dev libxml2-dev libgnutls-dev libsasl2-dev libsdl1.2-dev \<br />
libdevmapper-dev dnsmasq xbase-clients pkg-config<br />
<br />
<li>Si se usa la versión de Ubuntu de 64 bits hay que instalar las librerías de compatibilidad de 32 bits:</li><br />
apt-get install ia32-libs<br />
<br />
<li>Instalar qemu-kvm version 0.11.1 (la version 0.12.2 da errores):</li><br />
wget http://sourceforge.net/projects/kvm/files/qemu-kvm/0.11.1/qemu-kvm-0.11.1.tar.gz/download<br />
tar xfvz qemu-kvm-0.11.1.tar.gz<br />
cd qemu-kvm-0.11.1<br />
./configure --prefix=/usr && make && make install<br />
ln -s /usr/bin/qemu-system-x86_64 /usr/bin/kvm<br />
Editar /etc/modules y añadir:<br />
kvm <br />
kvm_intel<br />
<br />
<li>Instalar libvirt 0.7.6:</li><br />
apt-get install libvirt-bin<br />
/etc/init.d/libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.7.6.tar.gz<br />
tar xfvz libvirt-0.7.6.tar.gz<br />
cd libvirt-0.7.6<br />
./configure --prefix=/usr --without-storage-disk && make && make install<br />
/etc/init.d/libvirt-bin start<br />
<br />
<li>Instalar librería perl de acceso a libvirt (Sys::Virt) mediante CPAN (no está disponible como paquete ubuntu)</li><br />
perl -MCPAN -e "CPAN::Shell->force(qw(install Sys::Virt));"<br />
Note: answer NO to the question "Are you ready for manual configuration?"<br />
<br />
<li>Instalar rootfilesystem de VNUML, enlaces del kernel y crear clave rsa:</li><br />
cd /usr/share/vnuml/filesystems<br />
wget http://www.dit.upm.es/vnuml/download/scripts/root-fs-installer<br />
perl root-fs-installer<br />
cd ../kernels<br />
ln -s linux-2.6.28.10-1m linux<br />
ssh-keygen -t rsa1<br />
<br />
<li>Instalar VNX:</li><br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-0.12b.tgz<br />
tar xfvz vnx-0.12b.tgz<br />
cd vnx-0.12b<br />
./install-vnx<br />
</ul><br />
--></div>Davidhttps://web.dit.upm.es/vnumlwiki/index.php?title=Vnx-install&diff=4112Vnx-install2011-02-24T18:53:20Z<p>David: /* Installation over Fedora 11 (Draft) */</p>
<hr />
<div>{{Title|VNX (Virtual Networks over X virtualization) v0.14 beta}}<br />
<br />
== Installation over Ubuntu 10.04/9.10 ==<br />
<br />
This section describes the procedure for installing VNX over Ubuntu 10.04 or 9.10. Open a root shell window and follow these steps:<br />
<ul><br />
<br />
<li>Install all packages required (basic development, virtualization, perl libraries and auxiliar packages):</li><br />
apt-get update<br />
apt-get install build-essential qemu-kvm libvirt-bin vlan xterm \<br />
bridge-utils screen virt-manager virt-viewer libxml-checker-perl \<br />
libxml-parser-perl libnetaddr-ip-perl libnet-pcap-perl \<br />
libnet-ipv6addr-perl liberror-perl libexception-class-perl \<br />
uml-utilities libxml-libxml-perl libxml2-dev libgnutls-dev \<br />
libdevmapper-dev libterm-readline-perl-perl libnet-telnet-perl \<br />
libnet-ip-perl libreadonly-perl libmath-round-perl libappconfig-perl \<br />
libdbi-perl graphviz libnl-dev genisoimage gnome-terminal<br />
<br />
<!--Note: for Ubuntu 9.04 change "qemu-kvm" package by "qemu kvm" --><br />
<li>If you use 64 bits version of Ubuntu, install 32 bits compatibility libraries:</li><br />
apt-get install ia32-libs<br />
<br />
<li>Install libvirt 0.8.5:</li><br />
/etc/init.d/libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.8.5.tar.gz<br />
tar xfvz libvirt-0.8.5.tar.gz<br />
cd libvirt-0.8.5<br />
./configure --without-xen --prefix=/usr && make && make install<br />
/etc/init.d/libvirt-bin start<br />
<br />
'''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.<br />
<br />
<li>Install Sys::Virt perl module:</li><br />
<ul><br />
<li>For Ubuntu 10.04, just install the libsys-virt-perl package</li><br />
apt-get install libsys-virt-perl<br />
<!--<br />
'''IMPORTANT NOTE''': Windows XP virtual machines started with VNX over Ubuntu 9.10 frequently hang when executing commands or with high traffic loads. The problem could be related with virtual network drivers. We are investigating the problem to find a solution. By now, Ubuntu 10.04 is the recomended platform to test VNX.<br />
--><br />
<li>For Ubuntu 9.10, as Sys::Virt library is not available as a package, install it manually:</li><br />
wget http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.2.3.tar.gz<br />
tar xfvz Sys-Virt-0.2.3.tar.gz <br />
cd Sys-Virt-0.2.3<br />
perl Makefile.PL<br />
make install<br />
</ul><br />
<br />
<li>Install VNX:</li><br />
mkdir /tmp/vnx-update<br />
cd /tmp/vnx-update<br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-latest.tgz<br />
tar xfvz vnx-latest.tgz<br />
cd vnx-*<br />
./install_vnx<br />
<br />
<li>Create the VNX config file (/etc/vnx.conf). You just can move the sample config file:</li><br />
mv /etc/vnx.conf.samble /etc/vnx.conf<br />
<br />
<li>Download root file systems from http://idefix.dit.upm.es/download/vnx/filesystems and copy them to /usr/share/vnx/filesystems directory:</li><br />
cd /usr/share/vnx/filesystems<br />
<br />
# ubuntu server<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.10-v01.qcow2.bz2<br />
bunzip2 root_fs_ubuntu-10.10-v01.qcow2.bz2<br />
ln -s root_fs_ubuntu-10.10-v01.qcow2 root_fs_ubuntu<br />
<br />
# ubuntu with gui<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.10-gui-v01.qcow2.bz2<br />
bunzip2 root_fs_ubuntu-10.10-gui-v01.qcow2.bz2<br />
ln -s root_fs_ubuntu-10.10-gui-v01.qcow2 root_fs_ubuntu-gui<br />
<br />
# freebsd server<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-8.1-v01.qcow2.bz2<br />
bunzip2 root_fs_freebsd-8.1-v01.qcow2.bz2<br />
ln -s root_fs_freebsd-8.1-v01.qcow2 root_fs_freebsd<br />
<br />
# freebsd gui<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-8.1-gui-v01.qcow2.bz2<br />
bunzip2 root_fs_freebsd-8.1-gui-v01.qcow2.bz2<br />
ln -s root_fs_freebsd-8.1-gui-v01.qcow2 root_fs_freebsd-gui<br />
<br />
# winxp and win7<br />
# Sorry! Unfortunately for legal reasons we cannot distribute windows XP<br />
# or Windows 7 root filesystems. See VNX documentation for detailed recipes<br />
# to create these root fylesystems from scratch<br />
<br />
<li>Additionally, if you plan to use VNUML root filesystem:</li><br />
# VNUML root_fs_tutorial and kernel<br />
cd /usr/share/vnx/filesystems<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_tutorial-0.6.0.bz2<br />
bunzip2 root_fs_tutorial-0.6.0.bz2<br />
ln -s root_fs_tutorial-0.6.0 root_fs_tutorial<br />
cd /usr/share/vnx/kernels<br />
wget -N http://jungla.dit.upm.es/~vnx/download/kernels/linux-2.6.18.1-bb2-xt-4m<br />
chmod +x linux-2.6.18.1-bb2-xt-4m<br />
ln -s linux-2.6.18.1-bb2-xt-4m linux<br />
<br />
</ul><br />
<br />
'''NOTE for Ubuntu 10.04.1''': It seems that an additional package has to be installed:<br />
apt-get install kvm-pxe<br />
<br />
=== Additional install steps for Dynamips support ===<br />
<br />
* Install Dynamips and Dynagen:<br />
apt-get install dynamips dynagen<br />
<br />
* Create a file /etc/init.d/dynamips (taken from http://7200emu.hacki.at/viewtopic.php?t=2198):<br />
<pre><br />
#!/bin/sh<br />
# Start/stop the dynamips program as a daemon.<br />
#<br />
### BEGIN INIT INFO<br />
# Provides: dynamips<br />
# Default-Start: 2 3 4 5<br />
# Default-Stop: 0 1 6<br />
# Short-Description: Cisco hardware emulator daemon<br />
### END INIT INFO<br />
<br />
DAEMON=/usr/bin/dynamips<br />
NAME=dynamips<br />
PORT=7200<br />
PIDFILE=/var/run/$NAME.pid <br />
LOGFILE=/var/log/$NAME.log<br />
DESC="Cisco Emulator"<br />
SCRIPTNAME=/etc/init.d/$NAME<br />
<br />
test -f $DAEMON || exit 0<br />
<br />
. /lib/lsb/init-functions<br />
<br />
<br />
case "$1" in<br />
start) log_daemon_msg "Starting $DESC " "$NAME"<br />
start-stop-daemon --start --chdir /tmp --background --make-pidfile --pidfile $PIDFILE --name $NAME --startas $DAEMON -- -H $PORT -l $LOGFILE<br />
log_end_msg $?<br />
;;<br />
stop) log_daemon_msg "Stopping $DESC " "$NAME"<br />
start-stop-daemon --stop --quiet --pidfile $PIDFILE --name $NAME<br />
log_end_msg $?<br />
;;<br />
restart) log_daemon_msg "Restarting $DESC " "$NAME"<br />
start-stop-daemon --stop --retry 5 --quiet --pidfile $PIDFILE --name $NAME<br />
start-stop-daemon --start --chdir /tmp --background --make-pidfile --pidfile $PIDFILE --name $NAME --startas $DAEMON -- -H $PORT -l $LOGFILE<br />
log_end_msg $?<br />
;;<br />
status)<br />
status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $? <br />
#status $NAME<br />
#RETVAL=$?<br />
;; <br />
*) log_action_msg "Usage: $SCRIPTNAME {start|stop|restart|status}"<br />
exit 2<br />
;;<br />
esac<br />
exit 0<br />
<br />
</pre><br />
<br />
* Set execution permissions for the script and add it to system start-up:<br />
chmod +x /etc/init.d/dynamips<br />
update-rc.d dynamips defaults<br />
/etc/init.d/dynamips start<br />
<br />
* Download and install cisco IOS image:<br />
cd /usr/share/vnx/filesystems<br />
# Cisco image<br />
wget ... c3640-js-mz.124-19.image<br />
ln -s c3640-js-mz.124-19.image c3640<br />
<br />
* Calculate the idle-pc value for your computer following the procedure in http://dynagen.org/tutorial.htm:<br />
dynagen /usr/share/vnx/examples/R.net<br />
console R # type 'no' to exit the config wizard and wait <br />
# for the router to completely start <br />
idle-pc get R<br />
Once you know the idle-pc value for your system, include it in /etc/vnx.conf file.<br />
<br />
=== Additional install steps for Olive support ===<br />
<br />
Several additional steps are needed to support Olive (Juniper) routers in VNX scenarios:<br />
<br />
<ul><br />
<br />
<!-- Ya no hace falta desde que se usa <qemu:commandline><br />
<br />
<li>Install a patched version of libvirt 0.8.5 with support to define the bios used by a virtual machine:</li><br />
<br />
<ul><br />
<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><br />
<pre><br />
diff -crB libvirt-0.8.5.orig/src/conf/domain_conf.c libvirt-0.8.5/src/conf/domain_conf.c<br />
*** libvirt-0.8.5.orig/src/conf/domain_conf.c 2010-11-22 11:38:08.000000000 +0100<br />
--- libvirt-0.8.5/src/conf/domain_conf.c 2010-11-22 11:47:41.000000000 +0100<br />
***************<br />
*** 4267,4272 ****<br />
--- 4267,4274 ----<br />
if (node)<br />
def->mem.hugepage_backed = 1;<br />
<br />
+ def->biosfile = virXPathString("string(./biosfile[1])", ctxt);<br />
+ <br />
/* Extract other memory tunables */<br />
if (virXPathULong("string(./memtune/hard_limit)", ctxt,<br />
&def->mem.hard_limit) < 0)<br />
diff -crB libvirt-0.8.5.orig/src/conf/domain_conf.h libvirt-0.8.5/src/conf/domain_conf.h<br />
*** libvirt-0.8.5.orig/src/conf/domain_conf.h 2010-11-22 11:38:08.000000000 +0100<br />
--- libvirt-0.8.5/src/conf/domain_conf.h 2010-11-22 11:40:18.000000000 +0100<br />
***************<br />
*** 885,890 ****<br />
--- 885,891 ----<br />
unsigned long min_guarantee;<br />
unsigned long swap_hard_limit;<br />
} mem;<br />
+ char *biosfile;<br />
unsigned short vcpus;<br />
unsigned short maxvcpus;<br />
int cpumasklen;<br />
diff -crB libvirt-0.8.5.orig/src/qemu/qemu_conf.c libvirt-0.8.5/src/qemu/qemu_conf.c<br />
*** libvirt-0.8.5.orig/src/qemu/qemu_conf.c 2010-11-22 11:38:08.000000000 +0100<br />
--- libvirt-0.8.5/src/qemu/qemu_conf.c 2010-11-22 11:41:05.000000000 +0100<br />
***************<br />
*** 3984,3989 ****<br />
--- 3984,3995 ----<br />
ADD_ARG_LIT(emulator);<br />
ADD_ARG_LIT("-S");<br />
<br />
+ if(def->biosfile)<br />
+ {<br />
+ ADD_ARG_LIT("-bios");<br />
+ ADD_ARG_LIT(def->biosfile);<br />
+ }<br />
+ <br />
/* This should *never* be NULL, since we always provide<br />
* a machine in the capabilities data for QEMU. So this<br />
* check is just here as a safety in case the unexpected<br />
</pre><br />
<br />
<li>Install libvirt 0.8.5 with that patch applied:</li><br />
service libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.8.5.tar.gz<br />
tar xfvz libvirt-0.8.5.tar.gz <br />
cd libvirt-0.8.5<br />
patch -p1 -i ../libvirt-0.8.5-biosfile.patch <br />
./configure --without-xen --prefix=/usr && make && make install<br />
service libvirt-bin start<br />
<br />
</ul><br />
--><br />
<li>Download old qemu bios from 0.10.6 version and copy it to /usr/share/qemu directory:</li><br />
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.10.6/qemu-kvm-0.10.6.tar.gz<br />
tar xfvz qemu-kvm-0.10.6.tar.gz<br />
cp qemu-kvm-0.10.6/pc-bios/bios.bin /usr/share/qemu-kvm/bios-0.10.6.bin<br />
<br />
<!-- Not needed, it seems to work without downloading this drivers<br />
<li>Download i82559 ROM from the latest qemu versions (Ubuntu 10.04 does not include that ROM in qemu-kvm package):</li><br />
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.12.5/qemu-kvm-0.12.5.tar.gz<br />
tar xfvz qemu-kvm-0.12.5.tar.gz<br />
cp qemu-kvm-0.12.5/pc-bios/pxe-i82559er.bin /usr/share/qemu-kvm/<br />
--><br />
</ul><br />
<br />
== Installation over Fedora 11 (Draft) ==<br />
<br />
Follow this steps to install VNX over Fedora 11:<br />
<ul><br />
<br />
<li>Install packages:</li><br />
yum -y groupinstall "Development Tools"<br />
yum install qemu-kvm libvirt virt-manager virt-viewer perl-XML-LibXML<br />
yum install perl-XML-DOM perl-NetAddr-IP perl-Readonly perl-TermReadKey<br />
yum install perl-Net-Pcap perl-Net-IPv6Addr perl-Net-Telnet perl-Error<br />
yum install perl-Exception-Class perl-ExtUtils-MakeMaker tunctl screen wget<br />
yum install libxml2-devel gnutls-devel device-mapper-devel uml_utilities <br />
yum install roxterm xterm graphviz perl-AppConfig<br />
<br />
<li>Install libvirt 0.8.5:</li><br />
/etc/init.d/libvirtd stop<br />
wget http://libvirt.org/sources/libvirt-0.8.5.tar.gz<br />
tar xfvz libvirt-0.8.5.tar.gz<br />
cd libvirt-0.8.5<br />
./configure --without-xen --prefix=/usr && make && make install<br />
/etc/init.d/libvirtd start<br />
<br />
<li>Install SysVirt manually:</li><br />
wget http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.2.4.tar.gz<br />
tar xfvz Sys-Virt-0.2.4.tar.gz<br />
cd Sys-Virt-0.2.4<br />
perl Makefile.PL<br />
make install<br />
<!--<br />
<li> Instalar VNUML sobre Fedora 11 siguiendo la receta en http://www.dit.upm.es/vnumlwiki/index.php/Fedora11</li><br />
<br />
<li> Instalar paquetes y librerías necesarias:</li><br />
yum install qemu-kvm libvirt virt-manager virt-viewer perl-XML-LibXML perl-Sys-Virt<br />
yum -y install bridge-utils readline-devel perl-Module-Build screen expat-devel libpcap-devel <br />
yum -y install perl-Net-Pcap perl-NetAddr-IP perl-Net-IPv6Addr perl-XML-DOM perl-Exception-Class<br />
yum -y install perl-TermReadKey perl-Error perl-CPAN uml_utilities xterm tunctl<br />
<br />
<li>Install XML::Checker perl library:</li><br />
perl -MCPAN -e shell<br />
install XML::Checker<br />
--><br />
<li>Add symbolic link for kvm:</li><br />
ln -s /usr/bin/qemu-kvm /usr/bin/kvm<br />
<br />
<li>Instalar VNX:</li><br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-latest.tgz<br />
tar xfvz vnx-latest.tgz<br />
cd vnx-*<br />
./install-vnx<br />
<br />
<li>Create the VNX config file (/etc/vnx.conf). You just can move the sample config file:</li><br />
mv /etc/vnx.conf.samble /etc/vnx.conf<br />
<br />
<li>Diseble host firewall or, alternatively, configure "tun" type network interfaces as como confiables (Sistema->Firewall->Interfaces Confiables").</li><br />
<br />
<br />
# ubuntu server<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.10-v01.qcow2.bz2<br />
bunzip2 root_fs_ubuntu-10.10-v01.qcow2.bz2<br />
ln -s root_fs_ubuntu-10.10-v01.qcow2 root_fs_ubuntu<br />
<br />
# ubuntu with gui<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.10-gui-v01.qcow2.bz2<br />
bunzip2 root_fs_ubuntu-10.10-gui-v01.qcow2.bz2<br />
ln -s root_fs_ubuntu-10.10-gui-v01.qcow2 root_fs_ubuntu-gui<br />
<br />
# freebsd server<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-8.1-v01.qcow2.bz2<br />
bunzip2 root_fs_freebsd-8.1-v01.qcow2.bz2<br />
ln -s root_fs_freebsd-8.1-v01.qcow2 root_fs_freebsd<br />
<br />
# freebsd gui<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-8.1-gui-v01.qcow2.bz2<br />
bunzip2 root_fs_freebsd-8.1-gui-v01.qcow2.bz2<br />
ln -s root_fs_freebsd-8.1-gui-v01.qcow2 root_fs_freebsd-gui<br />
<br />
# winxp and win7<br />
# Sorry! Unfortunately for legal reasons we cannot distribute windows XP<br />
# or Windows 7 root filesystems. See VNX documentation for detailed recipes<br />
# to create these root fylesystems from scratch<br />
<br />
</ul><br />
<br />
=== Additional install steps for Dynamips support ===<br />
<br />
* Install Dynamips and Dynagen:<br />
wget http://downloads.sourceforge.net/project/dyna-gen/dynamips%20Linux%20RPM/0.2.8-RC2/dynamips-0.2.8RC2-1.i386.rpm<br />
rpm -i dynamips-0.2.8RC2-1.i386.rpm<br />
wget http://downloads.sourceforge.net/project/dyna-gen/dynagen%20source%20_%20Linux/dynagen%200.11.0/dynagen-0.11.0-1.fc9.noarch.rpm<br />
rpm -i dynagen-0.11.0-1.fc9.noarch.rpm<br />
<br />
* Set execution permissions for the script and add it to system start-up:<br />
chkconfig --add dynamips<br />
/etc/init.d/dynamips start<br />
<br />
* Download and install cisco IOS image:<br />
cd /usr/share/vnx/filesystems<br />
# Cisco image<br />
wget ... c3640-js-mz.124-19.image<br />
ln -s c3640-js-mz.124-19.image c3640<br />
<br />
* Calculate the idle-pc value for your computer following the procedure in http://dynagen.org/tutorial.htm:<br />
dynagen /usr/share/vnx/examples/R.net<br />
console R # type 'no' to exit the config wizard and wait <br />
# for the router to completely start <br />
idle-pc get R<br />
Once you know the idle-pc value for your system, include it in /etc/vnx.conf file.<br />
<br />
=== Additional install steps for Olive support ===<br />
<br />
Several additional steps are needed to support Olive (Juniper) routers in VNX scenarios:<br />
<br />
<ul><br />
<br />
<li>Download old qemu bios from 0.10.6 version and copy it to /usr/share/qemu directory:</li><br />
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.10.6/qemu-kvm-0.10.6.tar.gz<br />
tar xfvz qemu-kvm-0.10.6.tar.gz<br />
cp qemu-kvm-0.10.6/pc-bios/bios.bin /usr/share/qemu/bios-0.10.6.bin<br />
<br />
</ul><br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<!-- COSAS ANTIGUAS --><br />
<br />
<!--li>Modificar vnumlparser.pl, sustituyendo en la función mode_t la línea en ):</li><br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
<br />
por:<br />
<br />
if (! -e "/dev/net/tun") {<br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
}<br />
<br />
Explicación: el módulo tun se ha integrado en el kernel a partir de la 10.04, por lo que no es necesario cargarlo como hasta ahora mediante "modprobe tun". El cambio anterior simplemente comprueba si existe el dispositivo /dev/net/tun y carga el modulo en caso de que no exista.<br />
--><br />
<br />
<br />
<!--li>Modificar vnumlparser.pl, sustituyendo en la función mode_t la línea en ):</li><br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
<br />
por:<br />
<br />
if (! -e "/dev/net/tun") {<br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
}<br />
<br />
Explicación: el módulo tun se ha integrado en el kernel a partir de la 10.04, por lo que no es necesario cargarlo como hasta ahora mediante "modprobe tun". El cambio anterior simplemente comprueba si existe el dispositivo /dev/net/tun y carga el modulo en caso de que no exista.<br />
--><br />
<br />
<!--<br />
Pasos a seguir para instalar VNX sobre Ubuntu 9.10. <br />
<br />
'''Nota importante''': se han detectado importantes problemas de prestaciones cuando se utiliza el sistema de ficheros ext4 con Ubuntu 9.10. Por ello, y hasta que se localice el origen de dichas ineficiencias, se recomienda utilizar ext3. <br />
<ul><br />
<br />
<li> Instalar Ubuntu 9.10 y actualizar con:</li><br />
apt-get update; apt-get dist-upgrade<br />
--><br />
<!--<br />
<li>Añadir repositorios VNUML a /etc/apt/sources.lst:</li><br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian binary/" >> /etc/apt/sources.list<br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian-testing binary/" >> /etc/apt/sources.list<br />
--><br />
<!--<br />
<li>Install paquetes básicos de desarrollo, paquetes de virtualización (qemu-kvm, libvirt, vnuml) y librerías y paquetes auxiliares</li><br />
apt-get update<br />
apt-get install build-essential qemu-kvm libvirt-bin libvirt-dev \<br />
virt-manager virt-viewer vlan xterm bridge-utils screen uml-utilities \<br />
libxml-checker-perl libxml-parser-perl libnetaddr-ip-perl libnet-pcap-perl \<br />
libnet-ipv6addr-perl liberror-perl libexception-class-perl libxml-libxml-perl \<br />
libxml2-dev libgnutls-dev libdevmapper-dev libterm-readline-perl-perl <br />
<br />
<br />
<br />
curl vnuml linux-um <br />
<br />
<li>Si se usa la versión de Ubuntu de 64 bits hay que instalar las librerías de compatibilidad de 32 bits:</li><br />
apt-get install ia32-libs<br />
<br />
<li>Install qemu-kvm version 0.12.4 (version 0.11 which comes as apackage in 9.10 provokes hanging problems in Windows virtual machines when executing commands -something relates apparently with mounting cdroms in vms-):</li><br />
wget http://sourceforge.net/projects/kvm/files/qemu-kvm/0.11.1/qemu-kvm-0.11.1.tar.gz/download<br />
tar xfvz qemu-kvm-0.11.1.tar.gz<br />
cd qemu-kvm-0.11.1<br />
./configure --prefix=/usr && make && make install<br />
ln -s /usr/bin/qemu-system-x86_64 /usr/bin/kvm<br />
Editar /etc/modules y añadir:<br />
kvm <br />
kvm_intel<br />
<br />
wget http://sourceforge.net/projects/kvm/files/kvm-kmod/2.6.31.6b/kvm-kmod-2.6.31.6b.tar.bz2/download<br />
<br />
<li>Instalar libvirt 0.8.0:</li><br />
/etc/init.d/libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.8.0.tar.gz<br />
tar xfvz libvirt-0.8.0.tar.gz<br />
cd libvirt-0.8.0<br />
./configure --prefix=/usr && make && make install<br />
/etc/init.d/libvirt-bin start<br />
<br />
<li> Instalar la librería perl de acceso a libvirt (Sys::Virt) desde CPAN (dicha librería no esta disponible como paquete para Ubuntu 9.10):</li><br />
--><br />
<!-- wget http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.2.2.tar.gz<br />
tar xfvz Sys-Virt-0.2.2.tar.gz <br />
cd Sys-Virt-0.2.2<br />
perl Makefile.PL<br />
make install<br />
--><br />
<!--<br />
perl -MCPAN -e "CPAN::Shell->force(qw(install Sys::Virt));"<br />
Nota: constestar YES a la pregunta "Would you like me to configure as much as posible automatically?" y a "Is it OK to try to connect to the Internet?" <br />
<br />
<li>Instalar rootfilesystem de VNUML, enlaces del kernel y crear clave rsa:</li><br />
cd /usr/share/vnuml/filesystems<br />
wget http://www.dit.upm.es/vnuml/download/scripts/root-fs-installer<br />
perl root-fs-installer<br />
cd ../kernels<br />
ln -s linux-2.6.28.10-1m linux<br />
ssh-keygen -t rsa1<br />
<br />
<li>Instalar VNX:</li><br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-0.12b.tgz<br />
tar xfvz vnx-0.12b.tgz<br />
cd vnx-0.12b<br />
./install-vnx<br />
</ul><br />
<br />
Notas:<br />
http://www.ubuntu-es.org/node/128867<br />
175 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-headers-2.6.32-02063209_2.6.32-02063209_all.deb<br />
176 http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-image-2.6.32-02063209-generic_2.6.32-02063209_amd64.deb<br />
177 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-image-2.6.32-02063209-generic_2.6.32-02063209_amd64.deb<br />
178 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-headers-2.6.32-02063209-generic_2.6.32-02063209_amd64.deb<br />
--><br />
<br />
<!--<br />
=== Sobre Ubuntu 8.04 ===<br />
<br />
Pasos a seguir para instalar VNX sobre Ubuntu 8.04:<br />
<ul><br />
<br />
<li> Instalar Ubuntu 8.04 y actualizar con:</li><br />
apt-get update; apt-get dist-upgrade<br />
Rearrancar la máquina en caso de que se actualice la versión del kernel.<br />
<br />
<li> Añadir repositorio VNUML a /etc/apt/sources.lst:</li><br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian binary/" >> /etc/apt/sources.list<br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian-testing binary/" >> /etc/apt/sources.list<br />
<br />
<li> Instalar paquetes:</li><br />
apt-get update <br />
apt-get install virt-manager virt-viewer build-essential \<br />
libxml-libxml-perl vncviewer vlan xterm bridge-utils screen \<br />
curl vnuml linux-um libterm-readline-perl-perl zlib-bin zlib1g-dev \<br />
libxen3-dev libxml2-dev libgnutls-dev libsasl2-dev libsdl1.2-dev \<br />
libdevmapper-dev dnsmasq xbase-clients pkg-config<br />
<br />
<li>Si se usa la versión de Ubuntu de 64 bits hay que instalar las librerías de compatibilidad de 32 bits:</li><br />
apt-get install ia32-libs<br />
<br />
<li>Instalar qemu-kvm version 0.11.1 (la version 0.12.2 da errores):</li><br />
wget http://sourceforge.net/projects/kvm/files/qemu-kvm/0.11.1/qemu-kvm-0.11.1.tar.gz/download<br />
tar xfvz qemu-kvm-0.11.1.tar.gz<br />
cd qemu-kvm-0.11.1<br />
./configure --prefix=/usr && make && make install<br />
ln -s /usr/bin/qemu-system-x86_64 /usr/bin/kvm<br />
Editar /etc/modules y añadir:<br />
kvm <br />
kvm_intel<br />
<br />
<li>Instalar libvirt 0.7.6:</li><br />
apt-get install libvirt-bin<br />
/etc/init.d/libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.7.6.tar.gz<br />
tar xfvz libvirt-0.7.6.tar.gz<br />
cd libvirt-0.7.6<br />
./configure --prefix=/usr --without-storage-disk && make && make install<br />
/etc/init.d/libvirt-bin start<br />
<br />
<li>Instalar librería perl de acceso a libvirt (Sys::Virt) mediante CPAN (no está disponible como paquete ubuntu)</li><br />
perl -MCPAN -e "CPAN::Shell->force(qw(install Sys::Virt));"<br />
Note: answer NO to the question "Are you ready for manual configuration?"<br />
<br />
<li>Instalar rootfilesystem de VNUML, enlaces del kernel y crear clave rsa:</li><br />
cd /usr/share/vnuml/filesystems<br />
wget http://www.dit.upm.es/vnuml/download/scripts/root-fs-installer<br />
perl root-fs-installer<br />
cd ../kernels<br />
ln -s linux-2.6.28.10-1m linux<br />
ssh-keygen -t rsa1<br />
<br />
<li>Instalar VNX:</li><br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-0.12b.tgz<br />
tar xfvz vnx-0.12b.tgz<br />
cd vnx-0.12b<br />
./install-vnx<br />
</ul><br />
--></div>Davidhttps://web.dit.upm.es/vnumlwiki/index.php?title=Vnx-install&diff=4111Vnx-install2011-02-24T18:51:15Z<p>David: /* Installation over Ubuntu 10.04/9.10 */</p>
<hr />
<div>{{Title|VNX (Virtual Networks over X virtualization) v0.14 beta}}<br />
<br />
== Installation over Ubuntu 10.04/9.10 ==<br />
<br />
This section describes the procedure for installing VNX over Ubuntu 10.04 or 9.10. Open a root shell window and follow these steps:<br />
<ul><br />
<br />
<li>Install all packages required (basic development, virtualization, perl libraries and auxiliar packages):</li><br />
apt-get update<br />
apt-get install build-essential qemu-kvm libvirt-bin vlan xterm \<br />
bridge-utils screen virt-manager virt-viewer libxml-checker-perl \<br />
libxml-parser-perl libnetaddr-ip-perl libnet-pcap-perl \<br />
libnet-ipv6addr-perl liberror-perl libexception-class-perl \<br />
uml-utilities libxml-libxml-perl libxml2-dev libgnutls-dev \<br />
libdevmapper-dev libterm-readline-perl-perl libnet-telnet-perl \<br />
libnet-ip-perl libreadonly-perl libmath-round-perl libappconfig-perl \<br />
libdbi-perl graphviz libnl-dev genisoimage gnome-terminal<br />
<br />
<!--Note: for Ubuntu 9.04 change "qemu-kvm" package by "qemu kvm" --><br />
<li>If you use 64 bits version of Ubuntu, install 32 bits compatibility libraries:</li><br />
apt-get install ia32-libs<br />
<br />
<li>Install libvirt 0.8.5:</li><br />
/etc/init.d/libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.8.5.tar.gz<br />
tar xfvz libvirt-0.8.5.tar.gz<br />
cd libvirt-0.8.5<br />
./configure --without-xen --prefix=/usr && make && make install<br />
/etc/init.d/libvirt-bin start<br />
<br />
'''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.<br />
<br />
<li>Install Sys::Virt perl module:</li><br />
<ul><br />
<li>For Ubuntu 10.04, just install the libsys-virt-perl package</li><br />
apt-get install libsys-virt-perl<br />
<!--<br />
'''IMPORTANT NOTE''': Windows XP virtual machines started with VNX over Ubuntu 9.10 frequently hang when executing commands or with high traffic loads. The problem could be related with virtual network drivers. We are investigating the problem to find a solution. By now, Ubuntu 10.04 is the recomended platform to test VNX.<br />
--><br />
<li>For Ubuntu 9.10, as Sys::Virt library is not available as a package, install it manually:</li><br />
wget http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.2.3.tar.gz<br />
tar xfvz Sys-Virt-0.2.3.tar.gz <br />
cd Sys-Virt-0.2.3<br />
perl Makefile.PL<br />
make install<br />
</ul><br />
<br />
<li>Install VNX:</li><br />
mkdir /tmp/vnx-update<br />
cd /tmp/vnx-update<br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-latest.tgz<br />
tar xfvz vnx-latest.tgz<br />
cd vnx-*<br />
./install_vnx<br />
<br />
<li>Create the VNX config file (/etc/vnx.conf). You just can move the sample config file:</li><br />
mv /etc/vnx.conf.samble /etc/vnx.conf<br />
<br />
<li>Download root file systems from http://idefix.dit.upm.es/download/vnx/filesystems and copy them to /usr/share/vnx/filesystems directory:</li><br />
cd /usr/share/vnx/filesystems<br />
<br />
# ubuntu server<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.10-v01.qcow2.bz2<br />
bunzip2 root_fs_ubuntu-10.10-v01.qcow2.bz2<br />
ln -s root_fs_ubuntu-10.10-v01.qcow2 root_fs_ubuntu<br />
<br />
# ubuntu with gui<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.10-gui-v01.qcow2.bz2<br />
bunzip2 root_fs_ubuntu-10.10-gui-v01.qcow2.bz2<br />
ln -s root_fs_ubuntu-10.10-gui-v01.qcow2 root_fs_ubuntu-gui<br />
<br />
# freebsd server<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-8.1-v01.qcow2.bz2<br />
bunzip2 root_fs_freebsd-8.1-v01.qcow2.bz2<br />
ln -s root_fs_freebsd-8.1-v01.qcow2 root_fs_freebsd<br />
<br />
# freebsd gui<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-8.1-gui-v01.qcow2.bz2<br />
bunzip2 root_fs_freebsd-8.1-gui-v01.qcow2.bz2<br />
ln -s root_fs_freebsd-8.1-gui-v01.qcow2 root_fs_freebsd-gui<br />
<br />
# winxp and win7<br />
# Sorry! Unfortunately for legal reasons we cannot distribute windows XP<br />
# or Windows 7 root filesystems. See VNX documentation for detailed recipes<br />
# to create these root fylesystems from scratch<br />
<br />
<li>Additionally, if you plan to use VNUML root filesystem:</li><br />
# VNUML root_fs_tutorial and kernel<br />
cd /usr/share/vnx/filesystems<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_tutorial-0.6.0.bz2<br />
bunzip2 root_fs_tutorial-0.6.0.bz2<br />
ln -s root_fs_tutorial-0.6.0 root_fs_tutorial<br />
cd /usr/share/vnx/kernels<br />
wget -N http://jungla.dit.upm.es/~vnx/download/kernels/linux-2.6.18.1-bb2-xt-4m<br />
chmod +x linux-2.6.18.1-bb2-xt-4m<br />
ln -s linux-2.6.18.1-bb2-xt-4m linux<br />
<br />
</ul><br />
<br />
'''NOTE for Ubuntu 10.04.1''': It seems that an additional package has to be installed:<br />
apt-get install kvm-pxe<br />
<br />
=== Additional install steps for Dynamips support ===<br />
<br />
* Install Dynamips and Dynagen:<br />
apt-get install dynamips dynagen<br />
<br />
* Create a file /etc/init.d/dynamips (taken from http://7200emu.hacki.at/viewtopic.php?t=2198):<br />
<pre><br />
#!/bin/sh<br />
# Start/stop the dynamips program as a daemon.<br />
#<br />
### BEGIN INIT INFO<br />
# Provides: dynamips<br />
# Default-Start: 2 3 4 5<br />
# Default-Stop: 0 1 6<br />
# Short-Description: Cisco hardware emulator daemon<br />
### END INIT INFO<br />
<br />
DAEMON=/usr/bin/dynamips<br />
NAME=dynamips<br />
PORT=7200<br />
PIDFILE=/var/run/$NAME.pid <br />
LOGFILE=/var/log/$NAME.log<br />
DESC="Cisco Emulator"<br />
SCRIPTNAME=/etc/init.d/$NAME<br />
<br />
test -f $DAEMON || exit 0<br />
<br />
. /lib/lsb/init-functions<br />
<br />
<br />
case "$1" in<br />
start) log_daemon_msg "Starting $DESC " "$NAME"<br />
start-stop-daemon --start --chdir /tmp --background --make-pidfile --pidfile $PIDFILE --name $NAME --startas $DAEMON -- -H $PORT -l $LOGFILE<br />
log_end_msg $?<br />
;;<br />
stop) log_daemon_msg "Stopping $DESC " "$NAME"<br />
start-stop-daemon --stop --quiet --pidfile $PIDFILE --name $NAME<br />
log_end_msg $?<br />
;;<br />
restart) log_daemon_msg "Restarting $DESC " "$NAME"<br />
start-stop-daemon --stop --retry 5 --quiet --pidfile $PIDFILE --name $NAME<br />
start-stop-daemon --start --chdir /tmp --background --make-pidfile --pidfile $PIDFILE --name $NAME --startas $DAEMON -- -H $PORT -l $LOGFILE<br />
log_end_msg $?<br />
;;<br />
status)<br />
status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $? <br />
#status $NAME<br />
#RETVAL=$?<br />
;; <br />
*) log_action_msg "Usage: $SCRIPTNAME {start|stop|restart|status}"<br />
exit 2<br />
;;<br />
esac<br />
exit 0<br />
<br />
</pre><br />
<br />
* Set execution permissions for the script and add it to system start-up:<br />
chmod +x /etc/init.d/dynamips<br />
update-rc.d dynamips defaults<br />
/etc/init.d/dynamips start<br />
<br />
* Download and install cisco IOS image:<br />
cd /usr/share/vnx/filesystems<br />
# Cisco image<br />
wget ... c3640-js-mz.124-19.image<br />
ln -s c3640-js-mz.124-19.image c3640<br />
<br />
* Calculate the idle-pc value for your computer following the procedure in http://dynagen.org/tutorial.htm:<br />
dynagen /usr/share/vnx/examples/R.net<br />
console R # type 'no' to exit the config wizard and wait <br />
# for the router to completely start <br />
idle-pc get R<br />
Once you know the idle-pc value for your system, include it in /etc/vnx.conf file.<br />
<br />
=== Additional install steps for Olive support ===<br />
<br />
Several additional steps are needed to support Olive (Juniper) routers in VNX scenarios:<br />
<br />
<ul><br />
<br />
<!-- Ya no hace falta desde que se usa <qemu:commandline><br />
<br />
<li>Install a patched version of libvirt 0.8.5 with support to define the bios used by a virtual machine:</li><br />
<br />
<ul><br />
<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><br />
<pre><br />
diff -crB libvirt-0.8.5.orig/src/conf/domain_conf.c libvirt-0.8.5/src/conf/domain_conf.c<br />
*** libvirt-0.8.5.orig/src/conf/domain_conf.c 2010-11-22 11:38:08.000000000 +0100<br />
--- libvirt-0.8.5/src/conf/domain_conf.c 2010-11-22 11:47:41.000000000 +0100<br />
***************<br />
*** 4267,4272 ****<br />
--- 4267,4274 ----<br />
if (node)<br />
def->mem.hugepage_backed = 1;<br />
<br />
+ def->biosfile = virXPathString("string(./biosfile[1])", ctxt);<br />
+ <br />
/* Extract other memory tunables */<br />
if (virXPathULong("string(./memtune/hard_limit)", ctxt,<br />
&def->mem.hard_limit) < 0)<br />
diff -crB libvirt-0.8.5.orig/src/conf/domain_conf.h libvirt-0.8.5/src/conf/domain_conf.h<br />
*** libvirt-0.8.5.orig/src/conf/domain_conf.h 2010-11-22 11:38:08.000000000 +0100<br />
--- libvirt-0.8.5/src/conf/domain_conf.h 2010-11-22 11:40:18.000000000 +0100<br />
***************<br />
*** 885,890 ****<br />
--- 885,891 ----<br />
unsigned long min_guarantee;<br />
unsigned long swap_hard_limit;<br />
} mem;<br />
+ char *biosfile;<br />
unsigned short vcpus;<br />
unsigned short maxvcpus;<br />
int cpumasklen;<br />
diff -crB libvirt-0.8.5.orig/src/qemu/qemu_conf.c libvirt-0.8.5/src/qemu/qemu_conf.c<br />
*** libvirt-0.8.5.orig/src/qemu/qemu_conf.c 2010-11-22 11:38:08.000000000 +0100<br />
--- libvirt-0.8.5/src/qemu/qemu_conf.c 2010-11-22 11:41:05.000000000 +0100<br />
***************<br />
*** 3984,3989 ****<br />
--- 3984,3995 ----<br />
ADD_ARG_LIT(emulator);<br />
ADD_ARG_LIT("-S");<br />
<br />
+ if(def->biosfile)<br />
+ {<br />
+ ADD_ARG_LIT("-bios");<br />
+ ADD_ARG_LIT(def->biosfile);<br />
+ }<br />
+ <br />
/* This should *never* be NULL, since we always provide<br />
* a machine in the capabilities data for QEMU. So this<br />
* check is just here as a safety in case the unexpected<br />
</pre><br />
<br />
<li>Install libvirt 0.8.5 with that patch applied:</li><br />
service libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.8.5.tar.gz<br />
tar xfvz libvirt-0.8.5.tar.gz <br />
cd libvirt-0.8.5<br />
patch -p1 -i ../libvirt-0.8.5-biosfile.patch <br />
./configure --without-xen --prefix=/usr && make && make install<br />
service libvirt-bin start<br />
<br />
</ul><br />
--><br />
<li>Download old qemu bios from 0.10.6 version and copy it to /usr/share/qemu directory:</li><br />
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.10.6/qemu-kvm-0.10.6.tar.gz<br />
tar xfvz qemu-kvm-0.10.6.tar.gz<br />
cp qemu-kvm-0.10.6/pc-bios/bios.bin /usr/share/qemu-kvm/bios-0.10.6.bin<br />
<br />
<!-- Not needed, it seems to work without downloading this drivers<br />
<li>Download i82559 ROM from the latest qemu versions (Ubuntu 10.04 does not include that ROM in qemu-kvm package):</li><br />
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.12.5/qemu-kvm-0.12.5.tar.gz<br />
tar xfvz qemu-kvm-0.12.5.tar.gz<br />
cp qemu-kvm-0.12.5/pc-bios/pxe-i82559er.bin /usr/share/qemu-kvm/<br />
--><br />
</ul><br />
<br />
== Installation over Fedora 11 (Draft) ==<br />
<br />
Follow this steps to install VNX over Fedora 11:<br />
<ul><br />
<br />
<li>Install packages:</li><br />
yum -y groupinstall "Development Tools"<br />
yum install qemu-kvm libvirt virt-manager virt-viewer perl-XML-LibXML<br />
yum install perl-XML-DOM perl-NetAddr-IP perl-Readonly perl-TermReadKey<br />
yum install perl-Net-Pcap perl-Net-IPv6Addr perl-Net-Telnet perl-Error<br />
yum install perl-Exception-Class perl-ExtUtils-MakeMaker tunctl screen wget<br />
yum install libxml2-devel gnutls-devel device-mapper-devel uml_utilities <br />
yum install roxterm xterm graphviz perl-AppConfig<br />
<br />
<li>Install libvirt 0.8.5:</li><br />
/etc/init.d/libvirtd stop<br />
wget http://libvirt.org/sources/libvirt-0.8.5.tar.gz<br />
tar xfvz libvirt-0.8.5.tar.gz<br />
cd libvirt-0.8.5<br />
./configure --without-xen --prefix=/usr && make && make install<br />
/etc/init.d/libvirtd start<br />
<br />
<li>Install SysVirt manually:</li><br />
wget http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.2.4.tar.gz<br />
tar xfvz Sys-Virt-0.2.4.tar.gz<br />
cd Sys-Virt-0.2.4<br />
perl Makefile.PL<br />
make install<br />
<!--<br />
<li> Instalar VNUML sobre Fedora 11 siguiendo la receta en http://www.dit.upm.es/vnumlwiki/index.php/Fedora11</li><br />
<br />
<li> Instalar paquetes y librerías necesarias:</li><br />
yum install qemu-kvm libvirt virt-manager virt-viewer perl-XML-LibXML perl-Sys-Virt<br />
yum -y install bridge-utils readline-devel perl-Module-Build screen expat-devel libpcap-devel <br />
yum -y install perl-Net-Pcap perl-NetAddr-IP perl-Net-IPv6Addr perl-XML-DOM perl-Exception-Class<br />
yum -y install perl-TermReadKey perl-Error perl-CPAN uml_utilities xterm tunctl<br />
<br />
<li>Install XML::Checker perl library:</li><br />
perl -MCPAN -e shell<br />
install XML::Checker<br />
--><br />
<li>Add symbolic link for kvm:</li><br />
ln -s /usr/bin/qemu-kvm /usr/bin/kvm<br />
<br />
<li>Instalar VNX:</li><br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-latest.tgz<br />
tar xfvz vnx-latest.tgz<br />
cd vnx-*<br />
./install-vnx<br />
<br />
<li>Create the VNX config file (/etc/vnx.conf). You just can move the sample config file:</li><br />
mv /etc/vnx.conf.samble /etc/vnx.conf<br />
<br />
<li>Deshabilitar el firewall o, alternativamente, configurar los interfaces tipo "tun" como confiables (Sistema->Firewall->Interfaces Confiables").</li><br />
</ul><br />
<br />
=== Additional install steps for Dynamips support ===<br />
<br />
* Install Dynamips and Dynagen:<br />
wget http://downloads.sourceforge.net/project/dyna-gen/dynamips%20Linux%20RPM/0.2.8-RC2/dynamips-0.2.8RC2-1.i386.rpm<br />
rpm -i dynamips-0.2.8RC2-1.i386.rpm<br />
wget http://downloads.sourceforge.net/project/dyna-gen/dynagen%20source%20_%20Linux/dynagen%200.11.0/dynagen-0.11.0-1.fc9.noarch.rpm<br />
rpm -i dynagen-0.11.0-1.fc9.noarch.rpm<br />
<br />
* Set execution permissions for the script and add it to system start-up:<br />
chkconfig --add dynamips<br />
/etc/init.d/dynamips start<br />
<br />
* Download and install cisco IOS image:<br />
cd /usr/share/vnx/filesystems<br />
# Cisco image<br />
wget ... c3640-js-mz.124-19.image<br />
ln -s c3640-js-mz.124-19.image c3640<br />
<br />
* Calculate the idle-pc value for your computer following the procedure in http://dynagen.org/tutorial.htm:<br />
dynagen /usr/share/vnx/examples/R.net<br />
console R # type 'no' to exit the config wizard and wait <br />
# for the router to completely start <br />
idle-pc get R<br />
Once you know the idle-pc value for your system, include it in /etc/vnx.conf file.<br />
<br />
=== Additional install steps for Olive support ===<br />
<br />
Several additional steps are needed to support Olive (Juniper) routers in VNX scenarios:<br />
<br />
<ul><br />
<br />
<li>Download old qemu bios from 0.10.6 version and copy it to /usr/share/qemu directory:</li><br />
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.10.6/qemu-kvm-0.10.6.tar.gz<br />
tar xfvz qemu-kvm-0.10.6.tar.gz<br />
cp qemu-kvm-0.10.6/pc-bios/bios.bin /usr/share/qemu/bios-0.10.6.bin<br />
<br />
</ul><br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<!-- COSAS ANTIGUAS --><br />
<br />
<!--li>Modificar vnumlparser.pl, sustituyendo en la función mode_t la línea en ):</li><br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
<br />
por:<br />
<br />
if (! -e "/dev/net/tun") {<br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
}<br />
<br />
Explicación: el módulo tun se ha integrado en el kernel a partir de la 10.04, por lo que no es necesario cargarlo como hasta ahora mediante "modprobe tun". El cambio anterior simplemente comprueba si existe el dispositivo /dev/net/tun y carga el modulo en caso de que no exista.<br />
--><br />
<br />
<br />
<!--li>Modificar vnumlparser.pl, sustituyendo en la función mode_t la línea en ):</li><br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
<br />
por:<br />
<br />
if (! -e "/dev/net/tun") {<br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
}<br />
<br />
Explicación: el módulo tun se ha integrado en el kernel a partir de la 10.04, por lo que no es necesario cargarlo como hasta ahora mediante "modprobe tun". El cambio anterior simplemente comprueba si existe el dispositivo /dev/net/tun y carga el modulo en caso de que no exista.<br />
--><br />
<br />
<!--<br />
Pasos a seguir para instalar VNX sobre Ubuntu 9.10. <br />
<br />
'''Nota importante''': se han detectado importantes problemas de prestaciones cuando se utiliza el sistema de ficheros ext4 con Ubuntu 9.10. Por ello, y hasta que se localice el origen de dichas ineficiencias, se recomienda utilizar ext3. <br />
<ul><br />
<br />
<li> Instalar Ubuntu 9.10 y actualizar con:</li><br />
apt-get update; apt-get dist-upgrade<br />
--><br />
<!--<br />
<li>Añadir repositorios VNUML a /etc/apt/sources.lst:</li><br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian binary/" >> /etc/apt/sources.list<br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian-testing binary/" >> /etc/apt/sources.list<br />
--><br />
<!--<br />
<li>Install paquetes básicos de desarrollo, paquetes de virtualización (qemu-kvm, libvirt, vnuml) y librerías y paquetes auxiliares</li><br />
apt-get update<br />
apt-get install build-essential qemu-kvm libvirt-bin libvirt-dev \<br />
virt-manager virt-viewer vlan xterm bridge-utils screen uml-utilities \<br />
libxml-checker-perl libxml-parser-perl libnetaddr-ip-perl libnet-pcap-perl \<br />
libnet-ipv6addr-perl liberror-perl libexception-class-perl libxml-libxml-perl \<br />
libxml2-dev libgnutls-dev libdevmapper-dev libterm-readline-perl-perl <br />
<br />
<br />
<br />
curl vnuml linux-um <br />
<br />
<li>Si se usa la versión de Ubuntu de 64 bits hay que instalar las librerías de compatibilidad de 32 bits:</li><br />
apt-get install ia32-libs<br />
<br />
<li>Install qemu-kvm version 0.12.4 (version 0.11 which comes as apackage in 9.10 provokes hanging problems in Windows virtual machines when executing commands -something relates apparently with mounting cdroms in vms-):</li><br />
wget http://sourceforge.net/projects/kvm/files/qemu-kvm/0.11.1/qemu-kvm-0.11.1.tar.gz/download<br />
tar xfvz qemu-kvm-0.11.1.tar.gz<br />
cd qemu-kvm-0.11.1<br />
./configure --prefix=/usr && make && make install<br />
ln -s /usr/bin/qemu-system-x86_64 /usr/bin/kvm<br />
Editar /etc/modules y añadir:<br />
kvm <br />
kvm_intel<br />
<br />
wget http://sourceforge.net/projects/kvm/files/kvm-kmod/2.6.31.6b/kvm-kmod-2.6.31.6b.tar.bz2/download<br />
<br />
<li>Instalar libvirt 0.8.0:</li><br />
/etc/init.d/libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.8.0.tar.gz<br />
tar xfvz libvirt-0.8.0.tar.gz<br />
cd libvirt-0.8.0<br />
./configure --prefix=/usr && make && make install<br />
/etc/init.d/libvirt-bin start<br />
<br />
<li> Instalar la librería perl de acceso a libvirt (Sys::Virt) desde CPAN (dicha librería no esta disponible como paquete para Ubuntu 9.10):</li><br />
--><br />
<!-- wget http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.2.2.tar.gz<br />
tar xfvz Sys-Virt-0.2.2.tar.gz <br />
cd Sys-Virt-0.2.2<br />
perl Makefile.PL<br />
make install<br />
--><br />
<!--<br />
perl -MCPAN -e "CPAN::Shell->force(qw(install Sys::Virt));"<br />
Nota: constestar YES a la pregunta "Would you like me to configure as much as posible automatically?" y a "Is it OK to try to connect to the Internet?" <br />
<br />
<li>Instalar rootfilesystem de VNUML, enlaces del kernel y crear clave rsa:</li><br />
cd /usr/share/vnuml/filesystems<br />
wget http://www.dit.upm.es/vnuml/download/scripts/root-fs-installer<br />
perl root-fs-installer<br />
cd ../kernels<br />
ln -s linux-2.6.28.10-1m linux<br />
ssh-keygen -t rsa1<br />
<br />
<li>Instalar VNX:</li><br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-0.12b.tgz<br />
tar xfvz vnx-0.12b.tgz<br />
cd vnx-0.12b<br />
./install-vnx<br />
</ul><br />
<br />
Notas:<br />
http://www.ubuntu-es.org/node/128867<br />
175 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-headers-2.6.32-02063209_2.6.32-02063209_all.deb<br />
176 http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-image-2.6.32-02063209-generic_2.6.32-02063209_amd64.deb<br />
177 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-image-2.6.32-02063209-generic_2.6.32-02063209_amd64.deb<br />
178 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-headers-2.6.32-02063209-generic_2.6.32-02063209_amd64.deb<br />
--><br />
<br />
<!--<br />
=== Sobre Ubuntu 8.04 ===<br />
<br />
Pasos a seguir para instalar VNX sobre Ubuntu 8.04:<br />
<ul><br />
<br />
<li> Instalar Ubuntu 8.04 y actualizar con:</li><br />
apt-get update; apt-get dist-upgrade<br />
Rearrancar la máquina en caso de que se actualice la versión del kernel.<br />
<br />
<li> Añadir repositorio VNUML a /etc/apt/sources.lst:</li><br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian binary/" >> /etc/apt/sources.list<br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian-testing binary/" >> /etc/apt/sources.list<br />
<br />
<li> Instalar paquetes:</li><br />
apt-get update <br />
apt-get install virt-manager virt-viewer build-essential \<br />
libxml-libxml-perl vncviewer vlan xterm bridge-utils screen \<br />
curl vnuml linux-um libterm-readline-perl-perl zlib-bin zlib1g-dev \<br />
libxen3-dev libxml2-dev libgnutls-dev libsasl2-dev libsdl1.2-dev \<br />
libdevmapper-dev dnsmasq xbase-clients pkg-config<br />
<br />
<li>Si se usa la versión de Ubuntu de 64 bits hay que instalar las librerías de compatibilidad de 32 bits:</li><br />
apt-get install ia32-libs<br />
<br />
<li>Instalar qemu-kvm version 0.11.1 (la version 0.12.2 da errores):</li><br />
wget http://sourceforge.net/projects/kvm/files/qemu-kvm/0.11.1/qemu-kvm-0.11.1.tar.gz/download<br />
tar xfvz qemu-kvm-0.11.1.tar.gz<br />
cd qemu-kvm-0.11.1<br />
./configure --prefix=/usr && make && make install<br />
ln -s /usr/bin/qemu-system-x86_64 /usr/bin/kvm<br />
Editar /etc/modules y añadir:<br />
kvm <br />
kvm_intel<br />
<br />
<li>Instalar libvirt 0.7.6:</li><br />
apt-get install libvirt-bin<br />
/etc/init.d/libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.7.6.tar.gz<br />
tar xfvz libvirt-0.7.6.tar.gz<br />
cd libvirt-0.7.6<br />
./configure --prefix=/usr --without-storage-disk && make && make install<br />
/etc/init.d/libvirt-bin start<br />
<br />
<li>Instalar librería perl de acceso a libvirt (Sys::Virt) mediante CPAN (no está disponible como paquete ubuntu)</li><br />
perl -MCPAN -e "CPAN::Shell->force(qw(install Sys::Virt));"<br />
Note: answer NO to the question "Are you ready for manual configuration?"<br />
<br />
<li>Instalar rootfilesystem de VNUML, enlaces del kernel y crear clave rsa:</li><br />
cd /usr/share/vnuml/filesystems<br />
wget http://www.dit.upm.es/vnuml/download/scripts/root-fs-installer<br />
perl root-fs-installer<br />
cd ../kernels<br />
ln -s linux-2.6.28.10-1m linux<br />
ssh-keygen -t rsa1<br />
<br />
<li>Instalar VNX:</li><br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-0.12b.tgz<br />
tar xfvz vnx-0.12b.tgz<br />
cd vnx-0.12b<br />
./install-vnx<br />
</ul><br />
--></div>Davidhttps://web.dit.upm.es/vnumlwiki/index.php?title=Vnx-install&diff=4110Vnx-install2011-02-24T14:07:02Z<p>David: </p>
<hr />
<div>{{Title|VNX (Virtual Networks over X virtualization) v0.14 beta}}<br />
<br />
== Installation over Ubuntu 10.04/9.10 ==<br />
<br />
This section describes the procedure for installing VNX over Ubuntu 10.04 or 9.10. Open a root shell window and follow these steps:<br />
<ul><br />
<br />
<li>Install all packages required (basic development, virtualization, perl libraries and auxiliar packages):</li><br />
apt-get update<br />
apt-get install build-essential qemu-kvm libvirt-bin vlan xterm \<br />
bridge-utils screen virt-manager virt-viewer libxml-checker-perl \<br />
libxml-parser-perl libnetaddr-ip-perl libnet-pcap-perl \<br />
libnet-ipv6addr-perl liberror-perl libexception-class-perl \<br />
uml-utilities libxml-libxml-perl libxml2-dev libgnutls-dev \<br />
libdevmapper-dev libterm-readline-perl-perl libnet-telnet-perl \<br />
libnet-ip-perl libreadonly-perl libmath-round-perl libappconfig-perl \<br />
libdbi-perl graphviz libnl-dev genisoimage gnome-terminal<br />
<br />
<!--Note: for Ubuntu 9.04 change "qemu-kvm" package by "qemu kvm" --><br />
<li>If you use 64 bits version of Ubuntu, install 32 bits compatibility libraries:</li><br />
apt-get install ia32-libs<br />
<br />
<li>Install libvirt 0.8.5:</li><br />
/etc/init.d/libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.8.5.tar.gz<br />
tar xfvz libvirt-0.8.5.tar.gz<br />
cd libvirt-0.8.5<br />
./configure --without-xen --prefix=/usr && make && make install<br />
/etc/init.d/libvirt-bin start<br />
<br />
'''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.<br />
<br />
<li>Install Sys::Virt perl module:</li><br />
<ul><br />
<li>For Ubuntu 10.04, just install the libsys-virt-perl package</li><br />
apt-get install libsys-virt-perl<br />
<!--<br />
'''IMPORTANT NOTE''': Windows XP virtual machines started with VNX over Ubuntu 9.10 frequently hang when executing commands or with high traffic loads. The problem could be related with virtual network drivers. We are investigating the problem to find a solution. By now, Ubuntu 10.04 is the recomended platform to test VNX.<br />
--><br />
<li>For Ubuntu 9.10, as Sys::Virt library is not available as a package, install it manually:</li><br />
wget http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.2.3.tar.gz<br />
tar xfvz Sys-Virt-0.2.3.tar.gz <br />
cd Sys-Virt-0.2.3<br />
perl Makefile.PL<br />
make install<br />
</ul><br />
<br />
<li>Install VNX:</li><br />
mkdir /tmp/vnx-update<br />
cd /tmp/vnx-update<br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-latest.tgz<br />
tar xfvz vnx-latest.tgz<br />
cd vnx-*<br />
./install_vnx<br />
<br />
<li>Create the VNX config file (/etc/vnx.conf). You just can move the sample config file:</li><br />
mv /etc/vnx.conf.samble /etc/vnx.conf<br />
<br />
<li>Download root file systems from http://idefix.dit.upm.es/download/vnx/filesystems and copy them to /usr/share/vnx/filesystems directory:</li><br />
cd /usr/share/vnx/filesystems<br />
<br />
# ubuntu server<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.10-v01.qcow2.bz2<br />
bunzip2 root_fs_ubuntu-10.10-v01.qcow2.bz2<br />
ln -s root_fs_ubuntu-10.10-v01.qcow2 root_fs_ubuntu<br />
<br />
# ubuntu with gui<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.04-gui-v01.qcow2.bz2<br />
bunzip2 root_fs_ubuntu-10.04-gui-v01.qcow2.bz2<br />
ln -s root_fs_ubuntu-10.04-gui-v01.qcow2 root_fs_ubuntu-gui<br />
<br />
# freebsd server<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-v01.qcow2.bz2<br />
bunzip2 root_fs_freebsd-v01.qcow2.bz2<br />
ln -s root_fs_freebsd-v01.qcow2 root_fs_freebsd<br />
<br />
# freebsd gui<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-gui-v01.qcow2.bz2<br />
bunzip2 root_fs_freebsd-gui-v01.qcow2.bz2<br />
ln -s root_fs_freebsd-gui-v01.qcow2 root_fs_freebsd-gui<br />
<br />
# winxp and win7<br />
# Sorry! Unfortunately for legal reasons we cannot distribute windows XP<br />
# or Windows 7 root filesystems. See VNX documentation for detailed recipes<br />
# to create these root fylesystems from scratch<br />
<br />
<li>Additionally, if you plan to use VNUML root filesystem:</li><br />
# VNUML root_fs_tutorial and kernel<br />
cd /usr/share/vnx/filesystems<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_tutorial-0.6.0.bz2<br />
bunzip2 root_fs_tutorial-0.6.0.bz2<br />
ln -s root_fs_tutorial-0.6.0 root_fs_tutorial<br />
cd /usr/share/vnx/kernels<br />
wget -N http://jungla.dit.upm.es/~vnx/download/kernels/linux-2.6.18.1-bb2-xt-4m<br />
chmod +x linux-2.6.18.1-bb2-xt-4m<br />
ln -s linux-2.6.18.1-bb2-xt-4m linux<br />
<br />
</ul><br />
<br />
'''NOTE for Ubuntu 10.04.1''': It seems that an additional package has to be installed:<br />
apt-get install kvm-pxe<br />
<br />
=== Additional install steps for Dynamips support ===<br />
<br />
* Install Dynamips and Dynagen:<br />
apt-get install dynamips dynagen<br />
<br />
* Create a file /etc/init.d/dynamips (taken from http://7200emu.hacki.at/viewtopic.php?t=2198):<br />
<pre><br />
#!/bin/sh<br />
# Start/stop the dynamips program as a daemon.<br />
#<br />
### BEGIN INIT INFO<br />
# Provides: dynamips<br />
# Default-Start: 2 3 4 5<br />
# Default-Stop: 0 1 6<br />
# Short-Description: Cisco hardware emulator daemon<br />
### END INIT INFO<br />
<br />
DAEMON=/usr/bin/dynamips<br />
NAME=dynamips<br />
PORT=7200<br />
PIDFILE=/var/run/$NAME.pid <br />
LOGFILE=/var/log/$NAME.log<br />
DESC="Cisco Emulator"<br />
SCRIPTNAME=/etc/init.d/$NAME<br />
<br />
test -f $DAEMON || exit 0<br />
<br />
. /lib/lsb/init-functions<br />
<br />
<br />
case "$1" in<br />
start) log_daemon_msg "Starting $DESC " "$NAME"<br />
start-stop-daemon --start --chdir /tmp --background --make-pidfile --pidfile $PIDFILE --name $NAME --startas $DAEMON -- -H $PORT -l $LOGFILE<br />
log_end_msg $?<br />
;;<br />
stop) log_daemon_msg "Stopping $DESC " "$NAME"<br />
start-stop-daemon --stop --quiet --pidfile $PIDFILE --name $NAME<br />
log_end_msg $?<br />
;;<br />
restart) log_daemon_msg "Restarting $DESC " "$NAME"<br />
start-stop-daemon --stop --retry 5 --quiet --pidfile $PIDFILE --name $NAME<br />
start-stop-daemon --start --chdir /tmp --background --make-pidfile --pidfile $PIDFILE --name $NAME --startas $DAEMON -- -H $PORT -l $LOGFILE<br />
log_end_msg $?<br />
;;<br />
status)<br />
status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $? <br />
#status $NAME<br />
#RETVAL=$?<br />
;; <br />
*) log_action_msg "Usage: $SCRIPTNAME {start|stop|restart|status}"<br />
exit 2<br />
;;<br />
esac<br />
exit 0<br />
<br />
</pre><br />
<br />
* Set execution permissions for the script and add it to system start-up:<br />
chmod +x /etc/init.d/dynamips<br />
update-rc.d dynamips defaults<br />
/etc/init.d/dynamips start<br />
<br />
* Download and install cisco IOS image:<br />
cd /usr/share/vnx/filesystems<br />
# Cisco image<br />
wget ... c3640-js-mz.124-19.image<br />
ln -s c3640-js-mz.124-19.image c3640<br />
<br />
* Calculate the idle-pc value for your computer following the procedure in http://dynagen.org/tutorial.htm:<br />
dynagen /usr/share/vnx/examples/R.net<br />
console R # type 'no' to exit the config wizard and wait <br />
# for the router to completely start <br />
idle-pc get R<br />
Once you know the idle-pc value for your system, include it in /etc/vnx.conf file.<br />
<br />
=== Additional install steps for Olive support ===<br />
<br />
Several additional steps are needed to support Olive (Juniper) routers in VNX scenarios:<br />
<br />
<ul><br />
<br />
<!-- Ya no hace falta desde que se usa <qemu:commandline><br />
<br />
<li>Install a patched version of libvirt 0.8.5 with support to define the bios used by a virtual machine:</li><br />
<br />
<ul><br />
<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><br />
<pre><br />
diff -crB libvirt-0.8.5.orig/src/conf/domain_conf.c libvirt-0.8.5/src/conf/domain_conf.c<br />
*** libvirt-0.8.5.orig/src/conf/domain_conf.c 2010-11-22 11:38:08.000000000 +0100<br />
--- libvirt-0.8.5/src/conf/domain_conf.c 2010-11-22 11:47:41.000000000 +0100<br />
***************<br />
*** 4267,4272 ****<br />
--- 4267,4274 ----<br />
if (node)<br />
def->mem.hugepage_backed = 1;<br />
<br />
+ def->biosfile = virXPathString("string(./biosfile[1])", ctxt);<br />
+ <br />
/* Extract other memory tunables */<br />
if (virXPathULong("string(./memtune/hard_limit)", ctxt,<br />
&def->mem.hard_limit) < 0)<br />
diff -crB libvirt-0.8.5.orig/src/conf/domain_conf.h libvirt-0.8.5/src/conf/domain_conf.h<br />
*** libvirt-0.8.5.orig/src/conf/domain_conf.h 2010-11-22 11:38:08.000000000 +0100<br />
--- libvirt-0.8.5/src/conf/domain_conf.h 2010-11-22 11:40:18.000000000 +0100<br />
***************<br />
*** 885,890 ****<br />
--- 885,891 ----<br />
unsigned long min_guarantee;<br />
unsigned long swap_hard_limit;<br />
} mem;<br />
+ char *biosfile;<br />
unsigned short vcpus;<br />
unsigned short maxvcpus;<br />
int cpumasklen;<br />
diff -crB libvirt-0.8.5.orig/src/qemu/qemu_conf.c libvirt-0.8.5/src/qemu/qemu_conf.c<br />
*** libvirt-0.8.5.orig/src/qemu/qemu_conf.c 2010-11-22 11:38:08.000000000 +0100<br />
--- libvirt-0.8.5/src/qemu/qemu_conf.c 2010-11-22 11:41:05.000000000 +0100<br />
***************<br />
*** 3984,3989 ****<br />
--- 3984,3995 ----<br />
ADD_ARG_LIT(emulator);<br />
ADD_ARG_LIT("-S");<br />
<br />
+ if(def->biosfile)<br />
+ {<br />
+ ADD_ARG_LIT("-bios");<br />
+ ADD_ARG_LIT(def->biosfile);<br />
+ }<br />
+ <br />
/* This should *never* be NULL, since we always provide<br />
* a machine in the capabilities data for QEMU. So this<br />
* check is just here as a safety in case the unexpected<br />
</pre><br />
<br />
<li>Install libvirt 0.8.5 with that patch applied:</li><br />
service libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.8.5.tar.gz<br />
tar xfvz libvirt-0.8.5.tar.gz <br />
cd libvirt-0.8.5<br />
patch -p1 -i ../libvirt-0.8.5-biosfile.patch <br />
./configure --without-xen --prefix=/usr && make && make install<br />
service libvirt-bin start<br />
<br />
</ul><br />
--><br />
<li>Download old qemu bios from 0.10.6 version and copy it to /usr/share/qemu directory:</li><br />
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.10.6/qemu-kvm-0.10.6.tar.gz<br />
tar xfvz qemu-kvm-0.10.6.tar.gz<br />
cp qemu-kvm-0.10.6/pc-bios/bios.bin /usr/share/qemu-kvm/bios-0.10.6.bin<br />
<br />
<!-- Not needed, it seems to work without downloading this drivers<br />
<li>Download i82559 ROM from the latest qemu versions (Ubuntu 10.04 does not include that ROM in qemu-kvm package):</li><br />
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.12.5/qemu-kvm-0.12.5.tar.gz<br />
tar xfvz qemu-kvm-0.12.5.tar.gz<br />
cp qemu-kvm-0.12.5/pc-bios/pxe-i82559er.bin /usr/share/qemu-kvm/<br />
--><br />
</ul><br />
<br />
<br />
== Installation over Fedora 11 (Draft) ==<br />
<br />
Follow this steps to install VNX over Fedora 11:<br />
<ul><br />
<br />
<li>Install packages:</li><br />
yum -y groupinstall "Development Tools"<br />
yum install qemu-kvm libvirt virt-manager virt-viewer perl-XML-LibXML<br />
yum install perl-XML-DOM perl-NetAddr-IP perl-Readonly perl-TermReadKey<br />
yum install perl-Net-Pcap perl-Net-IPv6Addr perl-Net-Telnet perl-Error<br />
yum install perl-Exception-Class perl-ExtUtils-MakeMaker tunctl screen wget<br />
yum install libxml2-devel gnutls-devel device-mapper-devel uml_utilities <br />
yum install roxterm xterm graphviz perl-AppConfig<br />
<br />
<li>Install libvirt 0.8.5:</li><br />
/etc/init.d/libvirtd stop<br />
wget http://libvirt.org/sources/libvirt-0.8.5.tar.gz<br />
tar xfvz libvirt-0.8.5.tar.gz<br />
cd libvirt-0.8.5<br />
./configure --without-xen --prefix=/usr && make && make install<br />
/etc/init.d/libvirtd start<br />
<br />
<li>Install SysVirt manually:</li><br />
wget http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.2.4.tar.gz<br />
tar xfvz Sys-Virt-0.2.4.tar.gz<br />
cd Sys-Virt-0.2.4<br />
perl Makefile.PL<br />
make install<br />
<!--<br />
<li> Instalar VNUML sobre Fedora 11 siguiendo la receta en http://www.dit.upm.es/vnumlwiki/index.php/Fedora11</li><br />
<br />
<li> Instalar paquetes y librerías necesarias:</li><br />
yum install qemu-kvm libvirt virt-manager virt-viewer perl-XML-LibXML perl-Sys-Virt<br />
yum -y install bridge-utils readline-devel perl-Module-Build screen expat-devel libpcap-devel <br />
yum -y install perl-Net-Pcap perl-NetAddr-IP perl-Net-IPv6Addr perl-XML-DOM perl-Exception-Class<br />
yum -y install perl-TermReadKey perl-Error perl-CPAN uml_utilities xterm tunctl<br />
<br />
<li>Install XML::Checker perl library:</li><br />
perl -MCPAN -e shell<br />
install XML::Checker<br />
--><br />
<li>Add symbolic link for kvm:</li><br />
ln -s /usr/bin/qemu-kvm /usr/bin/kvm<br />
<br />
<li>Instalar VNX:</li><br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-latest.tgz<br />
tar xfvz vnx-latest.tgz<br />
cd vnx-*<br />
./install-vnx<br />
<br />
<li>Create the VNX config file (/etc/vnx.conf). You just can move the sample config file:</li><br />
mv /etc/vnx.conf.samble /etc/vnx.conf<br />
<br />
<li>Deshabilitar el firewall o, alternativamente, configurar los interfaces tipo "tun" como confiables (Sistema->Firewall->Interfaces Confiables").</li><br />
</ul><br />
<br />
=== Additional install steps for Dynamips support ===<br />
<br />
* Install Dynamips and Dynagen:<br />
wget http://downloads.sourceforge.net/project/dyna-gen/dynamips%20Linux%20RPM/0.2.8-RC2/dynamips-0.2.8RC2-1.i386.rpm<br />
rpm -i dynamips-0.2.8RC2-1.i386.rpm<br />
wget http://downloads.sourceforge.net/project/dyna-gen/dynagen%20source%20_%20Linux/dynagen%200.11.0/dynagen-0.11.0-1.fc9.noarch.rpm<br />
rpm -i dynagen-0.11.0-1.fc9.noarch.rpm<br />
<br />
* Set execution permissions for the script and add it to system start-up:<br />
chkconfig --add dynamips<br />
/etc/init.d/dynamips start<br />
<br />
* Download and install cisco IOS image:<br />
cd /usr/share/vnx/filesystems<br />
# Cisco image<br />
wget ... c3640-js-mz.124-19.image<br />
ln -s c3640-js-mz.124-19.image c3640<br />
<br />
* Calculate the idle-pc value for your computer following the procedure in http://dynagen.org/tutorial.htm:<br />
dynagen /usr/share/vnx/examples/R.net<br />
console R # type 'no' to exit the config wizard and wait <br />
# for the router to completely start <br />
idle-pc get R<br />
Once you know the idle-pc value for your system, include it in /etc/vnx.conf file.<br />
<br />
=== Additional install steps for Olive support ===<br />
<br />
Several additional steps are needed to support Olive (Juniper) routers in VNX scenarios:<br />
<br />
<ul><br />
<br />
<li>Download old qemu bios from 0.10.6 version and copy it to /usr/share/qemu directory:</li><br />
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.10.6/qemu-kvm-0.10.6.tar.gz<br />
tar xfvz qemu-kvm-0.10.6.tar.gz<br />
cp qemu-kvm-0.10.6/pc-bios/bios.bin /usr/share/qemu/bios-0.10.6.bin<br />
<br />
</ul><br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<!-- COSAS ANTIGUAS --><br />
<br />
<!--li>Modificar vnumlparser.pl, sustituyendo en la función mode_t la línea en ):</li><br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
<br />
por:<br />
<br />
if (! -e "/dev/net/tun") {<br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
}<br />
<br />
Explicación: el módulo tun se ha integrado en el kernel a partir de la 10.04, por lo que no es necesario cargarlo como hasta ahora mediante "modprobe tun". El cambio anterior simplemente comprueba si existe el dispositivo /dev/net/tun y carga el modulo en caso de que no exista.<br />
--><br />
<br />
<br />
<!--li>Modificar vnumlparser.pl, sustituyendo en la función mode_t la línea en ):</li><br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
<br />
por:<br />
<br />
if (! -e "/dev/net/tun") {<br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
}<br />
<br />
Explicación: el módulo tun se ha integrado en el kernel a partir de la 10.04, por lo que no es necesario cargarlo como hasta ahora mediante "modprobe tun". El cambio anterior simplemente comprueba si existe el dispositivo /dev/net/tun y carga el modulo en caso de que no exista.<br />
--><br />
<br />
<!--<br />
Pasos a seguir para instalar VNX sobre Ubuntu 9.10. <br />
<br />
'''Nota importante''': se han detectado importantes problemas de prestaciones cuando se utiliza el sistema de ficheros ext4 con Ubuntu 9.10. Por ello, y hasta que se localice el origen de dichas ineficiencias, se recomienda utilizar ext3. <br />
<ul><br />
<br />
<li> Instalar Ubuntu 9.10 y actualizar con:</li><br />
apt-get update; apt-get dist-upgrade<br />
--><br />
<!--<br />
<li>Añadir repositorios VNUML a /etc/apt/sources.lst:</li><br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian binary/" >> /etc/apt/sources.list<br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian-testing binary/" >> /etc/apt/sources.list<br />
--><br />
<!--<br />
<li>Install paquetes básicos de desarrollo, paquetes de virtualización (qemu-kvm, libvirt, vnuml) y librerías y paquetes auxiliares</li><br />
apt-get update<br />
apt-get install build-essential qemu-kvm libvirt-bin libvirt-dev \<br />
virt-manager virt-viewer vlan xterm bridge-utils screen uml-utilities \<br />
libxml-checker-perl libxml-parser-perl libnetaddr-ip-perl libnet-pcap-perl \<br />
libnet-ipv6addr-perl liberror-perl libexception-class-perl libxml-libxml-perl \<br />
libxml2-dev libgnutls-dev libdevmapper-dev libterm-readline-perl-perl <br />
<br />
<br />
<br />
curl vnuml linux-um <br />
<br />
<li>Si se usa la versión de Ubuntu de 64 bits hay que instalar las librerías de compatibilidad de 32 bits:</li><br />
apt-get install ia32-libs<br />
<br />
<li>Install qemu-kvm version 0.12.4 (version 0.11 which comes as apackage in 9.10 provokes hanging problems in Windows virtual machines when executing commands -something relates apparently with mounting cdroms in vms-):</li><br />
wget http://sourceforge.net/projects/kvm/files/qemu-kvm/0.11.1/qemu-kvm-0.11.1.tar.gz/download<br />
tar xfvz qemu-kvm-0.11.1.tar.gz<br />
cd qemu-kvm-0.11.1<br />
./configure --prefix=/usr && make && make install<br />
ln -s /usr/bin/qemu-system-x86_64 /usr/bin/kvm<br />
Editar /etc/modules y añadir:<br />
kvm <br />
kvm_intel<br />
<br />
wget http://sourceforge.net/projects/kvm/files/kvm-kmod/2.6.31.6b/kvm-kmod-2.6.31.6b.tar.bz2/download<br />
<br />
<li>Instalar libvirt 0.8.0:</li><br />
/etc/init.d/libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.8.0.tar.gz<br />
tar xfvz libvirt-0.8.0.tar.gz<br />
cd libvirt-0.8.0<br />
./configure --prefix=/usr && make && make install<br />
/etc/init.d/libvirt-bin start<br />
<br />
<li> Instalar la librería perl de acceso a libvirt (Sys::Virt) desde CPAN (dicha librería no esta disponible como paquete para Ubuntu 9.10):</li><br />
--><br />
<!-- wget http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.2.2.tar.gz<br />
tar xfvz Sys-Virt-0.2.2.tar.gz <br />
cd Sys-Virt-0.2.2<br />
perl Makefile.PL<br />
make install<br />
--><br />
<!--<br />
perl -MCPAN -e "CPAN::Shell->force(qw(install Sys::Virt));"<br />
Nota: constestar YES a la pregunta "Would you like me to configure as much as posible automatically?" y a "Is it OK to try to connect to the Internet?" <br />
<br />
<li>Instalar rootfilesystem de VNUML, enlaces del kernel y crear clave rsa:</li><br />
cd /usr/share/vnuml/filesystems<br />
wget http://www.dit.upm.es/vnuml/download/scripts/root-fs-installer<br />
perl root-fs-installer<br />
cd ../kernels<br />
ln -s linux-2.6.28.10-1m linux<br />
ssh-keygen -t rsa1<br />
<br />
<li>Instalar VNX:</li><br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-0.12b.tgz<br />
tar xfvz vnx-0.12b.tgz<br />
cd vnx-0.12b<br />
./install-vnx<br />
</ul><br />
<br />
Notas:<br />
http://www.ubuntu-es.org/node/128867<br />
175 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-headers-2.6.32-02063209_2.6.32-02063209_all.deb<br />
176 http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-image-2.6.32-02063209-generic_2.6.32-02063209_amd64.deb<br />
177 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-image-2.6.32-02063209-generic_2.6.32-02063209_amd64.deb<br />
178 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-headers-2.6.32-02063209-generic_2.6.32-02063209_amd64.deb<br />
--><br />
<br />
<!--<br />
=== Sobre Ubuntu 8.04 ===<br />
<br />
Pasos a seguir para instalar VNX sobre Ubuntu 8.04:<br />
<ul><br />
<br />
<li> Instalar Ubuntu 8.04 y actualizar con:</li><br />
apt-get update; apt-get dist-upgrade<br />
Rearrancar la máquina en caso de que se actualice la versión del kernel.<br />
<br />
<li> Añadir repositorio VNUML a /etc/apt/sources.lst:</li><br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian binary/" >> /etc/apt/sources.list<br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian-testing binary/" >> /etc/apt/sources.list<br />
<br />
<li> Instalar paquetes:</li><br />
apt-get update <br />
apt-get install virt-manager virt-viewer build-essential \<br />
libxml-libxml-perl vncviewer vlan xterm bridge-utils screen \<br />
curl vnuml linux-um libterm-readline-perl-perl zlib-bin zlib1g-dev \<br />
libxen3-dev libxml2-dev libgnutls-dev libsasl2-dev libsdl1.2-dev \<br />
libdevmapper-dev dnsmasq xbase-clients pkg-config<br />
<br />
<li>Si se usa la versión de Ubuntu de 64 bits hay que instalar las librerías de compatibilidad de 32 bits:</li><br />
apt-get install ia32-libs<br />
<br />
<li>Instalar qemu-kvm version 0.11.1 (la version 0.12.2 da errores):</li><br />
wget http://sourceforge.net/projects/kvm/files/qemu-kvm/0.11.1/qemu-kvm-0.11.1.tar.gz/download<br />
tar xfvz qemu-kvm-0.11.1.tar.gz<br />
cd qemu-kvm-0.11.1<br />
./configure --prefix=/usr && make && make install<br />
ln -s /usr/bin/qemu-system-x86_64 /usr/bin/kvm<br />
Editar /etc/modules y añadir:<br />
kvm <br />
kvm_intel<br />
<br />
<li>Instalar libvirt 0.7.6:</li><br />
apt-get install libvirt-bin<br />
/etc/init.d/libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.7.6.tar.gz<br />
tar xfvz libvirt-0.7.6.tar.gz<br />
cd libvirt-0.7.6<br />
./configure --prefix=/usr --without-storage-disk && make && make install<br />
/etc/init.d/libvirt-bin start<br />
<br />
<li>Instalar librería perl de acceso a libvirt (Sys::Virt) mediante CPAN (no está disponible como paquete ubuntu)</li><br />
perl -MCPAN -e "CPAN::Shell->force(qw(install Sys::Virt));"<br />
Note: answer NO to the question "Are you ready for manual configuration?"<br />
<br />
<li>Instalar rootfilesystem de VNUML, enlaces del kernel y crear clave rsa:</li><br />
cd /usr/share/vnuml/filesystems<br />
wget http://www.dit.upm.es/vnuml/download/scripts/root-fs-installer<br />
perl root-fs-installer<br />
cd ../kernels<br />
ln -s linux-2.6.28.10-1m linux<br />
ssh-keygen -t rsa1<br />
<br />
<li>Instalar VNX:</li><br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-0.12b.tgz<br />
tar xfvz vnx-0.12b.tgz<br />
cd vnx-0.12b<br />
./install-vnx<br />
</ul><br />
--></div>Davidhttps://web.dit.upm.es/vnumlwiki/index.php?title=Vnx-install&diff=4109Vnx-install2011-02-24T13:27:31Z<p>David: /* Additional install steps for Dynamips support */</p>
<hr />
<div>{{Title|VNX (Virtual Networks over X virtualization) v0.14 beta}}<br />
<br />
== Installation over Ubuntu 10.04/9.10 ==<br />
<br />
This section describes the procedure for installing VNX over Ubuntu 10.04 or 9.10. Open a root shell window and follow these steps:<br />
<ul><br />
<br />
<li>Install all packages required (basic development, virtualization, perl libraries and auxiliar packages):</li><br />
apt-get update<br />
apt-get install build-essential qemu-kvm libvirt-bin vlan xterm \<br />
bridge-utils screen virt-manager virt-viewer libxml-checker-perl \<br />
libxml-parser-perl libnetaddr-ip-perl libnet-pcap-perl \<br />
libnet-ipv6addr-perl liberror-perl libexception-class-perl \<br />
uml-utilities libxml-libxml-perl libxml2-dev libgnutls-dev \<br />
libdevmapper-dev libterm-readline-perl-perl libnet-telnet-perl \<br />
libnet-ip-perl libreadonly-perl libmath-round-perl libappconfig-perl \<br />
libdbi-perl graphviz libnl-dev genisoimage gnome-terminal<br />
<br />
<!--Note: for Ubuntu 9.04 change "qemu-kvm" package by "qemu kvm" --><br />
<li>If you use 64 bits version of Ubuntu, install 32 bits compatibility libraries:</li><br />
apt-get install ia32-libs<br />
<br />
<li>Install libvirt 0.8.5:</li><br />
/etc/init.d/libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.8.5.tar.gz<br />
tar xfvz libvirt-0.8.5.tar.gz<br />
cd libvirt-0.8.5<br />
./configure --without-xen --prefix=/usr && make && make install<br />
/etc/init.d/libvirt-bin start<br />
<br />
'''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.<br />
<br />
<li>Install Sys::Virt perl module:</li><br />
<ul><br />
<li>For Ubuntu 10.04, just install the libsys-virt-perl package</li><br />
apt-get install libsys-virt-perl<br />
<!--<br />
'''IMPORTANT NOTE''': Windows XP virtual machines started with VNX over Ubuntu 9.10 frequently hang when executing commands or with high traffic loads. The problem could be related with virtual network drivers. We are investigating the problem to find a solution. By now, Ubuntu 10.04 is the recomended platform to test VNX.<br />
--><br />
<li>For Ubuntu 9.10, as Sys::Virt library is not available as a package, install it manually:</li><br />
wget http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.2.3.tar.gz<br />
tar xfvz Sys-Virt-0.2.3.tar.gz <br />
cd Sys-Virt-0.2.3<br />
perl Makefile.PL<br />
make install<br />
</ul><br />
<br />
<li>Install VNX:</li><br />
mkdir /tmp/vnx-update<br />
cd /tmp/vnx-update<br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-latest.tgz<br />
tar xfvz vnx-latest.tgz<br />
cd vnx-*<br />
./install_vnx<br />
<br />
<li>Create the VNX config file (/etc/vnx.conf). You just can move the sample config file:</li><br />
mv /etc/vnx.conf.samble /etc/vnx.conf<br />
<br />
<li>Download root file systems from http://idefix.dit.upm.es/download/vnx/filesystems and copy them to /usr/share/vnx/filesystems directory:</li><br />
cd /usr/share/vnx/filesystems<br />
<br />
# ubuntu server<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.10-v01.qcow2.bz2<br />
bunzip2 root_fs_ubuntu-10.10-v01.qcow2.bz2<br />
ln -s root_fs_ubuntu-10.10-v01.qcow2 root_fs_ubuntu<br />
<br />
# ubuntu with gui<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.04-gui-v01.qcow2.bz2<br />
bunzip2 root_fs_ubuntu-10.04-gui-v01.qcow2.bz2<br />
ln -s root_fs_ubuntu-10.04-gui-v01.qcow2 root_fs_ubuntu-gui<br />
<br />
# freebsd server<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-v01.qcow2.bz2<br />
bunzip2 root_fs_freebsd-v01.qcow2.bz2<br />
ln -s root_fs_freebsd-v01.qcow2 root_fs_freebsd<br />
<br />
# freebsd gui<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-gui-v01.qcow2.bz2<br />
bunzip2 root_fs_freebsd-gui-v01.qcow2.bz2<br />
ln -s root_fs_freebsd-gui-v01.qcow2 root_fs_freebsd-gui<br />
<br />
# winxp and win7<br />
# Sorry! Unfortunately for legal reasons we cannot distribute windows XP<br />
# or Windows 7 root filesystems. See VNX documentation for detailed recipes<br />
# to create these root fylesystems from scratch<br />
<br />
<li>Additionally, if you plan to use VNUML root filesystem:</li><br />
# VNUML root_fs_tutorial and kernel<br />
cd /usr/share/vnx/filesystem<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_tutorial-0.6.0.bz2<br />
bunzip2 root_fs_tutorial-0.6.0.bz2<br />
ln -s root_fs_tutorial-0.6.0 root_fs_tutorial<br />
cd /usr/share/vnx/kernels<br />
wget -N http://jungla.dit.upm.es/~vnx/download/kernels/linux-2.6.18.1-bb2-xt-4m<br />
chmod +x linux-2.6.18.1-bb2-xt-4m<br />
ln -s linux-2.6.18.1-bb2-xt-4m linux<br />
<br />
</ul><br />
<br />
'''NOTE for Ubuntu 10.04.1''': It seems that an additional package has to be installed:<br />
apt-get install kvm-pxe<br />
<br />
=== Additional install steps for Dynamips support ===<br />
<br />
* Install Dynamips and Dynagen:<br />
apt-get install dynamips dynagen<br />
<br />
* Create a file /etc/init.d/dynamips (taken from http://7200emu.hacki.at/viewtopic.php?t=2198):<br />
<pre><br />
#!/bin/sh<br />
# Start/stop the dynamips program as a daemon.<br />
#<br />
### BEGIN INIT INFO<br />
# Provides: dynamips<br />
# Default-Start: 2 3 4 5<br />
# Default-Stop: 0 1 6<br />
# Short-Description: Cisco hardware emulator daemon<br />
### END INIT INFO<br />
<br />
DAEMON=/usr/bin/dynamips<br />
NAME=dynamips<br />
PORT=7200<br />
PIDFILE=/var/run/$NAME.pid <br />
LOGFILE=/var/log/$NAME.log<br />
DESC="Cisco Emulator"<br />
SCRIPTNAME=/etc/init.d/$NAME<br />
<br />
test -f $DAEMON || exit 0<br />
<br />
. /lib/lsb/init-functions<br />
<br />
<br />
case "$1" in<br />
start) log_daemon_msg "Starting $DESC " "$NAME"<br />
start-stop-daemon --start --chdir /tmp --background --make-pidfile --pidfile $PIDFILE --name $NAME --startas $DAEMON -- -H $PORT -l $LOGFILE<br />
log_end_msg $?<br />
;;<br />
stop) log_daemon_msg "Stopping $DESC " "$NAME"<br />
start-stop-daemon --stop --quiet --pidfile $PIDFILE --name $NAME<br />
log_end_msg $?<br />
;;<br />
restart) log_daemon_msg "Restarting $DESC " "$NAME"<br />
start-stop-daemon --stop --retry 5 --quiet --pidfile $PIDFILE --name $NAME<br />
start-stop-daemon --start --chdir /tmp --background --make-pidfile --pidfile $PIDFILE --name $NAME --startas $DAEMON -- -H $PORT -l $LOGFILE<br />
log_end_msg $?<br />
;;<br />
status)<br />
status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $? <br />
#status $NAME<br />
#RETVAL=$?<br />
;; <br />
*) log_action_msg "Usage: $SCRIPTNAME {start|stop|restart|status}"<br />
exit 2<br />
;;<br />
esac<br />
exit 0<br />
<br />
</pre><br />
<br />
* Set execution permissions for the script and add it to system start-up:<br />
chmod +x /etc/init.d/dynamips<br />
update-rc.d dynamips defaults<br />
/etc/init.d/dynamips start<br />
<br />
* Download and install cisco IOS image:<br />
cd /usr/share/vnx/filesystems<br />
# Cisco image<br />
wget ... c3640-js-mz.124-19.image<br />
ln -s c3640-js-mz.124-19.image c3640<br />
<br />
* Calculate the idle-pc value for your computer following the procedure in http://dynagen.org/tutorial.htm:<br />
dynagen /usr/share/vnx/examples/R.net<br />
console R # type 'no' to exit the config wizard and wait <br />
# for the router to completely start <br />
idle-pc get R<br />
Once you know the idle-pc value for your system, include it in /etc/vnx.conf file.<br />
<br />
=== Additional install steps for Olive support ===<br />
<br />
Several additional steps are needed to support Olive (Juniper) routers in VNX scenarios:<br />
<br />
<ul><br />
<br />
<!-- Ya no hace falta desde que se usa <qemu:commandline><br />
<br />
<li>Install a patched version of libvirt 0.8.5 with support to define the bios used by a virtual machine:</li><br />
<br />
<ul><br />
<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><br />
<pre><br />
diff -crB libvirt-0.8.5.orig/src/conf/domain_conf.c libvirt-0.8.5/src/conf/domain_conf.c<br />
*** libvirt-0.8.5.orig/src/conf/domain_conf.c 2010-11-22 11:38:08.000000000 +0100<br />
--- libvirt-0.8.5/src/conf/domain_conf.c 2010-11-22 11:47:41.000000000 +0100<br />
***************<br />
*** 4267,4272 ****<br />
--- 4267,4274 ----<br />
if (node)<br />
def->mem.hugepage_backed = 1;<br />
<br />
+ def->biosfile = virXPathString("string(./biosfile[1])", ctxt);<br />
+ <br />
/* Extract other memory tunables */<br />
if (virXPathULong("string(./memtune/hard_limit)", ctxt,<br />
&def->mem.hard_limit) < 0)<br />
diff -crB libvirt-0.8.5.orig/src/conf/domain_conf.h libvirt-0.8.5/src/conf/domain_conf.h<br />
*** libvirt-0.8.5.orig/src/conf/domain_conf.h 2010-11-22 11:38:08.000000000 +0100<br />
--- libvirt-0.8.5/src/conf/domain_conf.h 2010-11-22 11:40:18.000000000 +0100<br />
***************<br />
*** 885,890 ****<br />
--- 885,891 ----<br />
unsigned long min_guarantee;<br />
unsigned long swap_hard_limit;<br />
} mem;<br />
+ char *biosfile;<br />
unsigned short vcpus;<br />
unsigned short maxvcpus;<br />
int cpumasklen;<br />
diff -crB libvirt-0.8.5.orig/src/qemu/qemu_conf.c libvirt-0.8.5/src/qemu/qemu_conf.c<br />
*** libvirt-0.8.5.orig/src/qemu/qemu_conf.c 2010-11-22 11:38:08.000000000 +0100<br />
--- libvirt-0.8.5/src/qemu/qemu_conf.c 2010-11-22 11:41:05.000000000 +0100<br />
***************<br />
*** 3984,3989 ****<br />
--- 3984,3995 ----<br />
ADD_ARG_LIT(emulator);<br />
ADD_ARG_LIT("-S");<br />
<br />
+ if(def->biosfile)<br />
+ {<br />
+ ADD_ARG_LIT("-bios");<br />
+ ADD_ARG_LIT(def->biosfile);<br />
+ }<br />
+ <br />
/* This should *never* be NULL, since we always provide<br />
* a machine in the capabilities data for QEMU. So this<br />
* check is just here as a safety in case the unexpected<br />
</pre><br />
<br />
<li>Install libvirt 0.8.5 with that patch applied:</li><br />
service libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.8.5.tar.gz<br />
tar xfvz libvirt-0.8.5.tar.gz <br />
cd libvirt-0.8.5<br />
patch -p1 -i ../libvirt-0.8.5-biosfile.patch <br />
./configure --without-xen --prefix=/usr && make && make install<br />
service libvirt-bin start<br />
<br />
</ul><br />
--><br />
<li>Download old qemu bios from 0.10.6 version and copy it to /usr/share/qemu directory:</li><br />
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.10.6/qemu-kvm-0.10.6.tar.gz<br />
tar xfvz qemu-kvm-0.10.6.tar.gz<br />
cp qemu-kvm-0.10.6/pc-bios/bios.bin /usr/share/qemu-kvm/bios-0.10.6.bin<br />
<br />
<!-- Not needed, it seems to work without downloading this drivers<br />
<li>Download i82559 ROM from the latest qemu versions (Ubuntu 10.04 does not include that ROM in qemu-kvm package):</li><br />
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.12.5/qemu-kvm-0.12.5.tar.gz<br />
tar xfvz qemu-kvm-0.12.5.tar.gz<br />
cp qemu-kvm-0.12.5/pc-bios/pxe-i82559er.bin /usr/share/qemu-kvm/<br />
--><br />
</ul><br />
<br />
<br />
== Installation over Fedora 11 (Draft) ==<br />
<br />
Follow this steps to install VNX over Fedora 11:<br />
<ul><br />
<br />
<li>Install packages:</li><br />
yum -y groupinstall "Development Tools"<br />
yum install qemu-kvm libvirt virt-manager virt-viewer perl-XML-LibXML<br />
yum install perl-XML-DOM perl-NetAddr-IP perl-Readonly perl-TermReadKey<br />
yum install perl-Net-Pcap perl-Net-IPv6Addr perl-Net-Telnet perl-Error<br />
yum install perl-Exception-Class perl-ExtUtils-MakeMaker tunctl screen wget<br />
yum install libxml2-devel gnutls-devel device-mapper-devel uml_utilities <br />
yum install roxterm xterm graphviz perl-AppConfig<br />
<br />
<li>Install libvirt 0.8.5:</li><br />
/etc/init.d/libvirtd stop<br />
wget http://libvirt.org/sources/libvirt-0.8.5.tar.gz<br />
tar xfvz libvirt-0.8.5.tar.gz<br />
cd libvirt-0.8.5<br />
./configure --without-xen --prefix=/usr && make && make install<br />
/etc/init.d/libvirtd start<br />
<br />
<li>Install SysVirt manually:</li><br />
wget http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.2.4.tar.gz<br />
tar xfvz Sys-Virt-0.2.4.tar.gz<br />
cd Sys-Virt-0.2.4<br />
perl Makefile.PL<br />
make install<br />
<!--<br />
<li> Instalar VNUML sobre Fedora 11 siguiendo la receta en http://www.dit.upm.es/vnumlwiki/index.php/Fedora11</li><br />
<br />
<li> Instalar paquetes y librerías necesarias:</li><br />
yum install qemu-kvm libvirt virt-manager virt-viewer perl-XML-LibXML perl-Sys-Virt<br />
yum -y install bridge-utils readline-devel perl-Module-Build screen expat-devel libpcap-devel <br />
yum -y install perl-Net-Pcap perl-NetAddr-IP perl-Net-IPv6Addr perl-XML-DOM perl-Exception-Class<br />
yum -y install perl-TermReadKey perl-Error perl-CPAN uml_utilities xterm tunctl<br />
<br />
<li>Install XML::Checker perl library:</li><br />
perl -MCPAN -e shell<br />
install XML::Checker<br />
--><br />
<li>Add symbolic link for kvm:</li><br />
ln -s /usr/bin/qemu-kvm /usr/bin/kvm<br />
<br />
<li>Instalar VNX:</li><br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-latest.tgz<br />
tar xfvz vnx-latest.tgz<br />
cd vnx-*<br />
./install-vnx<br />
<br />
<li>Create the VNX config file (/etc/vnx.conf). You just can move the sample config file:</li><br />
mv /etc/vnx.conf.samble /etc/vnx.conf<br />
<br />
<li>Deshabilitar el firewall o, alternativamente, configurar los interfaces tipo "tun" como confiables (Sistema->Firewall->Interfaces Confiables").</li><br />
</ul><br />
<br />
=== Additional install steps for Dynamips support ===<br />
<br />
* Install Dynamips and Dynagen:<br />
wget http://downloads.sourceforge.net/project/dyna-gen/dynamips%20Linux%20RPM/0.2.8-RC2/dynamips-0.2.8RC2-1.i386.rpm<br />
rpm -i dynamips-0.2.8RC2-1.i386.rpm<br />
wget http://downloads.sourceforge.net/project/dyna-gen/dynagen%20source%20_%20Linux/dynagen%200.11.0/dynagen-0.11.0-1.fc9.noarch.rpm<br />
rpm -i dynagen-0.11.0-1.fc9.noarch.rpm<br />
<br />
* Set execution permissions for the script and add it to system start-up:<br />
chkconfig --add dynamips<br />
/etc/init.d/dynamips start<br />
<br />
* Download and install cisco IOS image:<br />
cd /usr/share/vnx/filesystems<br />
# Cisco image<br />
wget ... c3640-js-mz.124-19.image<br />
ln -s c3640-js-mz.124-19.image c3640<br />
<br />
* Calculate the idle-pc value for your computer following the procedure in http://dynagen.org/tutorial.htm:<br />
dynagen /usr/share/vnx/examples/R.net<br />
console R # type 'no' to exit the config wizard and wait <br />
# for the router to completely start <br />
idle-pc get R<br />
Once you know the idle-pc value for your system, include it in /etc/vnx.conf file.<br />
<br />
=== Additional install steps for Olive support ===<br />
<br />
Several additional steps are needed to support Olive (Juniper) routers in VNX scenarios:<br />
<br />
<ul><br />
<br />
<li>Download old qemu bios from 0.10.6 version and copy it to /usr/share/qemu directory:</li><br />
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.10.6/qemu-kvm-0.10.6.tar.gz<br />
tar xfvz qemu-kvm-0.10.6.tar.gz<br />
cp qemu-kvm-0.10.6/pc-bios/bios.bin /usr/share/qemu/bios-0.10.6.bin<br />
<br />
</ul><br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<!-- COSAS ANTIGUAS --><br />
<br />
<!--li>Modificar vnumlparser.pl, sustituyendo en la función mode_t la línea en ):</li><br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
<br />
por:<br />
<br />
if (! -e "/dev/net/tun") {<br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
}<br />
<br />
Explicación: el módulo tun se ha integrado en el kernel a partir de la 10.04, por lo que no es necesario cargarlo como hasta ahora mediante "modprobe tun". El cambio anterior simplemente comprueba si existe el dispositivo /dev/net/tun y carga el modulo en caso de que no exista.<br />
--><br />
<br />
<br />
<!--li>Modificar vnumlparser.pl, sustituyendo en la función mode_t la línea en ):</li><br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
<br />
por:<br />
<br />
if (! -e "/dev/net/tun") {<br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
}<br />
<br />
Explicación: el módulo tun se ha integrado en el kernel a partir de la 10.04, por lo que no es necesario cargarlo como hasta ahora mediante "modprobe tun". El cambio anterior simplemente comprueba si existe el dispositivo /dev/net/tun y carga el modulo en caso de que no exista.<br />
--><br />
<br />
<!--<br />
Pasos a seguir para instalar VNX sobre Ubuntu 9.10. <br />
<br />
'''Nota importante''': se han detectado importantes problemas de prestaciones cuando se utiliza el sistema de ficheros ext4 con Ubuntu 9.10. Por ello, y hasta que se localice el origen de dichas ineficiencias, se recomienda utilizar ext3. <br />
<ul><br />
<br />
<li> Instalar Ubuntu 9.10 y actualizar con:</li><br />
apt-get update; apt-get dist-upgrade<br />
--><br />
<!--<br />
<li>Añadir repositorios VNUML a /etc/apt/sources.lst:</li><br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian binary/" >> /etc/apt/sources.list<br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian-testing binary/" >> /etc/apt/sources.list<br />
--><br />
<!--<br />
<li>Install paquetes básicos de desarrollo, paquetes de virtualización (qemu-kvm, libvirt, vnuml) y librerías y paquetes auxiliares</li><br />
apt-get update<br />
apt-get install build-essential qemu-kvm libvirt-bin libvirt-dev \<br />
virt-manager virt-viewer vlan xterm bridge-utils screen uml-utilities \<br />
libxml-checker-perl libxml-parser-perl libnetaddr-ip-perl libnet-pcap-perl \<br />
libnet-ipv6addr-perl liberror-perl libexception-class-perl libxml-libxml-perl \<br />
libxml2-dev libgnutls-dev libdevmapper-dev libterm-readline-perl-perl <br />
<br />
<br />
<br />
curl vnuml linux-um <br />
<br />
<li>Si se usa la versión de Ubuntu de 64 bits hay que instalar las librerías de compatibilidad de 32 bits:</li><br />
apt-get install ia32-libs<br />
<br />
<li>Install qemu-kvm version 0.12.4 (version 0.11 which comes as apackage in 9.10 provokes hanging problems in Windows virtual machines when executing commands -something relates apparently with mounting cdroms in vms-):</li><br />
wget http://sourceforge.net/projects/kvm/files/qemu-kvm/0.11.1/qemu-kvm-0.11.1.tar.gz/download<br />
tar xfvz qemu-kvm-0.11.1.tar.gz<br />
cd qemu-kvm-0.11.1<br />
./configure --prefix=/usr && make && make install<br />
ln -s /usr/bin/qemu-system-x86_64 /usr/bin/kvm<br />
Editar /etc/modules y añadir:<br />
kvm <br />
kvm_intel<br />
<br />
wget http://sourceforge.net/projects/kvm/files/kvm-kmod/2.6.31.6b/kvm-kmod-2.6.31.6b.tar.bz2/download<br />
<br />
<li>Instalar libvirt 0.8.0:</li><br />
/etc/init.d/libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.8.0.tar.gz<br />
tar xfvz libvirt-0.8.0.tar.gz<br />
cd libvirt-0.8.0<br />
./configure --prefix=/usr && make && make install<br />
/etc/init.d/libvirt-bin start<br />
<br />
<li> Instalar la librería perl de acceso a libvirt (Sys::Virt) desde CPAN (dicha librería no esta disponible como paquete para Ubuntu 9.10):</li><br />
--><br />
<!-- wget http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.2.2.tar.gz<br />
tar xfvz Sys-Virt-0.2.2.tar.gz <br />
cd Sys-Virt-0.2.2<br />
perl Makefile.PL<br />
make install<br />
--><br />
<!--<br />
perl -MCPAN -e "CPAN::Shell->force(qw(install Sys::Virt));"<br />
Nota: constestar YES a la pregunta "Would you like me to configure as much as posible automatically?" y a "Is it OK to try to connect to the Internet?" <br />
<br />
<li>Instalar rootfilesystem de VNUML, enlaces del kernel y crear clave rsa:</li><br />
cd /usr/share/vnuml/filesystems<br />
wget http://www.dit.upm.es/vnuml/download/scripts/root-fs-installer<br />
perl root-fs-installer<br />
cd ../kernels<br />
ln -s linux-2.6.28.10-1m linux<br />
ssh-keygen -t rsa1<br />
<br />
<li>Instalar VNX:</li><br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-0.12b.tgz<br />
tar xfvz vnx-0.12b.tgz<br />
cd vnx-0.12b<br />
./install-vnx<br />
</ul><br />
<br />
Notas:<br />
http://www.ubuntu-es.org/node/128867<br />
175 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-headers-2.6.32-02063209_2.6.32-02063209_all.deb<br />
176 http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-image-2.6.32-02063209-generic_2.6.32-02063209_amd64.deb<br />
177 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-image-2.6.32-02063209-generic_2.6.32-02063209_amd64.deb<br />
178 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-headers-2.6.32-02063209-generic_2.6.32-02063209_amd64.deb<br />
--><br />
<br />
<!--<br />
=== Sobre Ubuntu 8.04 ===<br />
<br />
Pasos a seguir para instalar VNX sobre Ubuntu 8.04:<br />
<ul><br />
<br />
<li> Instalar Ubuntu 8.04 y actualizar con:</li><br />
apt-get update; apt-get dist-upgrade<br />
Rearrancar la máquina en caso de que se actualice la versión del kernel.<br />
<br />
<li> Añadir repositorio VNUML a /etc/apt/sources.lst:</li><br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian binary/" >> /etc/apt/sources.list<br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian-testing binary/" >> /etc/apt/sources.list<br />
<br />
<li> Instalar paquetes:</li><br />
apt-get update <br />
apt-get install virt-manager virt-viewer build-essential \<br />
libxml-libxml-perl vncviewer vlan xterm bridge-utils screen \<br />
curl vnuml linux-um libterm-readline-perl-perl zlib-bin zlib1g-dev \<br />
libxen3-dev libxml2-dev libgnutls-dev libsasl2-dev libsdl1.2-dev \<br />
libdevmapper-dev dnsmasq xbase-clients pkg-config<br />
<br />
<li>Si se usa la versión de Ubuntu de 64 bits hay que instalar las librerías de compatibilidad de 32 bits:</li><br />
apt-get install ia32-libs<br />
<br />
<li>Instalar qemu-kvm version 0.11.1 (la version 0.12.2 da errores):</li><br />
wget http://sourceforge.net/projects/kvm/files/qemu-kvm/0.11.1/qemu-kvm-0.11.1.tar.gz/download<br />
tar xfvz qemu-kvm-0.11.1.tar.gz<br />
cd qemu-kvm-0.11.1<br />
./configure --prefix=/usr && make && make install<br />
ln -s /usr/bin/qemu-system-x86_64 /usr/bin/kvm<br />
Editar /etc/modules y añadir:<br />
kvm <br />
kvm_intel<br />
<br />
<li>Instalar libvirt 0.7.6:</li><br />
apt-get install libvirt-bin<br />
/etc/init.d/libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.7.6.tar.gz<br />
tar xfvz libvirt-0.7.6.tar.gz<br />
cd libvirt-0.7.6<br />
./configure --prefix=/usr --without-storage-disk && make && make install<br />
/etc/init.d/libvirt-bin start<br />
<br />
<li>Instalar librería perl de acceso a libvirt (Sys::Virt) mediante CPAN (no está disponible como paquete ubuntu)</li><br />
perl -MCPAN -e "CPAN::Shell->force(qw(install Sys::Virt));"<br />
Note: answer NO to the question "Are you ready for manual configuration?"<br />
<br />
<li>Instalar rootfilesystem de VNUML, enlaces del kernel y crear clave rsa:</li><br />
cd /usr/share/vnuml/filesystems<br />
wget http://www.dit.upm.es/vnuml/download/scripts/root-fs-installer<br />
perl root-fs-installer<br />
cd ../kernels<br />
ln -s linux-2.6.28.10-1m linux<br />
ssh-keygen -t rsa1<br />
<br />
<li>Instalar VNX:</li><br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-0.12b.tgz<br />
tar xfvz vnx-0.12b.tgz<br />
cd vnx-0.12b<br />
./install-vnx<br />
</ul><br />
--></div>Davidhttps://web.dit.upm.es/vnumlwiki/index.php?title=Vnx-install&diff=4108Vnx-install2011-02-24T13:26:58Z<p>David: /* Additional install steps for Dynamips support */</p>
<hr />
<div>{{Title|VNX (Virtual Networks over X virtualization) v0.14 beta}}<br />
<br />
== Installation over Ubuntu 10.04/9.10 ==<br />
<br />
This section describes the procedure for installing VNX over Ubuntu 10.04 or 9.10. Open a root shell window and follow these steps:<br />
<ul><br />
<br />
<li>Install all packages required (basic development, virtualization, perl libraries and auxiliar packages):</li><br />
apt-get update<br />
apt-get install build-essential qemu-kvm libvirt-bin vlan xterm \<br />
bridge-utils screen virt-manager virt-viewer libxml-checker-perl \<br />
libxml-parser-perl libnetaddr-ip-perl libnet-pcap-perl \<br />
libnet-ipv6addr-perl liberror-perl libexception-class-perl \<br />
uml-utilities libxml-libxml-perl libxml2-dev libgnutls-dev \<br />
libdevmapper-dev libterm-readline-perl-perl libnet-telnet-perl \<br />
libnet-ip-perl libreadonly-perl libmath-round-perl libappconfig-perl \<br />
libdbi-perl graphviz libnl-dev genisoimage gnome-terminal<br />
<br />
<!--Note: for Ubuntu 9.04 change "qemu-kvm" package by "qemu kvm" --><br />
<li>If you use 64 bits version of Ubuntu, install 32 bits compatibility libraries:</li><br />
apt-get install ia32-libs<br />
<br />
<li>Install libvirt 0.8.5:</li><br />
/etc/init.d/libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.8.5.tar.gz<br />
tar xfvz libvirt-0.8.5.tar.gz<br />
cd libvirt-0.8.5<br />
./configure --without-xen --prefix=/usr && make && make install<br />
/etc/init.d/libvirt-bin start<br />
<br />
'''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.<br />
<br />
<li>Install Sys::Virt perl module:</li><br />
<ul><br />
<li>For Ubuntu 10.04, just install the libsys-virt-perl package</li><br />
apt-get install libsys-virt-perl<br />
<!--<br />
'''IMPORTANT NOTE''': Windows XP virtual machines started with VNX over Ubuntu 9.10 frequently hang when executing commands or with high traffic loads. The problem could be related with virtual network drivers. We are investigating the problem to find a solution. By now, Ubuntu 10.04 is the recomended platform to test VNX.<br />
--><br />
<li>For Ubuntu 9.10, as Sys::Virt library is not available as a package, install it manually:</li><br />
wget http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.2.3.tar.gz<br />
tar xfvz Sys-Virt-0.2.3.tar.gz <br />
cd Sys-Virt-0.2.3<br />
perl Makefile.PL<br />
make install<br />
</ul><br />
<br />
<li>Install VNX:</li><br />
mkdir /tmp/vnx-update<br />
cd /tmp/vnx-update<br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-latest.tgz<br />
tar xfvz vnx-latest.tgz<br />
cd vnx-*<br />
./install_vnx<br />
<br />
<li>Create the VNX config file (/etc/vnx.conf). You just can move the sample config file:</li><br />
mv /etc/vnx.conf.samble /etc/vnx.conf<br />
<br />
<li>Download root file systems from http://idefix.dit.upm.es/download/vnx/filesystems and copy them to /usr/share/vnx/filesystems directory:</li><br />
cd /usr/share/vnx/filesystems<br />
<br />
# ubuntu server<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.10-v01.qcow2.bz2<br />
bunzip2 root_fs_ubuntu-10.10-v01.qcow2.bz2<br />
ln -s root_fs_ubuntu-10.10-v01.qcow2 root_fs_ubuntu<br />
<br />
# ubuntu with gui<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.04-gui-v01.qcow2.bz2<br />
bunzip2 root_fs_ubuntu-10.04-gui-v01.qcow2.bz2<br />
ln -s root_fs_ubuntu-10.04-gui-v01.qcow2 root_fs_ubuntu-gui<br />
<br />
# freebsd server<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-v01.qcow2.bz2<br />
bunzip2 root_fs_freebsd-v01.qcow2.bz2<br />
ln -s root_fs_freebsd-v01.qcow2 root_fs_freebsd<br />
<br />
# freebsd gui<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-gui-v01.qcow2.bz2<br />
bunzip2 root_fs_freebsd-gui-v01.qcow2.bz2<br />
ln -s root_fs_freebsd-gui-v01.qcow2 root_fs_freebsd-gui<br />
<br />
# winxp and win7<br />
# Sorry! Unfortunately for legal reasons we cannot distribute windows XP<br />
# or Windows 7 root filesystems. See VNX documentation for detailed recipes<br />
# to create these root fylesystems from scratch<br />
<br />
<li>Additionally, if you plan to use VNUML root filesystem:</li><br />
# VNUML root_fs_tutorial and kernel<br />
cd /usr/share/vnx/filesystem<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_tutorial-0.6.0.bz2<br />
bunzip2 root_fs_tutorial-0.6.0.bz2<br />
ln -s root_fs_tutorial-0.6.0 root_fs_tutorial<br />
cd /usr/share/vnx/kernels<br />
wget -N http://jungla.dit.upm.es/~vnx/download/kernels/linux-2.6.18.1-bb2-xt-4m<br />
chmod +x linux-2.6.18.1-bb2-xt-4m<br />
ln -s linux-2.6.18.1-bb2-xt-4m linux<br />
<br />
</ul><br />
<br />
'''NOTE for Ubuntu 10.04.1''': It seems that an additional package has to be installed:<br />
apt-get install kvm-pxe<br />
<br />
=== Additional install steps for Dynamips support ===<br />
<br />
* Install Dynamips and Dynagen:<br />
apt-get install dynamips dynagen<br />
<br />
* Create a file /etc/init.d/dynamips (taken from http://7200emu.hacki.at/viewtopic.php?t=2198):<br />
<pre><br />
#!/bin/sh<br />
# Start/stop the dynamips program as a daemon.<br />
#<br />
### BEGIN INIT INFO<br />
# Provides: dynamips<br />
# Default-Start: 2 3 4 5<br />
# Default-Stop: 0 1 6<br />
# Short-Description: Cisco hardware emulator daemon<br />
### END INIT INFO<br />
<br />
DAEMON=/usr/bin/dynamips<br />
NAME=dynamips<br />
PORT=7200<br />
PIDFILE=/var/run/$NAME.pid <br />
LOGFILE=/var/log/$NAME.log<br />
DESC="Cisco Emulator"<br />
SCRIPTNAME=/etc/init.d/$NAME<br />
<br />
test -f $DAEMON || exit 0<br />
<br />
. /lib/lsb/init-functions<br />
<br />
<br />
case "$1" in<br />
start) log_daemon_msg "Starting $DESC " "$NAME"<br />
start-stop-daemon --start --chdir /tmp --background --make-pidfile --pidfile $PIDFILE --name $NAME --startas $DAEMON -- -H $PORT -l $LOGFILE<br />
log_end_msg $?<br />
;;<br />
stop) log_daemon_msg "Stopping $DESC " "$NAME"<br />
start-stop-daemon --stop --quiet --pidfile $PIDFILE --name $NAME<br />
log_end_msg $?<br />
;;<br />
restart) log_daemon_msg "Restarting $DESC " "$NAME"<br />
start-stop-daemon --stop --retry 5 --quiet --pidfile $PIDFILE --name $NAME<br />
start-stop-daemon --start --chdir /tmp --background --make-pidfile --pidfile $PIDFILE --name $NAME --startas $DAEMON -- -H $PORT -l $LOGFILE<br />
log_end_msg $?<br />
;;<br />
status)<br />
status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $? <br />
#status $NAME<br />
#RETVAL=$?<br />
;; <br />
*) log_action_msg "Usage: $SCRIPTNAME {start|stop|restart|status}"<br />
exit 2<br />
;;<br />
esac<br />
exit 0<br />
<br />
</pre><br />
<br />
* Set execution permissions for the script and add it to system start-up:<br />
chmod +x /etc/init.d/dynamips<br />
update-rc.d dynamips defaults<br />
/etc/init.d/dynamips start<br />
<br />
* Calculate the idle-pc value for your computer following the procedure in http://dynagen.org/tutorial.htm:<br />
dynagen /usr/share/vnx/examples/R.net<br />
console R # type 'no' to exit the config wizard and wait <br />
# for the router to completely start <br />
idle-pc get R<br />
Once you know the idle-pc value for your system, include it in /etc/vnx.conf file.<br />
<br />
* Download and install cisco IOS image:<br />
cd /usr/share/vnx/filesystems<br />
# Cisco image<br />
wget ... c3640-js-mz.124-19.image<br />
ln -s c3640-js-mz.124-19.image c3640<br />
<br />
=== Additional install steps for Olive support ===<br />
<br />
Several additional steps are needed to support Olive (Juniper) routers in VNX scenarios:<br />
<br />
<ul><br />
<br />
<!-- Ya no hace falta desde que se usa <qemu:commandline><br />
<br />
<li>Install a patched version of libvirt 0.8.5 with support to define the bios used by a virtual machine:</li><br />
<br />
<ul><br />
<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><br />
<pre><br />
diff -crB libvirt-0.8.5.orig/src/conf/domain_conf.c libvirt-0.8.5/src/conf/domain_conf.c<br />
*** libvirt-0.8.5.orig/src/conf/domain_conf.c 2010-11-22 11:38:08.000000000 +0100<br />
--- libvirt-0.8.5/src/conf/domain_conf.c 2010-11-22 11:47:41.000000000 +0100<br />
***************<br />
*** 4267,4272 ****<br />
--- 4267,4274 ----<br />
if (node)<br />
def->mem.hugepage_backed = 1;<br />
<br />
+ def->biosfile = virXPathString("string(./biosfile[1])", ctxt);<br />
+ <br />
/* Extract other memory tunables */<br />
if (virXPathULong("string(./memtune/hard_limit)", ctxt,<br />
&def->mem.hard_limit) < 0)<br />
diff -crB libvirt-0.8.5.orig/src/conf/domain_conf.h libvirt-0.8.5/src/conf/domain_conf.h<br />
*** libvirt-0.8.5.orig/src/conf/domain_conf.h 2010-11-22 11:38:08.000000000 +0100<br />
--- libvirt-0.8.5/src/conf/domain_conf.h 2010-11-22 11:40:18.000000000 +0100<br />
***************<br />
*** 885,890 ****<br />
--- 885,891 ----<br />
unsigned long min_guarantee;<br />
unsigned long swap_hard_limit;<br />
} mem;<br />
+ char *biosfile;<br />
unsigned short vcpus;<br />
unsigned short maxvcpus;<br />
int cpumasklen;<br />
diff -crB libvirt-0.8.5.orig/src/qemu/qemu_conf.c libvirt-0.8.5/src/qemu/qemu_conf.c<br />
*** libvirt-0.8.5.orig/src/qemu/qemu_conf.c 2010-11-22 11:38:08.000000000 +0100<br />
--- libvirt-0.8.5/src/qemu/qemu_conf.c 2010-11-22 11:41:05.000000000 +0100<br />
***************<br />
*** 3984,3989 ****<br />
--- 3984,3995 ----<br />
ADD_ARG_LIT(emulator);<br />
ADD_ARG_LIT("-S");<br />
<br />
+ if(def->biosfile)<br />
+ {<br />
+ ADD_ARG_LIT("-bios");<br />
+ ADD_ARG_LIT(def->biosfile);<br />
+ }<br />
+ <br />
/* This should *never* be NULL, since we always provide<br />
* a machine in the capabilities data for QEMU. So this<br />
* check is just here as a safety in case the unexpected<br />
</pre><br />
<br />
<li>Install libvirt 0.8.5 with that patch applied:</li><br />
service libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.8.5.tar.gz<br />
tar xfvz libvirt-0.8.5.tar.gz <br />
cd libvirt-0.8.5<br />
patch -p1 -i ../libvirt-0.8.5-biosfile.patch <br />
./configure --without-xen --prefix=/usr && make && make install<br />
service libvirt-bin start<br />
<br />
</ul><br />
--><br />
<li>Download old qemu bios from 0.10.6 version and copy it to /usr/share/qemu directory:</li><br />
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.10.6/qemu-kvm-0.10.6.tar.gz<br />
tar xfvz qemu-kvm-0.10.6.tar.gz<br />
cp qemu-kvm-0.10.6/pc-bios/bios.bin /usr/share/qemu-kvm/bios-0.10.6.bin<br />
<br />
<!-- Not needed, it seems to work without downloading this drivers<br />
<li>Download i82559 ROM from the latest qemu versions (Ubuntu 10.04 does not include that ROM in qemu-kvm package):</li><br />
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.12.5/qemu-kvm-0.12.5.tar.gz<br />
tar xfvz qemu-kvm-0.12.5.tar.gz<br />
cp qemu-kvm-0.12.5/pc-bios/pxe-i82559er.bin /usr/share/qemu-kvm/<br />
--><br />
</ul><br />
<br />
<br />
== Installation over Fedora 11 (Draft) ==<br />
<br />
Follow this steps to install VNX over Fedora 11:<br />
<ul><br />
<br />
<li>Install packages:</li><br />
yum -y groupinstall "Development Tools"<br />
yum install qemu-kvm libvirt virt-manager virt-viewer perl-XML-LibXML<br />
yum install perl-XML-DOM perl-NetAddr-IP perl-Readonly perl-TermReadKey<br />
yum install perl-Net-Pcap perl-Net-IPv6Addr perl-Net-Telnet perl-Error<br />
yum install perl-Exception-Class perl-ExtUtils-MakeMaker tunctl screen wget<br />
yum install libxml2-devel gnutls-devel device-mapper-devel uml_utilities <br />
yum install roxterm xterm graphviz perl-AppConfig<br />
<br />
<li>Install libvirt 0.8.5:</li><br />
/etc/init.d/libvirtd stop<br />
wget http://libvirt.org/sources/libvirt-0.8.5.tar.gz<br />
tar xfvz libvirt-0.8.5.tar.gz<br />
cd libvirt-0.8.5<br />
./configure --without-xen --prefix=/usr && make && make install<br />
/etc/init.d/libvirtd start<br />
<br />
<li>Install SysVirt manually:</li><br />
wget http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.2.4.tar.gz<br />
tar xfvz Sys-Virt-0.2.4.tar.gz<br />
cd Sys-Virt-0.2.4<br />
perl Makefile.PL<br />
make install<br />
<!--<br />
<li> Instalar VNUML sobre Fedora 11 siguiendo la receta en http://www.dit.upm.es/vnumlwiki/index.php/Fedora11</li><br />
<br />
<li> Instalar paquetes y librerías necesarias:</li><br />
yum install qemu-kvm libvirt virt-manager virt-viewer perl-XML-LibXML perl-Sys-Virt<br />
yum -y install bridge-utils readline-devel perl-Module-Build screen expat-devel libpcap-devel <br />
yum -y install perl-Net-Pcap perl-NetAddr-IP perl-Net-IPv6Addr perl-XML-DOM perl-Exception-Class<br />
yum -y install perl-TermReadKey perl-Error perl-CPAN uml_utilities xterm tunctl<br />
<br />
<li>Install XML::Checker perl library:</li><br />
perl -MCPAN -e shell<br />
install XML::Checker<br />
--><br />
<li>Add symbolic link for kvm:</li><br />
ln -s /usr/bin/qemu-kvm /usr/bin/kvm<br />
<br />
<li>Instalar VNX:</li><br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-latest.tgz<br />
tar xfvz vnx-latest.tgz<br />
cd vnx-*<br />
./install-vnx<br />
<br />
<li>Create the VNX config file (/etc/vnx.conf). You just can move the sample config file:</li><br />
mv /etc/vnx.conf.samble /etc/vnx.conf<br />
<br />
<li>Deshabilitar el firewall o, alternativamente, configurar los interfaces tipo "tun" como confiables (Sistema->Firewall->Interfaces Confiables").</li><br />
</ul><br />
<br />
=== Additional install steps for Dynamips support ===<br />
<br />
* Install Dynamips and Dynagen:<br />
wget http://downloads.sourceforge.net/project/dyna-gen/dynamips%20Linux%20RPM/0.2.8-RC2/dynamips-0.2.8RC2-1.i386.rpm<br />
rpm -i dynamips-0.2.8RC2-1.i386.rpm<br />
wget http://downloads.sourceforge.net/project/dyna-gen/dynagen%20source%20_%20Linux/dynagen%200.11.0/dynagen-0.11.0-1.fc9.noarch.rpm<br />
rpm -i dynagen-0.11.0-1.fc9.noarch.rpm<br />
<br />
* Set execution permissions for the script and add it to system start-up:<br />
chkconfig --add dynamips<br />
/etc/init.d/dynamips start<br />
<br />
* Download and install cisco IOS image:<br />
cd /usr/share/vnx/filesystems<br />
# Cisco image<br />
wget ... c3640-js-mz.124-19.image<br />
ln -s c3640-js-mz.124-19.image c3640<br />
<br />
* Calculate the idle-pc value for your computer following the procedure in http://dynagen.org/tutorial.htm:<br />
dynagen /usr/share/vnx/examples/R.net<br />
console R # type 'no' to exit the config wizard and wait <br />
# for the router to completely start <br />
idle-pc get R<br />
Once you know the idle-pc value for your system, include it in /etc/vnx.conf file.<br />
<br />
=== Additional install steps for Olive support ===<br />
<br />
Several additional steps are needed to support Olive (Juniper) routers in VNX scenarios:<br />
<br />
<ul><br />
<br />
<li>Download old qemu bios from 0.10.6 version and copy it to /usr/share/qemu directory:</li><br />
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.10.6/qemu-kvm-0.10.6.tar.gz<br />
tar xfvz qemu-kvm-0.10.6.tar.gz<br />
cp qemu-kvm-0.10.6/pc-bios/bios.bin /usr/share/qemu/bios-0.10.6.bin<br />
<br />
</ul><br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<!-- COSAS ANTIGUAS --><br />
<br />
<!--li>Modificar vnumlparser.pl, sustituyendo en la función mode_t la línea en ):</li><br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
<br />
por:<br />
<br />
if (! -e "/dev/net/tun") {<br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
}<br />
<br />
Explicación: el módulo tun se ha integrado en el kernel a partir de la 10.04, por lo que no es necesario cargarlo como hasta ahora mediante "modprobe tun". El cambio anterior simplemente comprueba si existe el dispositivo /dev/net/tun y carga el modulo en caso de que no exista.<br />
--><br />
<br />
<br />
<!--li>Modificar vnumlparser.pl, sustituyendo en la función mode_t la línea en ):</li><br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
<br />
por:<br />
<br />
if (! -e "/dev/net/tun") {<br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
}<br />
<br />
Explicación: el módulo tun se ha integrado en el kernel a partir de la 10.04, por lo que no es necesario cargarlo como hasta ahora mediante "modprobe tun". El cambio anterior simplemente comprueba si existe el dispositivo /dev/net/tun y carga el modulo en caso de que no exista.<br />
--><br />
<br />
<!--<br />
Pasos a seguir para instalar VNX sobre Ubuntu 9.10. <br />
<br />
'''Nota importante''': se han detectado importantes problemas de prestaciones cuando se utiliza el sistema de ficheros ext4 con Ubuntu 9.10. Por ello, y hasta que se localice el origen de dichas ineficiencias, se recomienda utilizar ext3. <br />
<ul><br />
<br />
<li> Instalar Ubuntu 9.10 y actualizar con:</li><br />
apt-get update; apt-get dist-upgrade<br />
--><br />
<!--<br />
<li>Añadir repositorios VNUML a /etc/apt/sources.lst:</li><br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian binary/" >> /etc/apt/sources.list<br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian-testing binary/" >> /etc/apt/sources.list<br />
--><br />
<!--<br />
<li>Install paquetes básicos de desarrollo, paquetes de virtualización (qemu-kvm, libvirt, vnuml) y librerías y paquetes auxiliares</li><br />
apt-get update<br />
apt-get install build-essential qemu-kvm libvirt-bin libvirt-dev \<br />
virt-manager virt-viewer vlan xterm bridge-utils screen uml-utilities \<br />
libxml-checker-perl libxml-parser-perl libnetaddr-ip-perl libnet-pcap-perl \<br />
libnet-ipv6addr-perl liberror-perl libexception-class-perl libxml-libxml-perl \<br />
libxml2-dev libgnutls-dev libdevmapper-dev libterm-readline-perl-perl <br />
<br />
<br />
<br />
curl vnuml linux-um <br />
<br />
<li>Si se usa la versión de Ubuntu de 64 bits hay que instalar las librerías de compatibilidad de 32 bits:</li><br />
apt-get install ia32-libs<br />
<br />
<li>Install qemu-kvm version 0.12.4 (version 0.11 which comes as apackage in 9.10 provokes hanging problems in Windows virtual machines when executing commands -something relates apparently with mounting cdroms in vms-):</li><br />
wget http://sourceforge.net/projects/kvm/files/qemu-kvm/0.11.1/qemu-kvm-0.11.1.tar.gz/download<br />
tar xfvz qemu-kvm-0.11.1.tar.gz<br />
cd qemu-kvm-0.11.1<br />
./configure --prefix=/usr && make && make install<br />
ln -s /usr/bin/qemu-system-x86_64 /usr/bin/kvm<br />
Editar /etc/modules y añadir:<br />
kvm <br />
kvm_intel<br />
<br />
wget http://sourceforge.net/projects/kvm/files/kvm-kmod/2.6.31.6b/kvm-kmod-2.6.31.6b.tar.bz2/download<br />
<br />
<li>Instalar libvirt 0.8.0:</li><br />
/etc/init.d/libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.8.0.tar.gz<br />
tar xfvz libvirt-0.8.0.tar.gz<br />
cd libvirt-0.8.0<br />
./configure --prefix=/usr && make && make install<br />
/etc/init.d/libvirt-bin start<br />
<br />
<li> Instalar la librería perl de acceso a libvirt (Sys::Virt) desde CPAN (dicha librería no esta disponible como paquete para Ubuntu 9.10):</li><br />
--><br />
<!-- wget http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.2.2.tar.gz<br />
tar xfvz Sys-Virt-0.2.2.tar.gz <br />
cd Sys-Virt-0.2.2<br />
perl Makefile.PL<br />
make install<br />
--><br />
<!--<br />
perl -MCPAN -e "CPAN::Shell->force(qw(install Sys::Virt));"<br />
Nota: constestar YES a la pregunta "Would you like me to configure as much as posible automatically?" y a "Is it OK to try to connect to the Internet?" <br />
<br />
<li>Instalar rootfilesystem de VNUML, enlaces del kernel y crear clave rsa:</li><br />
cd /usr/share/vnuml/filesystems<br />
wget http://www.dit.upm.es/vnuml/download/scripts/root-fs-installer<br />
perl root-fs-installer<br />
cd ../kernels<br />
ln -s linux-2.6.28.10-1m linux<br />
ssh-keygen -t rsa1<br />
<br />
<li>Instalar VNX:</li><br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-0.12b.tgz<br />
tar xfvz vnx-0.12b.tgz<br />
cd vnx-0.12b<br />
./install-vnx<br />
</ul><br />
<br />
Notas:<br />
http://www.ubuntu-es.org/node/128867<br />
175 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-headers-2.6.32-02063209_2.6.32-02063209_all.deb<br />
176 http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-image-2.6.32-02063209-generic_2.6.32-02063209_amd64.deb<br />
177 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-image-2.6.32-02063209-generic_2.6.32-02063209_amd64.deb<br />
178 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-headers-2.6.32-02063209-generic_2.6.32-02063209_amd64.deb<br />
--><br />
<br />
<!--<br />
=== Sobre Ubuntu 8.04 ===<br />
<br />
Pasos a seguir para instalar VNX sobre Ubuntu 8.04:<br />
<ul><br />
<br />
<li> Instalar Ubuntu 8.04 y actualizar con:</li><br />
apt-get update; apt-get dist-upgrade<br />
Rearrancar la máquina en caso de que se actualice la versión del kernel.<br />
<br />
<li> Añadir repositorio VNUML a /etc/apt/sources.lst:</li><br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian binary/" >> /etc/apt/sources.list<br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian-testing binary/" >> /etc/apt/sources.list<br />
<br />
<li> Instalar paquetes:</li><br />
apt-get update <br />
apt-get install virt-manager virt-viewer build-essential \<br />
libxml-libxml-perl vncviewer vlan xterm bridge-utils screen \<br />
curl vnuml linux-um libterm-readline-perl-perl zlib-bin zlib1g-dev \<br />
libxen3-dev libxml2-dev libgnutls-dev libsasl2-dev libsdl1.2-dev \<br />
libdevmapper-dev dnsmasq xbase-clients pkg-config<br />
<br />
<li>Si se usa la versión de Ubuntu de 64 bits hay que instalar las librerías de compatibilidad de 32 bits:</li><br />
apt-get install ia32-libs<br />
<br />
<li>Instalar qemu-kvm version 0.11.1 (la version 0.12.2 da errores):</li><br />
wget http://sourceforge.net/projects/kvm/files/qemu-kvm/0.11.1/qemu-kvm-0.11.1.tar.gz/download<br />
tar xfvz qemu-kvm-0.11.1.tar.gz<br />
cd qemu-kvm-0.11.1<br />
./configure --prefix=/usr && make && make install<br />
ln -s /usr/bin/qemu-system-x86_64 /usr/bin/kvm<br />
Editar /etc/modules y añadir:<br />
kvm <br />
kvm_intel<br />
<br />
<li>Instalar libvirt 0.7.6:</li><br />
apt-get install libvirt-bin<br />
/etc/init.d/libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.7.6.tar.gz<br />
tar xfvz libvirt-0.7.6.tar.gz<br />
cd libvirt-0.7.6<br />
./configure --prefix=/usr --without-storage-disk && make && make install<br />
/etc/init.d/libvirt-bin start<br />
<br />
<li>Instalar librería perl de acceso a libvirt (Sys::Virt) mediante CPAN (no está disponible como paquete ubuntu)</li><br />
perl -MCPAN -e "CPAN::Shell->force(qw(install Sys::Virt));"<br />
Note: answer NO to the question "Are you ready for manual configuration?"<br />
<br />
<li>Instalar rootfilesystem de VNUML, enlaces del kernel y crear clave rsa:</li><br />
cd /usr/share/vnuml/filesystems<br />
wget http://www.dit.upm.es/vnuml/download/scripts/root-fs-installer<br />
perl root-fs-installer<br />
cd ../kernels<br />
ln -s linux-2.6.28.10-1m linux<br />
ssh-keygen -t rsa1<br />
<br />
<li>Instalar VNX:</li><br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-0.12b.tgz<br />
tar xfvz vnx-0.12b.tgz<br />
cd vnx-0.12b<br />
./install-vnx<br />
</ul><br />
--></div>Davidhttps://web.dit.upm.es/vnumlwiki/index.php?title=Vnx-install&diff=4107Vnx-install2011-02-24T13:25:46Z<p>David: /* Additional install steps for Dynamips support */</p>
<hr />
<div>{{Title|VNX (Virtual Networks over X virtualization) v0.14 beta}}<br />
<br />
== Installation over Ubuntu 10.04/9.10 ==<br />
<br />
This section describes the procedure for installing VNX over Ubuntu 10.04 or 9.10. Open a root shell window and follow these steps:<br />
<ul><br />
<br />
<li>Install all packages required (basic development, virtualization, perl libraries and auxiliar packages):</li><br />
apt-get update<br />
apt-get install build-essential qemu-kvm libvirt-bin vlan xterm \<br />
bridge-utils screen virt-manager virt-viewer libxml-checker-perl \<br />
libxml-parser-perl libnetaddr-ip-perl libnet-pcap-perl \<br />
libnet-ipv6addr-perl liberror-perl libexception-class-perl \<br />
uml-utilities libxml-libxml-perl libxml2-dev libgnutls-dev \<br />
libdevmapper-dev libterm-readline-perl-perl libnet-telnet-perl \<br />
libnet-ip-perl libreadonly-perl libmath-round-perl libappconfig-perl \<br />
libdbi-perl graphviz libnl-dev genisoimage gnome-terminal<br />
<br />
<!--Note: for Ubuntu 9.04 change "qemu-kvm" package by "qemu kvm" --><br />
<li>If you use 64 bits version of Ubuntu, install 32 bits compatibility libraries:</li><br />
apt-get install ia32-libs<br />
<br />
<li>Install libvirt 0.8.5:</li><br />
/etc/init.d/libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.8.5.tar.gz<br />
tar xfvz libvirt-0.8.5.tar.gz<br />
cd libvirt-0.8.5<br />
./configure --without-xen --prefix=/usr && make && make install<br />
/etc/init.d/libvirt-bin start<br />
<br />
'''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.<br />
<br />
<li>Install Sys::Virt perl module:</li><br />
<ul><br />
<li>For Ubuntu 10.04, just install the libsys-virt-perl package</li><br />
apt-get install libsys-virt-perl<br />
<!--<br />
'''IMPORTANT NOTE''': Windows XP virtual machines started with VNX over Ubuntu 9.10 frequently hang when executing commands or with high traffic loads. The problem could be related with virtual network drivers. We are investigating the problem to find a solution. By now, Ubuntu 10.04 is the recomended platform to test VNX.<br />
--><br />
<li>For Ubuntu 9.10, as Sys::Virt library is not available as a package, install it manually:</li><br />
wget http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.2.3.tar.gz<br />
tar xfvz Sys-Virt-0.2.3.tar.gz <br />
cd Sys-Virt-0.2.3<br />
perl Makefile.PL<br />
make install<br />
</ul><br />
<br />
<li>Install VNX:</li><br />
mkdir /tmp/vnx-update<br />
cd /tmp/vnx-update<br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-latest.tgz<br />
tar xfvz vnx-latest.tgz<br />
cd vnx-*<br />
./install_vnx<br />
<br />
<li>Create the VNX config file (/etc/vnx.conf). You just can move the sample config file:</li><br />
mv /etc/vnx.conf.samble /etc/vnx.conf<br />
<br />
<li>Download root file systems from http://idefix.dit.upm.es/download/vnx/filesystems and copy them to /usr/share/vnx/filesystems directory:</li><br />
cd /usr/share/vnx/filesystems<br />
<br />
# ubuntu server<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.10-v01.qcow2.bz2<br />
bunzip2 root_fs_ubuntu-10.10-v01.qcow2.bz2<br />
ln -s root_fs_ubuntu-10.10-v01.qcow2 root_fs_ubuntu<br />
<br />
# ubuntu with gui<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.04-gui-v01.qcow2.bz2<br />
bunzip2 root_fs_ubuntu-10.04-gui-v01.qcow2.bz2<br />
ln -s root_fs_ubuntu-10.04-gui-v01.qcow2 root_fs_ubuntu-gui<br />
<br />
# freebsd server<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-v01.qcow2.bz2<br />
bunzip2 root_fs_freebsd-v01.qcow2.bz2<br />
ln -s root_fs_freebsd-v01.qcow2 root_fs_freebsd<br />
<br />
# freebsd gui<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-gui-v01.qcow2.bz2<br />
bunzip2 root_fs_freebsd-gui-v01.qcow2.bz2<br />
ln -s root_fs_freebsd-gui-v01.qcow2 root_fs_freebsd-gui<br />
<br />
# winxp and win7<br />
# Sorry! Unfortunately for legal reasons we cannot distribute windows XP<br />
# or Windows 7 root filesystems. See VNX documentation for detailed recipes<br />
# to create these root fylesystems from scratch<br />
<br />
<li>Additionally, if you plan to use VNUML root filesystem:</li><br />
# VNUML root_fs_tutorial and kernel<br />
cd /usr/share/vnx/filesystem<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_tutorial-0.6.0.bz2<br />
bunzip2 root_fs_tutorial-0.6.0.bz2<br />
ln -s root_fs_tutorial-0.6.0 root_fs_tutorial<br />
cd /usr/share/vnx/kernels<br />
wget -N http://jungla.dit.upm.es/~vnx/download/kernels/linux-2.6.18.1-bb2-xt-4m<br />
chmod +x linux-2.6.18.1-bb2-xt-4m<br />
ln -s linux-2.6.18.1-bb2-xt-4m linux<br />
<br />
</ul><br />
<br />
'''NOTE for Ubuntu 10.04.1''': It seems that an additional package has to be installed:<br />
apt-get install kvm-pxe<br />
<br />
=== Additional install steps for Dynamips support ===<br />
<br />
* Install Dynamips and Dynagen:<br />
apt-get install dynamips dynagen<br />
<br />
* Create a file /etc/init.d/dynamips (taken from http://7200emu.hacki.at/viewtopic.php?t=2198):<br />
<pre><br />
#!/bin/sh<br />
# Start/stop the dynamips program as a daemon.<br />
#<br />
### BEGIN INIT INFO<br />
# Provides: dynamips<br />
# Default-Start: 2 3 4 5<br />
# Default-Stop: 0 1 6<br />
# Short-Description: Cisco hardware emulator daemon<br />
### END INIT INFO<br />
<br />
DAEMON=/usr/bin/dynamips<br />
NAME=dynamips<br />
PORT=7200<br />
PIDFILE=/var/run/$NAME.pid <br />
LOGFILE=/var/log/$NAME.log<br />
DESC="Cisco Emulator"<br />
SCRIPTNAME=/etc/init.d/$NAME<br />
<br />
test -f $DAEMON || exit 0<br />
<br />
. /lib/lsb/init-functions<br />
<br />
<br />
case "$1" in<br />
start) log_daemon_msg "Starting $DESC " "$NAME"<br />
start-stop-daemon --start --chdir /tmp --background --make-pidfile --pidfile $PIDFILE --name $NAME --startas $DAEMON -- -H $PORT -l $LOGFILE<br />
log_end_msg $?<br />
;;<br />
stop) log_daemon_msg "Stopping $DESC " "$NAME"<br />
start-stop-daemon --stop --quiet --pidfile $PIDFILE --name $NAME<br />
log_end_msg $?<br />
;;<br />
restart) log_daemon_msg "Restarting $DESC " "$NAME"<br />
start-stop-daemon --stop --retry 5 --quiet --pidfile $PIDFILE --name $NAME<br />
start-stop-daemon --start --chdir /tmp --background --make-pidfile --pidfile $PIDFILE --name $NAME --startas $DAEMON -- -H $PORT -l $LOGFILE<br />
log_end_msg $?<br />
;;<br />
status)<br />
status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $? <br />
#status $NAME<br />
#RETVAL=$?<br />
;; <br />
*) log_action_msg "Usage: $SCRIPTNAME {start|stop|restart|status}"<br />
exit 2<br />
;;<br />
esac<br />
exit 0<br />
<br />
</pre><br />
<br />
* Set execution permissions for the script and add it to system start-up:<br />
chmod +x /etc/init.d/dynamips<br />
update-rc.d dynamips defaults<br />
/etc/init.d/dynamips start<br />
<br />
* Calculate the idle-pc value for your computer following the procedure in http://dynagen.org/tutorial.htm:<br />
dynagen /usr/share/vnx/examples/R.net<br />
console R # type 'no' to exit the config wizard and wait <br />
# for the router to completely start <br />
idle-pc get R<br />
Once you know the idle-pc value for your system, include it in /etc/vnx.conf file.<br />
<br />
* Download and install cisco IOS image:<br />
cd /usr/share/vnx/filesystems<br />
# Cisco image<br />
wget ... c3640-js-mz.124-19.image<br />
ln -s c3640-js-mz.124-19.image c3640<br />
<br />
=== Additional install steps for Olive support ===<br />
<br />
Several additional steps are needed to support Olive (Juniper) routers in VNX scenarios:<br />
<br />
<ul><br />
<br />
<!-- Ya no hace falta desde que se usa <qemu:commandline><br />
<br />
<li>Install a patched version of libvirt 0.8.5 with support to define the bios used by a virtual machine:</li><br />
<br />
<ul><br />
<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><br />
<pre><br />
diff -crB libvirt-0.8.5.orig/src/conf/domain_conf.c libvirt-0.8.5/src/conf/domain_conf.c<br />
*** libvirt-0.8.5.orig/src/conf/domain_conf.c 2010-11-22 11:38:08.000000000 +0100<br />
--- libvirt-0.8.5/src/conf/domain_conf.c 2010-11-22 11:47:41.000000000 +0100<br />
***************<br />
*** 4267,4272 ****<br />
--- 4267,4274 ----<br />
if (node)<br />
def->mem.hugepage_backed = 1;<br />
<br />
+ def->biosfile = virXPathString("string(./biosfile[1])", ctxt);<br />
+ <br />
/* Extract other memory tunables */<br />
if (virXPathULong("string(./memtune/hard_limit)", ctxt,<br />
&def->mem.hard_limit) < 0)<br />
diff -crB libvirt-0.8.5.orig/src/conf/domain_conf.h libvirt-0.8.5/src/conf/domain_conf.h<br />
*** libvirt-0.8.5.orig/src/conf/domain_conf.h 2010-11-22 11:38:08.000000000 +0100<br />
--- libvirt-0.8.5/src/conf/domain_conf.h 2010-11-22 11:40:18.000000000 +0100<br />
***************<br />
*** 885,890 ****<br />
--- 885,891 ----<br />
unsigned long min_guarantee;<br />
unsigned long swap_hard_limit;<br />
} mem;<br />
+ char *biosfile;<br />
unsigned short vcpus;<br />
unsigned short maxvcpus;<br />
int cpumasklen;<br />
diff -crB libvirt-0.8.5.orig/src/qemu/qemu_conf.c libvirt-0.8.5/src/qemu/qemu_conf.c<br />
*** libvirt-0.8.5.orig/src/qemu/qemu_conf.c 2010-11-22 11:38:08.000000000 +0100<br />
--- libvirt-0.8.5/src/qemu/qemu_conf.c 2010-11-22 11:41:05.000000000 +0100<br />
***************<br />
*** 3984,3989 ****<br />
--- 3984,3995 ----<br />
ADD_ARG_LIT(emulator);<br />
ADD_ARG_LIT("-S");<br />
<br />
+ if(def->biosfile)<br />
+ {<br />
+ ADD_ARG_LIT("-bios");<br />
+ ADD_ARG_LIT(def->biosfile);<br />
+ }<br />
+ <br />
/* This should *never* be NULL, since we always provide<br />
* a machine in the capabilities data for QEMU. So this<br />
* check is just here as a safety in case the unexpected<br />
</pre><br />
<br />
<li>Install libvirt 0.8.5 with that patch applied:</li><br />
service libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.8.5.tar.gz<br />
tar xfvz libvirt-0.8.5.tar.gz <br />
cd libvirt-0.8.5<br />
patch -p1 -i ../libvirt-0.8.5-biosfile.patch <br />
./configure --without-xen --prefix=/usr && make && make install<br />
service libvirt-bin start<br />
<br />
</ul><br />
--><br />
<li>Download old qemu bios from 0.10.6 version and copy it to /usr/share/qemu directory:</li><br />
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.10.6/qemu-kvm-0.10.6.tar.gz<br />
tar xfvz qemu-kvm-0.10.6.tar.gz<br />
cp qemu-kvm-0.10.6/pc-bios/bios.bin /usr/share/qemu-kvm/bios-0.10.6.bin<br />
<br />
<!-- Not needed, it seems to work without downloading this drivers<br />
<li>Download i82559 ROM from the latest qemu versions (Ubuntu 10.04 does not include that ROM in qemu-kvm package):</li><br />
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.12.5/qemu-kvm-0.12.5.tar.gz<br />
tar xfvz qemu-kvm-0.12.5.tar.gz<br />
cp qemu-kvm-0.12.5/pc-bios/pxe-i82559er.bin /usr/share/qemu-kvm/<br />
--><br />
</ul><br />
<br />
<br />
== Installation over Fedora 11 (Draft) ==<br />
<br />
Follow this steps to install VNX over Fedora 11:<br />
<ul><br />
<br />
<li>Install packages:</li><br />
yum -y groupinstall "Development Tools"<br />
yum install qemu-kvm libvirt virt-manager virt-viewer perl-XML-LibXML<br />
yum install perl-XML-DOM perl-NetAddr-IP perl-Readonly perl-TermReadKey<br />
yum install perl-Net-Pcap perl-Net-IPv6Addr perl-Net-Telnet perl-Error<br />
yum install perl-Exception-Class perl-ExtUtils-MakeMaker tunctl screen wget<br />
yum install libxml2-devel gnutls-devel device-mapper-devel uml_utilities <br />
yum install roxterm xterm graphviz perl-AppConfig<br />
<br />
<li>Install libvirt 0.8.5:</li><br />
/etc/init.d/libvirtd stop<br />
wget http://libvirt.org/sources/libvirt-0.8.5.tar.gz<br />
tar xfvz libvirt-0.8.5.tar.gz<br />
cd libvirt-0.8.5<br />
./configure --without-xen --prefix=/usr && make && make install<br />
/etc/init.d/libvirtd start<br />
<br />
<li>Install SysVirt manually:</li><br />
wget http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.2.4.tar.gz<br />
tar xfvz Sys-Virt-0.2.4.tar.gz<br />
cd Sys-Virt-0.2.4<br />
perl Makefile.PL<br />
make install<br />
<!--<br />
<li> Instalar VNUML sobre Fedora 11 siguiendo la receta en http://www.dit.upm.es/vnumlwiki/index.php/Fedora11</li><br />
<br />
<li> Instalar paquetes y librerías necesarias:</li><br />
yum install qemu-kvm libvirt virt-manager virt-viewer perl-XML-LibXML perl-Sys-Virt<br />
yum -y install bridge-utils readline-devel perl-Module-Build screen expat-devel libpcap-devel <br />
yum -y install perl-Net-Pcap perl-NetAddr-IP perl-Net-IPv6Addr perl-XML-DOM perl-Exception-Class<br />
yum -y install perl-TermReadKey perl-Error perl-CPAN uml_utilities xterm tunctl<br />
<br />
<li>Install XML::Checker perl library:</li><br />
perl -MCPAN -e shell<br />
install XML::Checker<br />
--><br />
<li>Add symbolic link for kvm:</li><br />
ln -s /usr/bin/qemu-kvm /usr/bin/kvm<br />
<br />
<li>Instalar VNX:</li><br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-latest.tgz<br />
tar xfvz vnx-latest.tgz<br />
cd vnx-*<br />
./install-vnx<br />
<br />
<li>Create the VNX config file (/etc/vnx.conf). You just can move the sample config file:</li><br />
mv /etc/vnx.conf.samble /etc/vnx.conf<br />
<br />
<li>Deshabilitar el firewall o, alternativamente, configurar los interfaces tipo "tun" como confiables (Sistema->Firewall->Interfaces Confiables").</li><br />
</ul><br />
<br />
=== Additional install steps for Dynamips support ===<br />
<br />
* Install Dynamips and Dynagen:<br />
wget http://downloads.sourceforge.net/project/dyna-gen/dynamips%20Linux%20RPM/0.2.8-RC2/dynamips-0.2.8RC2-1.i386.rpm<br />
rpm -i dynamips-0.2.8RC2-1.i386.rpm<br />
wget http://downloads.sourceforge.net/project/dyna-gen/dynagen%20source%20_%20Linux/dynagen%200.11.0/dynagen-0.11.0-1.fc9.noarch.rpm<br />
rpm -i dynagen-0.11.0-1.fc9.noarch.rpm<br />
<br />
* Set execution permissions for the script and add it to system start-up:<br />
chkconfig --add dynamips<br />
<br />
* Calculate the idle-pc value for your computer following the procedure in http://dynagen.org/tutorial.htm:<br />
/etc/init.d/dynamips start<br />
dynagen /usr/share/vnx/examples/R.net<br />
<br />
=== Additional install steps for Olive support ===<br />
<br />
Several additional steps are needed to support Olive (Juniper) routers in VNX scenarios:<br />
<br />
<ul><br />
<br />
<li>Download old qemu bios from 0.10.6 version and copy it to /usr/share/qemu directory:</li><br />
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.10.6/qemu-kvm-0.10.6.tar.gz<br />
tar xfvz qemu-kvm-0.10.6.tar.gz<br />
cp qemu-kvm-0.10.6/pc-bios/bios.bin /usr/share/qemu/bios-0.10.6.bin<br />
<br />
</ul><br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<!-- COSAS ANTIGUAS --><br />
<br />
<!--li>Modificar vnumlparser.pl, sustituyendo en la función mode_t la línea en ):</li><br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
<br />
por:<br />
<br />
if (! -e "/dev/net/tun") {<br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
}<br />
<br />
Explicación: el módulo tun se ha integrado en el kernel a partir de la 10.04, por lo que no es necesario cargarlo como hasta ahora mediante "modprobe tun". El cambio anterior simplemente comprueba si existe el dispositivo /dev/net/tun y carga el modulo en caso de que no exista.<br />
--><br />
<br />
<br />
<!--li>Modificar vnumlparser.pl, sustituyendo en la función mode_t la línea en ):</li><br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
<br />
por:<br />
<br />
if (! -e "/dev/net/tun") {<br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
}<br />
<br />
Explicación: el módulo tun se ha integrado en el kernel a partir de la 10.04, por lo que no es necesario cargarlo como hasta ahora mediante "modprobe tun". El cambio anterior simplemente comprueba si existe el dispositivo /dev/net/tun y carga el modulo en caso de que no exista.<br />
--><br />
<br />
<!--<br />
Pasos a seguir para instalar VNX sobre Ubuntu 9.10. <br />
<br />
'''Nota importante''': se han detectado importantes problemas de prestaciones cuando se utiliza el sistema de ficheros ext4 con Ubuntu 9.10. Por ello, y hasta que se localice el origen de dichas ineficiencias, se recomienda utilizar ext3. <br />
<ul><br />
<br />
<li> Instalar Ubuntu 9.10 y actualizar con:</li><br />
apt-get update; apt-get dist-upgrade<br />
--><br />
<!--<br />
<li>Añadir repositorios VNUML a /etc/apt/sources.lst:</li><br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian binary/" >> /etc/apt/sources.list<br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian-testing binary/" >> /etc/apt/sources.list<br />
--><br />
<!--<br />
<li>Install paquetes básicos de desarrollo, paquetes de virtualización (qemu-kvm, libvirt, vnuml) y librerías y paquetes auxiliares</li><br />
apt-get update<br />
apt-get install build-essential qemu-kvm libvirt-bin libvirt-dev \<br />
virt-manager virt-viewer vlan xterm bridge-utils screen uml-utilities \<br />
libxml-checker-perl libxml-parser-perl libnetaddr-ip-perl libnet-pcap-perl \<br />
libnet-ipv6addr-perl liberror-perl libexception-class-perl libxml-libxml-perl \<br />
libxml2-dev libgnutls-dev libdevmapper-dev libterm-readline-perl-perl <br />
<br />
<br />
<br />
curl vnuml linux-um <br />
<br />
<li>Si se usa la versión de Ubuntu de 64 bits hay que instalar las librerías de compatibilidad de 32 bits:</li><br />
apt-get install ia32-libs<br />
<br />
<li>Install qemu-kvm version 0.12.4 (version 0.11 which comes as apackage in 9.10 provokes hanging problems in Windows virtual machines when executing commands -something relates apparently with mounting cdroms in vms-):</li><br />
wget http://sourceforge.net/projects/kvm/files/qemu-kvm/0.11.1/qemu-kvm-0.11.1.tar.gz/download<br />
tar xfvz qemu-kvm-0.11.1.tar.gz<br />
cd qemu-kvm-0.11.1<br />
./configure --prefix=/usr && make && make install<br />
ln -s /usr/bin/qemu-system-x86_64 /usr/bin/kvm<br />
Editar /etc/modules y añadir:<br />
kvm <br />
kvm_intel<br />
<br />
wget http://sourceforge.net/projects/kvm/files/kvm-kmod/2.6.31.6b/kvm-kmod-2.6.31.6b.tar.bz2/download<br />
<br />
<li>Instalar libvirt 0.8.0:</li><br />
/etc/init.d/libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.8.0.tar.gz<br />
tar xfvz libvirt-0.8.0.tar.gz<br />
cd libvirt-0.8.0<br />
./configure --prefix=/usr && make && make install<br />
/etc/init.d/libvirt-bin start<br />
<br />
<li> Instalar la librería perl de acceso a libvirt (Sys::Virt) desde CPAN (dicha librería no esta disponible como paquete para Ubuntu 9.10):</li><br />
--><br />
<!-- wget http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.2.2.tar.gz<br />
tar xfvz Sys-Virt-0.2.2.tar.gz <br />
cd Sys-Virt-0.2.2<br />
perl Makefile.PL<br />
make install<br />
--><br />
<!--<br />
perl -MCPAN -e "CPAN::Shell->force(qw(install Sys::Virt));"<br />
Nota: constestar YES a la pregunta "Would you like me to configure as much as posible automatically?" y a "Is it OK to try to connect to the Internet?" <br />
<br />
<li>Instalar rootfilesystem de VNUML, enlaces del kernel y crear clave rsa:</li><br />
cd /usr/share/vnuml/filesystems<br />
wget http://www.dit.upm.es/vnuml/download/scripts/root-fs-installer<br />
perl root-fs-installer<br />
cd ../kernels<br />
ln -s linux-2.6.28.10-1m linux<br />
ssh-keygen -t rsa1<br />
<br />
<li>Instalar VNX:</li><br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-0.12b.tgz<br />
tar xfvz vnx-0.12b.tgz<br />
cd vnx-0.12b<br />
./install-vnx<br />
</ul><br />
<br />
Notas:<br />
http://www.ubuntu-es.org/node/128867<br />
175 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-headers-2.6.32-02063209_2.6.32-02063209_all.deb<br />
176 http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-image-2.6.32-02063209-generic_2.6.32-02063209_amd64.deb<br />
177 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-image-2.6.32-02063209-generic_2.6.32-02063209_amd64.deb<br />
178 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-headers-2.6.32-02063209-generic_2.6.32-02063209_amd64.deb<br />
--><br />
<br />
<!--<br />
=== Sobre Ubuntu 8.04 ===<br />
<br />
Pasos a seguir para instalar VNX sobre Ubuntu 8.04:<br />
<ul><br />
<br />
<li> Instalar Ubuntu 8.04 y actualizar con:</li><br />
apt-get update; apt-get dist-upgrade<br />
Rearrancar la máquina en caso de que se actualice la versión del kernel.<br />
<br />
<li> Añadir repositorio VNUML a /etc/apt/sources.lst:</li><br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian binary/" >> /etc/apt/sources.list<br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian-testing binary/" >> /etc/apt/sources.list<br />
<br />
<li> Instalar paquetes:</li><br />
apt-get update <br />
apt-get install virt-manager virt-viewer build-essential \<br />
libxml-libxml-perl vncviewer vlan xterm bridge-utils screen \<br />
curl vnuml linux-um libterm-readline-perl-perl zlib-bin zlib1g-dev \<br />
libxen3-dev libxml2-dev libgnutls-dev libsasl2-dev libsdl1.2-dev \<br />
libdevmapper-dev dnsmasq xbase-clients pkg-config<br />
<br />
<li>Si se usa la versión de Ubuntu de 64 bits hay que instalar las librerías de compatibilidad de 32 bits:</li><br />
apt-get install ia32-libs<br />
<br />
<li>Instalar qemu-kvm version 0.11.1 (la version 0.12.2 da errores):</li><br />
wget http://sourceforge.net/projects/kvm/files/qemu-kvm/0.11.1/qemu-kvm-0.11.1.tar.gz/download<br />
tar xfvz qemu-kvm-0.11.1.tar.gz<br />
cd qemu-kvm-0.11.1<br />
./configure --prefix=/usr && make && make install<br />
ln -s /usr/bin/qemu-system-x86_64 /usr/bin/kvm<br />
Editar /etc/modules y añadir:<br />
kvm <br />
kvm_intel<br />
<br />
<li>Instalar libvirt 0.7.6:</li><br />
apt-get install libvirt-bin<br />
/etc/init.d/libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.7.6.tar.gz<br />
tar xfvz libvirt-0.7.6.tar.gz<br />
cd libvirt-0.7.6<br />
./configure --prefix=/usr --without-storage-disk && make && make install<br />
/etc/init.d/libvirt-bin start<br />
<br />
<li>Instalar librería perl de acceso a libvirt (Sys::Virt) mediante CPAN (no está disponible como paquete ubuntu)</li><br />
perl -MCPAN -e "CPAN::Shell->force(qw(install Sys::Virt));"<br />
Note: answer NO to the question "Are you ready for manual configuration?"<br />
<br />
<li>Instalar rootfilesystem de VNUML, enlaces del kernel y crear clave rsa:</li><br />
cd /usr/share/vnuml/filesystems<br />
wget http://www.dit.upm.es/vnuml/download/scripts/root-fs-installer<br />
perl root-fs-installer<br />
cd ../kernels<br />
ln -s linux-2.6.28.10-1m linux<br />
ssh-keygen -t rsa1<br />
<br />
<li>Instalar VNX:</li><br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-0.12b.tgz<br />
tar xfvz vnx-0.12b.tgz<br />
cd vnx-0.12b<br />
./install-vnx<br />
</ul><br />
--></div>Davidhttps://web.dit.upm.es/vnumlwiki/index.php?title=Vnx-install&diff=4106Vnx-install2011-02-24T13:25:17Z<p>David: /* Additional install steps for Dynamips support */</p>
<hr />
<div>{{Title|VNX (Virtual Networks over X virtualization) v0.14 beta}}<br />
<br />
== Installation over Ubuntu 10.04/9.10 ==<br />
<br />
This section describes the procedure for installing VNX over Ubuntu 10.04 or 9.10. Open a root shell window and follow these steps:<br />
<ul><br />
<br />
<li>Install all packages required (basic development, virtualization, perl libraries and auxiliar packages):</li><br />
apt-get update<br />
apt-get install build-essential qemu-kvm libvirt-bin vlan xterm \<br />
bridge-utils screen virt-manager virt-viewer libxml-checker-perl \<br />
libxml-parser-perl libnetaddr-ip-perl libnet-pcap-perl \<br />
libnet-ipv6addr-perl liberror-perl libexception-class-perl \<br />
uml-utilities libxml-libxml-perl libxml2-dev libgnutls-dev \<br />
libdevmapper-dev libterm-readline-perl-perl libnet-telnet-perl \<br />
libnet-ip-perl libreadonly-perl libmath-round-perl libappconfig-perl \<br />
libdbi-perl graphviz libnl-dev genisoimage gnome-terminal<br />
<br />
<!--Note: for Ubuntu 9.04 change "qemu-kvm" package by "qemu kvm" --><br />
<li>If you use 64 bits version of Ubuntu, install 32 bits compatibility libraries:</li><br />
apt-get install ia32-libs<br />
<br />
<li>Install libvirt 0.8.5:</li><br />
/etc/init.d/libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.8.5.tar.gz<br />
tar xfvz libvirt-0.8.5.tar.gz<br />
cd libvirt-0.8.5<br />
./configure --without-xen --prefix=/usr && make && make install<br />
/etc/init.d/libvirt-bin start<br />
<br />
'''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.<br />
<br />
<li>Install Sys::Virt perl module:</li><br />
<ul><br />
<li>For Ubuntu 10.04, just install the libsys-virt-perl package</li><br />
apt-get install libsys-virt-perl<br />
<!--<br />
'''IMPORTANT NOTE''': Windows XP virtual machines started with VNX over Ubuntu 9.10 frequently hang when executing commands or with high traffic loads. The problem could be related with virtual network drivers. We are investigating the problem to find a solution. By now, Ubuntu 10.04 is the recomended platform to test VNX.<br />
--><br />
<li>For Ubuntu 9.10, as Sys::Virt library is not available as a package, install it manually:</li><br />
wget http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.2.3.tar.gz<br />
tar xfvz Sys-Virt-0.2.3.tar.gz <br />
cd Sys-Virt-0.2.3<br />
perl Makefile.PL<br />
make install<br />
</ul><br />
<br />
<li>Install VNX:</li><br />
mkdir /tmp/vnx-update<br />
cd /tmp/vnx-update<br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-latest.tgz<br />
tar xfvz vnx-latest.tgz<br />
cd vnx-*<br />
./install_vnx<br />
<br />
<li>Create the VNX config file (/etc/vnx.conf). You just can move the sample config file:</li><br />
mv /etc/vnx.conf.samble /etc/vnx.conf<br />
<br />
<li>Download root file systems from http://idefix.dit.upm.es/download/vnx/filesystems and copy them to /usr/share/vnx/filesystems directory:</li><br />
cd /usr/share/vnx/filesystems<br />
<br />
# ubuntu server<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.10-v01.qcow2.bz2<br />
bunzip2 root_fs_ubuntu-10.10-v01.qcow2.bz2<br />
ln -s root_fs_ubuntu-10.10-v01.qcow2 root_fs_ubuntu<br />
<br />
# ubuntu with gui<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.04-gui-v01.qcow2.bz2<br />
bunzip2 root_fs_ubuntu-10.04-gui-v01.qcow2.bz2<br />
ln -s root_fs_ubuntu-10.04-gui-v01.qcow2 root_fs_ubuntu-gui<br />
<br />
# freebsd server<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-v01.qcow2.bz2<br />
bunzip2 root_fs_freebsd-v01.qcow2.bz2<br />
ln -s root_fs_freebsd-v01.qcow2 root_fs_freebsd<br />
<br />
# freebsd gui<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-gui-v01.qcow2.bz2<br />
bunzip2 root_fs_freebsd-gui-v01.qcow2.bz2<br />
ln -s root_fs_freebsd-gui-v01.qcow2 root_fs_freebsd-gui<br />
<br />
# winxp and win7<br />
# Sorry! Unfortunately for legal reasons we cannot distribute windows XP<br />
# or Windows 7 root filesystems. See VNX documentation for detailed recipes<br />
# to create these root fylesystems from scratch<br />
<br />
<li>Additionally, if you plan to use VNUML root filesystem:</li><br />
# VNUML root_fs_tutorial and kernel<br />
cd /usr/share/vnx/filesystem<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_tutorial-0.6.0.bz2<br />
bunzip2 root_fs_tutorial-0.6.0.bz2<br />
ln -s root_fs_tutorial-0.6.0 root_fs_tutorial<br />
cd /usr/share/vnx/kernels<br />
wget -N http://jungla.dit.upm.es/~vnx/download/kernels/linux-2.6.18.1-bb2-xt-4m<br />
chmod +x linux-2.6.18.1-bb2-xt-4m<br />
ln -s linux-2.6.18.1-bb2-xt-4m linux<br />
<br />
</ul><br />
<br />
'''NOTE for Ubuntu 10.04.1''': It seems that an additional package has to be installed:<br />
apt-get install kvm-pxe<br />
<br />
=== Additional install steps for Dynamips support ===<br />
<br />
* Install Dynamips and Dynagen:<br />
apt-get install dynamips dynagen<br />
<br />
* Create a file /etc/init.d/dynamips (taken from http://7200emu.hacki.at/viewtopic.php?t=2198):<br />
<pre><br />
#!/bin/sh<br />
# Start/stop the dynamips program as a daemon.<br />
#<br />
### BEGIN INIT INFO<br />
# Provides: dynamips<br />
# Default-Start: 2 3 4 5<br />
# Default-Stop: 0 1 6<br />
# Short-Description: Cisco hardware emulator daemon<br />
### END INIT INFO<br />
<br />
DAEMON=/usr/bin/dynamips<br />
NAME=dynamips<br />
PORT=7200<br />
PIDFILE=/var/run/$NAME.pid <br />
LOGFILE=/var/log/$NAME.log<br />
DESC="Cisco Emulator"<br />
SCRIPTNAME=/etc/init.d/$NAME<br />
<br />
test -f $DAEMON || exit 0<br />
<br />
. /lib/lsb/init-functions<br />
<br />
<br />
case "$1" in<br />
start) log_daemon_msg "Starting $DESC " "$NAME"<br />
start-stop-daemon --start --chdir /tmp --background --make-pidfile --pidfile $PIDFILE --name $NAME --startas $DAEMON -- -H $PORT -l $LOGFILE<br />
log_end_msg $?<br />
;;<br />
stop) log_daemon_msg "Stopping $DESC " "$NAME"<br />
start-stop-daemon --stop --quiet --pidfile $PIDFILE --name $NAME<br />
log_end_msg $?<br />
;;<br />
restart) log_daemon_msg "Restarting $DESC " "$NAME"<br />
start-stop-daemon --stop --retry 5 --quiet --pidfile $PIDFILE --name $NAME<br />
start-stop-daemon --start --chdir /tmp --background --make-pidfile --pidfile $PIDFILE --name $NAME --startas $DAEMON -- -H $PORT -l $LOGFILE<br />
log_end_msg $?<br />
;;<br />
status)<br />
status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $? <br />
#status $NAME<br />
#RETVAL=$?<br />
;; <br />
*) log_action_msg "Usage: $SCRIPTNAME {start|stop|restart|status}"<br />
exit 2<br />
;;<br />
esac<br />
exit 0<br />
<br />
</pre><br />
<br />
* Set execution permissions for the script and add it to system start-up:<br />
chmod +x /etc/init.d/dynamips<br />
update-rc.d dynamips defaults<br />
/etc/init.d/dynamips start<br />
<br />
* Calculate the idle-pc value for your computer following the procedure in http://dynagen.org/tutorial.htm:<br />
dynagen /usr/share/vnx/examples/R.net<br />
console R # type no to exit the config wizard and wait <br />
# for the router to completely start <br />
idle-pc get R<br />
Once you know the idle-pc value for your system, include it in /etc/vnx.conf file.<br />
<br />
* Download and install cisco IOS image:<br />
cd /usr/share/vnx/filesystems<br />
# Cisco image<br />
wget ... c3640-js-mz.124-19.image<br />
ln -s c3640-js-mz.124-19.image c3640<br />
<br />
=== Additional install steps for Olive support ===<br />
<br />
Several additional steps are needed to support Olive (Juniper) routers in VNX scenarios:<br />
<br />
<ul><br />
<br />
<!-- Ya no hace falta desde que se usa <qemu:commandline><br />
<br />
<li>Install a patched version of libvirt 0.8.5 with support to define the bios used by a virtual machine:</li><br />
<br />
<ul><br />
<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><br />
<pre><br />
diff -crB libvirt-0.8.5.orig/src/conf/domain_conf.c libvirt-0.8.5/src/conf/domain_conf.c<br />
*** libvirt-0.8.5.orig/src/conf/domain_conf.c 2010-11-22 11:38:08.000000000 +0100<br />
--- libvirt-0.8.5/src/conf/domain_conf.c 2010-11-22 11:47:41.000000000 +0100<br />
***************<br />
*** 4267,4272 ****<br />
--- 4267,4274 ----<br />
if (node)<br />
def->mem.hugepage_backed = 1;<br />
<br />
+ def->biosfile = virXPathString("string(./biosfile[1])", ctxt);<br />
+ <br />
/* Extract other memory tunables */<br />
if (virXPathULong("string(./memtune/hard_limit)", ctxt,<br />
&def->mem.hard_limit) < 0)<br />
diff -crB libvirt-0.8.5.orig/src/conf/domain_conf.h libvirt-0.8.5/src/conf/domain_conf.h<br />
*** libvirt-0.8.5.orig/src/conf/domain_conf.h 2010-11-22 11:38:08.000000000 +0100<br />
--- libvirt-0.8.5/src/conf/domain_conf.h 2010-11-22 11:40:18.000000000 +0100<br />
***************<br />
*** 885,890 ****<br />
--- 885,891 ----<br />
unsigned long min_guarantee;<br />
unsigned long swap_hard_limit;<br />
} mem;<br />
+ char *biosfile;<br />
unsigned short vcpus;<br />
unsigned short maxvcpus;<br />
int cpumasklen;<br />
diff -crB libvirt-0.8.5.orig/src/qemu/qemu_conf.c libvirt-0.8.5/src/qemu/qemu_conf.c<br />
*** libvirt-0.8.5.orig/src/qemu/qemu_conf.c 2010-11-22 11:38:08.000000000 +0100<br />
--- libvirt-0.8.5/src/qemu/qemu_conf.c 2010-11-22 11:41:05.000000000 +0100<br />
***************<br />
*** 3984,3989 ****<br />
--- 3984,3995 ----<br />
ADD_ARG_LIT(emulator);<br />
ADD_ARG_LIT("-S");<br />
<br />
+ if(def->biosfile)<br />
+ {<br />
+ ADD_ARG_LIT("-bios");<br />
+ ADD_ARG_LIT(def->biosfile);<br />
+ }<br />
+ <br />
/* This should *never* be NULL, since we always provide<br />
* a machine in the capabilities data for QEMU. So this<br />
* check is just here as a safety in case the unexpected<br />
</pre><br />
<br />
<li>Install libvirt 0.8.5 with that patch applied:</li><br />
service libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.8.5.tar.gz<br />
tar xfvz libvirt-0.8.5.tar.gz <br />
cd libvirt-0.8.5<br />
patch -p1 -i ../libvirt-0.8.5-biosfile.patch <br />
./configure --without-xen --prefix=/usr && make && make install<br />
service libvirt-bin start<br />
<br />
</ul><br />
--><br />
<li>Download old qemu bios from 0.10.6 version and copy it to /usr/share/qemu directory:</li><br />
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.10.6/qemu-kvm-0.10.6.tar.gz<br />
tar xfvz qemu-kvm-0.10.6.tar.gz<br />
cp qemu-kvm-0.10.6/pc-bios/bios.bin /usr/share/qemu-kvm/bios-0.10.6.bin<br />
<br />
<!-- Not needed, it seems to work without downloading this drivers<br />
<li>Download i82559 ROM from the latest qemu versions (Ubuntu 10.04 does not include that ROM in qemu-kvm package):</li><br />
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.12.5/qemu-kvm-0.12.5.tar.gz<br />
tar xfvz qemu-kvm-0.12.5.tar.gz<br />
cp qemu-kvm-0.12.5/pc-bios/pxe-i82559er.bin /usr/share/qemu-kvm/<br />
--><br />
</ul><br />
<br />
<br />
== Installation over Fedora 11 (Draft) ==<br />
<br />
Follow this steps to install VNX over Fedora 11:<br />
<ul><br />
<br />
<li>Install packages:</li><br />
yum -y groupinstall "Development Tools"<br />
yum install qemu-kvm libvirt virt-manager virt-viewer perl-XML-LibXML<br />
yum install perl-XML-DOM perl-NetAddr-IP perl-Readonly perl-TermReadKey<br />
yum install perl-Net-Pcap perl-Net-IPv6Addr perl-Net-Telnet perl-Error<br />
yum install perl-Exception-Class perl-ExtUtils-MakeMaker tunctl screen wget<br />
yum install libxml2-devel gnutls-devel device-mapper-devel uml_utilities <br />
yum install roxterm xterm graphviz perl-AppConfig<br />
<br />
<li>Install libvirt 0.8.5:</li><br />
/etc/init.d/libvirtd stop<br />
wget http://libvirt.org/sources/libvirt-0.8.5.tar.gz<br />
tar xfvz libvirt-0.8.5.tar.gz<br />
cd libvirt-0.8.5<br />
./configure --without-xen --prefix=/usr && make && make install<br />
/etc/init.d/libvirtd start<br />
<br />
<li>Install SysVirt manually:</li><br />
wget http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.2.4.tar.gz<br />
tar xfvz Sys-Virt-0.2.4.tar.gz<br />
cd Sys-Virt-0.2.4<br />
perl Makefile.PL<br />
make install<br />
<!--<br />
<li> Instalar VNUML sobre Fedora 11 siguiendo la receta en http://www.dit.upm.es/vnumlwiki/index.php/Fedora11</li><br />
<br />
<li> Instalar paquetes y librerías necesarias:</li><br />
yum install qemu-kvm libvirt virt-manager virt-viewer perl-XML-LibXML perl-Sys-Virt<br />
yum -y install bridge-utils readline-devel perl-Module-Build screen expat-devel libpcap-devel <br />
yum -y install perl-Net-Pcap perl-NetAddr-IP perl-Net-IPv6Addr perl-XML-DOM perl-Exception-Class<br />
yum -y install perl-TermReadKey perl-Error perl-CPAN uml_utilities xterm tunctl<br />
<br />
<li>Install XML::Checker perl library:</li><br />
perl -MCPAN -e shell<br />
install XML::Checker<br />
--><br />
<li>Add symbolic link for kvm:</li><br />
ln -s /usr/bin/qemu-kvm /usr/bin/kvm<br />
<br />
<li>Instalar VNX:</li><br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-latest.tgz<br />
tar xfvz vnx-latest.tgz<br />
cd vnx-*<br />
./install-vnx<br />
<br />
<li>Create the VNX config file (/etc/vnx.conf). You just can move the sample config file:</li><br />
mv /etc/vnx.conf.samble /etc/vnx.conf<br />
<br />
<li>Deshabilitar el firewall o, alternativamente, configurar los interfaces tipo "tun" como confiables (Sistema->Firewall->Interfaces Confiables").</li><br />
</ul><br />
<br />
=== Additional install steps for Dynamips support ===<br />
<br />
* Install Dynamips and Dynagen:<br />
wget http://downloads.sourceforge.net/project/dyna-gen/dynamips%20Linux%20RPM/0.2.8-RC2/dynamips-0.2.8RC2-1.i386.rpm<br />
rpm -i dynamips-0.2.8RC2-1.i386.rpm<br />
wget http://downloads.sourceforge.net/project/dyna-gen/dynagen%20source%20_%20Linux/dynagen%200.11.0/dynagen-0.11.0-1.fc9.noarch.rpm<br />
rpm -i dynagen-0.11.0-1.fc9.noarch.rpm<br />
<br />
* Set execution permissions for the script and add it to system start-up:<br />
chkconfig --add dynamips<br />
<br />
* Calculate the idle-pc value for your computer following the procedure in http://dynagen.org/tutorial.htm:<br />
/etc/init.d/dynamips start<br />
dynagen /usr/share/vnx/examples/R.net<br />
<br />
=== Additional install steps for Olive support ===<br />
<br />
Several additional steps are needed to support Olive (Juniper) routers in VNX scenarios:<br />
<br />
<ul><br />
<br />
<li>Download old qemu bios from 0.10.6 version and copy it to /usr/share/qemu directory:</li><br />
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.10.6/qemu-kvm-0.10.6.tar.gz<br />
tar xfvz qemu-kvm-0.10.6.tar.gz<br />
cp qemu-kvm-0.10.6/pc-bios/bios.bin /usr/share/qemu/bios-0.10.6.bin<br />
<br />
</ul><br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<!-- COSAS ANTIGUAS --><br />
<br />
<!--li>Modificar vnumlparser.pl, sustituyendo en la función mode_t la línea en ):</li><br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
<br />
por:<br />
<br />
if (! -e "/dev/net/tun") {<br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
}<br />
<br />
Explicación: el módulo tun se ha integrado en el kernel a partir de la 10.04, por lo que no es necesario cargarlo como hasta ahora mediante "modprobe tun". El cambio anterior simplemente comprueba si existe el dispositivo /dev/net/tun y carga el modulo en caso de que no exista.<br />
--><br />
<br />
<br />
<!--li>Modificar vnumlparser.pl, sustituyendo en la función mode_t la línea en ):</li><br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
<br />
por:<br />
<br />
if (! -e "/dev/net/tun") {<br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
}<br />
<br />
Explicación: el módulo tun se ha integrado en el kernel a partir de la 10.04, por lo que no es necesario cargarlo como hasta ahora mediante "modprobe tun". El cambio anterior simplemente comprueba si existe el dispositivo /dev/net/tun y carga el modulo en caso de que no exista.<br />
--><br />
<br />
<!--<br />
Pasos a seguir para instalar VNX sobre Ubuntu 9.10. <br />
<br />
'''Nota importante''': se han detectado importantes problemas de prestaciones cuando se utiliza el sistema de ficheros ext4 con Ubuntu 9.10. Por ello, y hasta que se localice el origen de dichas ineficiencias, se recomienda utilizar ext3. <br />
<ul><br />
<br />
<li> Instalar Ubuntu 9.10 y actualizar con:</li><br />
apt-get update; apt-get dist-upgrade<br />
--><br />
<!--<br />
<li>Añadir repositorios VNUML a /etc/apt/sources.lst:</li><br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian binary/" >> /etc/apt/sources.list<br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian-testing binary/" >> /etc/apt/sources.list<br />
--><br />
<!--<br />
<li>Install paquetes básicos de desarrollo, paquetes de virtualización (qemu-kvm, libvirt, vnuml) y librerías y paquetes auxiliares</li><br />
apt-get update<br />
apt-get install build-essential qemu-kvm libvirt-bin libvirt-dev \<br />
virt-manager virt-viewer vlan xterm bridge-utils screen uml-utilities \<br />
libxml-checker-perl libxml-parser-perl libnetaddr-ip-perl libnet-pcap-perl \<br />
libnet-ipv6addr-perl liberror-perl libexception-class-perl libxml-libxml-perl \<br />
libxml2-dev libgnutls-dev libdevmapper-dev libterm-readline-perl-perl <br />
<br />
<br />
<br />
curl vnuml linux-um <br />
<br />
<li>Si se usa la versión de Ubuntu de 64 bits hay que instalar las librerías de compatibilidad de 32 bits:</li><br />
apt-get install ia32-libs<br />
<br />
<li>Install qemu-kvm version 0.12.4 (version 0.11 which comes as apackage in 9.10 provokes hanging problems in Windows virtual machines when executing commands -something relates apparently with mounting cdroms in vms-):</li><br />
wget http://sourceforge.net/projects/kvm/files/qemu-kvm/0.11.1/qemu-kvm-0.11.1.tar.gz/download<br />
tar xfvz qemu-kvm-0.11.1.tar.gz<br />
cd qemu-kvm-0.11.1<br />
./configure --prefix=/usr && make && make install<br />
ln -s /usr/bin/qemu-system-x86_64 /usr/bin/kvm<br />
Editar /etc/modules y añadir:<br />
kvm <br />
kvm_intel<br />
<br />
wget http://sourceforge.net/projects/kvm/files/kvm-kmod/2.6.31.6b/kvm-kmod-2.6.31.6b.tar.bz2/download<br />
<br />
<li>Instalar libvirt 0.8.0:</li><br />
/etc/init.d/libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.8.0.tar.gz<br />
tar xfvz libvirt-0.8.0.tar.gz<br />
cd libvirt-0.8.0<br />
./configure --prefix=/usr && make && make install<br />
/etc/init.d/libvirt-bin start<br />
<br />
<li> Instalar la librería perl de acceso a libvirt (Sys::Virt) desde CPAN (dicha librería no esta disponible como paquete para Ubuntu 9.10):</li><br />
--><br />
<!-- wget http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.2.2.tar.gz<br />
tar xfvz Sys-Virt-0.2.2.tar.gz <br />
cd Sys-Virt-0.2.2<br />
perl Makefile.PL<br />
make install<br />
--><br />
<!--<br />
perl -MCPAN -e "CPAN::Shell->force(qw(install Sys::Virt));"<br />
Nota: constestar YES a la pregunta "Would you like me to configure as much as posible automatically?" y a "Is it OK to try to connect to the Internet?" <br />
<br />
<li>Instalar rootfilesystem de VNUML, enlaces del kernel y crear clave rsa:</li><br />
cd /usr/share/vnuml/filesystems<br />
wget http://www.dit.upm.es/vnuml/download/scripts/root-fs-installer<br />
perl root-fs-installer<br />
cd ../kernels<br />
ln -s linux-2.6.28.10-1m linux<br />
ssh-keygen -t rsa1<br />
<br />
<li>Instalar VNX:</li><br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-0.12b.tgz<br />
tar xfvz vnx-0.12b.tgz<br />
cd vnx-0.12b<br />
./install-vnx<br />
</ul><br />
<br />
Notas:<br />
http://www.ubuntu-es.org/node/128867<br />
175 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-headers-2.6.32-02063209_2.6.32-02063209_all.deb<br />
176 http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-image-2.6.32-02063209-generic_2.6.32-02063209_amd64.deb<br />
177 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-image-2.6.32-02063209-generic_2.6.32-02063209_amd64.deb<br />
178 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-headers-2.6.32-02063209-generic_2.6.32-02063209_amd64.deb<br />
--><br />
<br />
<!--<br />
=== Sobre Ubuntu 8.04 ===<br />
<br />
Pasos a seguir para instalar VNX sobre Ubuntu 8.04:<br />
<ul><br />
<br />
<li> Instalar Ubuntu 8.04 y actualizar con:</li><br />
apt-get update; apt-get dist-upgrade<br />
Rearrancar la máquina en caso de que se actualice la versión del kernel.<br />
<br />
<li> Añadir repositorio VNUML a /etc/apt/sources.lst:</li><br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian binary/" >> /etc/apt/sources.list<br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian-testing binary/" >> /etc/apt/sources.list<br />
<br />
<li> Instalar paquetes:</li><br />
apt-get update <br />
apt-get install virt-manager virt-viewer build-essential \<br />
libxml-libxml-perl vncviewer vlan xterm bridge-utils screen \<br />
curl vnuml linux-um libterm-readline-perl-perl zlib-bin zlib1g-dev \<br />
libxen3-dev libxml2-dev libgnutls-dev libsasl2-dev libsdl1.2-dev \<br />
libdevmapper-dev dnsmasq xbase-clients pkg-config<br />
<br />
<li>Si se usa la versión de Ubuntu de 64 bits hay que instalar las librerías de compatibilidad de 32 bits:</li><br />
apt-get install ia32-libs<br />
<br />
<li>Instalar qemu-kvm version 0.11.1 (la version 0.12.2 da errores):</li><br />
wget http://sourceforge.net/projects/kvm/files/qemu-kvm/0.11.1/qemu-kvm-0.11.1.tar.gz/download<br />
tar xfvz qemu-kvm-0.11.1.tar.gz<br />
cd qemu-kvm-0.11.1<br />
./configure --prefix=/usr && make && make install<br />
ln -s /usr/bin/qemu-system-x86_64 /usr/bin/kvm<br />
Editar /etc/modules y añadir:<br />
kvm <br />
kvm_intel<br />
<br />
<li>Instalar libvirt 0.7.6:</li><br />
apt-get install libvirt-bin<br />
/etc/init.d/libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.7.6.tar.gz<br />
tar xfvz libvirt-0.7.6.tar.gz<br />
cd libvirt-0.7.6<br />
./configure --prefix=/usr --without-storage-disk && make && make install<br />
/etc/init.d/libvirt-bin start<br />
<br />
<li>Instalar librería perl de acceso a libvirt (Sys::Virt) mediante CPAN (no está disponible como paquete ubuntu)</li><br />
perl -MCPAN -e "CPAN::Shell->force(qw(install Sys::Virt));"<br />
Note: answer NO to the question "Are you ready for manual configuration?"<br />
<br />
<li>Instalar rootfilesystem de VNUML, enlaces del kernel y crear clave rsa:</li><br />
cd /usr/share/vnuml/filesystems<br />
wget http://www.dit.upm.es/vnuml/download/scripts/root-fs-installer<br />
perl root-fs-installer<br />
cd ../kernels<br />
ln -s linux-2.6.28.10-1m linux<br />
ssh-keygen -t rsa1<br />
<br />
<li>Instalar VNX:</li><br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-0.12b.tgz<br />
tar xfvz vnx-0.12b.tgz<br />
cd vnx-0.12b<br />
./install-vnx<br />
</ul><br />
--></div>Davidhttps://web.dit.upm.es/vnumlwiki/index.php?title=Vnx-install&diff=4105Vnx-install2011-02-24T11:49:24Z<p>David: /* Additional install steps for Dynamips support */</p>
<hr />
<div>{{Title|VNX (Virtual Networks over X virtualization) v0.14 beta}}<br />
<br />
== Installation over Ubuntu 10.04/9.10 ==<br />
<br />
This section describes the procedure for installing VNX over Ubuntu 10.04 or 9.10. Open a root shell window and follow these steps:<br />
<ul><br />
<br />
<li>Install all packages required (basic development, virtualization, perl libraries and auxiliar packages):</li><br />
apt-get update<br />
apt-get install build-essential qemu-kvm libvirt-bin vlan xterm \<br />
bridge-utils screen virt-manager virt-viewer libxml-checker-perl \<br />
libxml-parser-perl libnetaddr-ip-perl libnet-pcap-perl \<br />
libnet-ipv6addr-perl liberror-perl libexception-class-perl \<br />
uml-utilities libxml-libxml-perl libxml2-dev libgnutls-dev \<br />
libdevmapper-dev libterm-readline-perl-perl libnet-telnet-perl \<br />
libnet-ip-perl libreadonly-perl libmath-round-perl libappconfig-perl \<br />
libdbi-perl graphviz libnl-dev genisoimage gnome-terminal<br />
<br />
<!--Note: for Ubuntu 9.04 change "qemu-kvm" package by "qemu kvm" --><br />
<li>If you use 64 bits version of Ubuntu, install 32 bits compatibility libraries:</li><br />
apt-get install ia32-libs<br />
<br />
<li>Install libvirt 0.8.5:</li><br />
/etc/init.d/libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.8.5.tar.gz<br />
tar xfvz libvirt-0.8.5.tar.gz<br />
cd libvirt-0.8.5<br />
./configure --without-xen --prefix=/usr && make && make install<br />
/etc/init.d/libvirt-bin start<br />
<br />
'''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.<br />
<br />
<li>Install Sys::Virt perl module:</li><br />
<ul><br />
<li>For Ubuntu 10.04, just install the libsys-virt-perl package</li><br />
apt-get install libsys-virt-perl<br />
<!--<br />
'''IMPORTANT NOTE''': Windows XP virtual machines started with VNX over Ubuntu 9.10 frequently hang when executing commands or with high traffic loads. The problem could be related with virtual network drivers. We are investigating the problem to find a solution. By now, Ubuntu 10.04 is the recomended platform to test VNX.<br />
--><br />
<li>For Ubuntu 9.10, as Sys::Virt library is not available as a package, install it manually:</li><br />
wget http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.2.3.tar.gz<br />
tar xfvz Sys-Virt-0.2.3.tar.gz <br />
cd Sys-Virt-0.2.3<br />
perl Makefile.PL<br />
make install<br />
</ul><br />
<br />
<li>Install VNX:</li><br />
mkdir /tmp/vnx-update<br />
cd /tmp/vnx-update<br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-latest.tgz<br />
tar xfvz vnx-latest.tgz<br />
cd vnx-*<br />
./install_vnx<br />
<br />
<li>Create the VNX config file (/etc/vnx.conf). You just can move the sample config file:</li><br />
mv /etc/vnx.conf.samble /etc/vnx.conf<br />
<br />
<li>Download root file systems from http://idefix.dit.upm.es/download/vnx/filesystems and copy them to /usr/share/vnx/filesystems directory:</li><br />
cd /usr/share/vnx/filesystems<br />
<br />
# ubuntu server<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.10-v01.qcow2.bz2<br />
bunzip2 root_fs_ubuntu-10.10-v01.qcow2.bz2<br />
ln -s root_fs_ubuntu-10.10-v01.qcow2 root_fs_ubuntu<br />
<br />
# ubuntu with gui<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.04-gui-v01.qcow2.bz2<br />
bunzip2 root_fs_ubuntu-10.04-gui-v01.qcow2.bz2<br />
ln -s root_fs_ubuntu-10.04-gui-v01.qcow2 root_fs_ubuntu-gui<br />
<br />
# freebsd server<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-v01.qcow2.bz2<br />
bunzip2 root_fs_freebsd-v01.qcow2.bz2<br />
ln -s root_fs_freebsd-v01.qcow2 root_fs_freebsd<br />
<br />
# freebsd gui<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-gui-v01.qcow2.bz2<br />
bunzip2 root_fs_freebsd-gui-v01.qcow2.bz2<br />
ln -s root_fs_freebsd-gui-v01.qcow2 root_fs_freebsd-gui<br />
<br />
# winxp and win7<br />
# Sorry! Unfortunately for legal reasons we cannot distribute windows XP<br />
# or Windows 7 root filesystems. See VNX documentation for detailed recipes<br />
# to create these root fylesystems from scratch<br />
<br />
<li>Additionally, if you plan to use VNUML root filesystem:</li><br />
# VNUML root_fs_tutorial and kernel<br />
cd /usr/share/vnx/filesystem<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_tutorial-0.6.0.bz2<br />
bunzip2 root_fs_tutorial-0.6.0.bz2<br />
ln -s root_fs_tutorial-0.6.0 root_fs_tutorial<br />
cd /usr/share/vnx/kernels<br />
wget -N http://jungla.dit.upm.es/~vnx/download/kernels/linux-2.6.18.1-bb2-xt-4m<br />
chmod +x linux-2.6.18.1-bb2-xt-4m<br />
ln -s linux-2.6.18.1-bb2-xt-4m linux<br />
<br />
</ul><br />
<br />
'''NOTE for Ubuntu 10.04.1''': It seems that an additional package has to be installed:<br />
apt-get install kvm-pxe<br />
<br />
=== Additional install steps for Dynamips support ===<br />
<br />
* Install Dynamips and Dynagen:<br />
apt-get install dynamips dynagen<br />
<br />
* Create a file /etc/init.d/dynamips (taken from http://7200emu.hacki.at/viewtopic.php?t=2198):<br />
<pre><br />
#!/bin/sh<br />
# Start/stop the dynamips program as a daemon.<br />
#<br />
### BEGIN INIT INFO<br />
# Provides: dynamips<br />
# Default-Start: 2 3 4 5<br />
# Default-Stop: 0 1 6<br />
# Short-Description: Cisco hardware emulator daemon<br />
### END INIT INFO<br />
<br />
DAEMON=/usr/bin/dynamips<br />
NAME=dynamips<br />
PORT=7200<br />
PIDFILE=/var/run/$NAME.pid <br />
LOGFILE=/var/log/$NAME.log<br />
DESC="Cisco Emulator"<br />
SCRIPTNAME=/etc/init.d/$NAME<br />
<br />
test -f $DAEMON || exit 0<br />
<br />
. /lib/lsb/init-functions<br />
<br />
<br />
case "$1" in<br />
start) log_daemon_msg "Starting $DESC " "$NAME"<br />
start-stop-daemon --start --chdir /tmp --background --make-pidfile --pidfile $PIDFILE --name $NAME --startas $DAEMON -- -H $PORT -l $LOGFILE<br />
log_end_msg $?<br />
;;<br />
stop) log_daemon_msg "Stopping $DESC " "$NAME"<br />
start-stop-daemon --stop --quiet --pidfile $PIDFILE --name $NAME<br />
log_end_msg $?<br />
;;<br />
restart) log_daemon_msg "Restarting $DESC " "$NAME"<br />
start-stop-daemon --stop --retry 5 --quiet --pidfile $PIDFILE --name $NAME<br />
start-stop-daemon --start --chdir /tmp --background --make-pidfile --pidfile $PIDFILE --name $NAME --startas $DAEMON -- -H $PORT -l $LOGFILE<br />
log_end_msg $?<br />
;;<br />
status)<br />
status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $? <br />
#status $NAME<br />
#RETVAL=$?<br />
;; <br />
*) log_action_msg "Usage: $SCRIPTNAME {start|stop|restart|status}"<br />
exit 2<br />
;;<br />
esac<br />
exit 0<br />
<br />
</pre><br />
<br />
* Set execution permissions for the script and add it to system start-up:<br />
chmod +x /etc/init.d/dynamips<br />
update-rc.d dynamips defaults<br />
<br />
* Calculate the idle-pc value for your computer following the procedure in http://dynagen.org/tutorial.htm:<br />
/etc/init.d/dynamips start<br />
dynagen /usr/share/vnx/examples/R.net<br />
<br />
* Download and install cisco IOS image:<br />
cd /usr/share/vnx/filesystems<br />
# Cisco image<br />
wget ... c3640-js-mz.124-19.image<br />
ln -s c3640-js-mz.124-19.image c3640<br />
<br />
=== Additional install steps for Olive support ===<br />
<br />
Several additional steps are needed to support Olive (Juniper) routers in VNX scenarios:<br />
<br />
<ul><br />
<br />
<!-- Ya no hace falta desde que se usa <qemu:commandline><br />
<br />
<li>Install a patched version of libvirt 0.8.5 with support to define the bios used by a virtual machine:</li><br />
<br />
<ul><br />
<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><br />
<pre><br />
diff -crB libvirt-0.8.5.orig/src/conf/domain_conf.c libvirt-0.8.5/src/conf/domain_conf.c<br />
*** libvirt-0.8.5.orig/src/conf/domain_conf.c 2010-11-22 11:38:08.000000000 +0100<br />
--- libvirt-0.8.5/src/conf/domain_conf.c 2010-11-22 11:47:41.000000000 +0100<br />
***************<br />
*** 4267,4272 ****<br />
--- 4267,4274 ----<br />
if (node)<br />
def->mem.hugepage_backed = 1;<br />
<br />
+ def->biosfile = virXPathString("string(./biosfile[1])", ctxt);<br />
+ <br />
/* Extract other memory tunables */<br />
if (virXPathULong("string(./memtune/hard_limit)", ctxt,<br />
&def->mem.hard_limit) < 0)<br />
diff -crB libvirt-0.8.5.orig/src/conf/domain_conf.h libvirt-0.8.5/src/conf/domain_conf.h<br />
*** libvirt-0.8.5.orig/src/conf/domain_conf.h 2010-11-22 11:38:08.000000000 +0100<br />
--- libvirt-0.8.5/src/conf/domain_conf.h 2010-11-22 11:40:18.000000000 +0100<br />
***************<br />
*** 885,890 ****<br />
--- 885,891 ----<br />
unsigned long min_guarantee;<br />
unsigned long swap_hard_limit;<br />
} mem;<br />
+ char *biosfile;<br />
unsigned short vcpus;<br />
unsigned short maxvcpus;<br />
int cpumasklen;<br />
diff -crB libvirt-0.8.5.orig/src/qemu/qemu_conf.c libvirt-0.8.5/src/qemu/qemu_conf.c<br />
*** libvirt-0.8.5.orig/src/qemu/qemu_conf.c 2010-11-22 11:38:08.000000000 +0100<br />
--- libvirt-0.8.5/src/qemu/qemu_conf.c 2010-11-22 11:41:05.000000000 +0100<br />
***************<br />
*** 3984,3989 ****<br />
--- 3984,3995 ----<br />
ADD_ARG_LIT(emulator);<br />
ADD_ARG_LIT("-S");<br />
<br />
+ if(def->biosfile)<br />
+ {<br />
+ ADD_ARG_LIT("-bios");<br />
+ ADD_ARG_LIT(def->biosfile);<br />
+ }<br />
+ <br />
/* This should *never* be NULL, since we always provide<br />
* a machine in the capabilities data for QEMU. So this<br />
* check is just here as a safety in case the unexpected<br />
</pre><br />
<br />
<li>Install libvirt 0.8.5 with that patch applied:</li><br />
service libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.8.5.tar.gz<br />
tar xfvz libvirt-0.8.5.tar.gz <br />
cd libvirt-0.8.5<br />
patch -p1 -i ../libvirt-0.8.5-biosfile.patch <br />
./configure --without-xen --prefix=/usr && make && make install<br />
service libvirt-bin start<br />
<br />
</ul><br />
--><br />
<li>Download old qemu bios from 0.10.6 version and copy it to /usr/share/qemu directory:</li><br />
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.10.6/qemu-kvm-0.10.6.tar.gz<br />
tar xfvz qemu-kvm-0.10.6.tar.gz<br />
cp qemu-kvm-0.10.6/pc-bios/bios.bin /usr/share/qemu-kvm/bios-0.10.6.bin<br />
<br />
<!-- Not needed, it seems to work without downloading this drivers<br />
<li>Download i82559 ROM from the latest qemu versions (Ubuntu 10.04 does not include that ROM in qemu-kvm package):</li><br />
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.12.5/qemu-kvm-0.12.5.tar.gz<br />
tar xfvz qemu-kvm-0.12.5.tar.gz<br />
cp qemu-kvm-0.12.5/pc-bios/pxe-i82559er.bin /usr/share/qemu-kvm/<br />
--><br />
</ul><br />
<br />
<br />
== Installation over Fedora 11 (Draft) ==<br />
<br />
Follow this steps to install VNX over Fedora 11:<br />
<ul><br />
<br />
<li>Install packages:</li><br />
yum -y groupinstall "Development Tools"<br />
yum install qemu-kvm libvirt virt-manager virt-viewer perl-XML-LibXML<br />
yum install perl-XML-DOM perl-NetAddr-IP perl-Readonly perl-TermReadKey<br />
yum install perl-Net-Pcap perl-Net-IPv6Addr perl-Net-Telnet perl-Error<br />
yum install perl-Exception-Class perl-ExtUtils-MakeMaker tunctl screen wget<br />
yum install libxml2-devel gnutls-devel device-mapper-devel uml_utilities <br />
yum install roxterm xterm graphviz perl-AppConfig<br />
<br />
<li>Install libvirt 0.8.5:</li><br />
/etc/init.d/libvirtd stop<br />
wget http://libvirt.org/sources/libvirt-0.8.5.tar.gz<br />
tar xfvz libvirt-0.8.5.tar.gz<br />
cd libvirt-0.8.5<br />
./configure --without-xen --prefix=/usr && make && make install<br />
/etc/init.d/libvirtd start<br />
<br />
<li>Install SysVirt manually:</li><br />
wget http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.2.4.tar.gz<br />
tar xfvz Sys-Virt-0.2.4.tar.gz<br />
cd Sys-Virt-0.2.4<br />
perl Makefile.PL<br />
make install<br />
<!--<br />
<li> Instalar VNUML sobre Fedora 11 siguiendo la receta en http://www.dit.upm.es/vnumlwiki/index.php/Fedora11</li><br />
<br />
<li> Instalar paquetes y librerías necesarias:</li><br />
yum install qemu-kvm libvirt virt-manager virt-viewer perl-XML-LibXML perl-Sys-Virt<br />
yum -y install bridge-utils readline-devel perl-Module-Build screen expat-devel libpcap-devel <br />
yum -y install perl-Net-Pcap perl-NetAddr-IP perl-Net-IPv6Addr perl-XML-DOM perl-Exception-Class<br />
yum -y install perl-TermReadKey perl-Error perl-CPAN uml_utilities xterm tunctl<br />
<br />
<li>Install XML::Checker perl library:</li><br />
perl -MCPAN -e shell<br />
install XML::Checker<br />
--><br />
<li>Add symbolic link for kvm:</li><br />
ln -s /usr/bin/qemu-kvm /usr/bin/kvm<br />
<br />
<li>Instalar VNX:</li><br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-latest.tgz<br />
tar xfvz vnx-latest.tgz<br />
cd vnx-*<br />
./install-vnx<br />
<br />
<li>Create the VNX config file (/etc/vnx.conf). You just can move the sample config file:</li><br />
mv /etc/vnx.conf.samble /etc/vnx.conf<br />
<br />
<li>Deshabilitar el firewall o, alternativamente, configurar los interfaces tipo "tun" como confiables (Sistema->Firewall->Interfaces Confiables").</li><br />
</ul><br />
<br />
=== Additional install steps for Dynamips support ===<br />
<br />
* Install Dynamips and Dynagen:<br />
wget http://downloads.sourceforge.net/project/dyna-gen/dynamips%20Linux%20RPM/0.2.8-RC2/dynamips-0.2.8RC2-1.i386.rpm<br />
rpm -i dynamips-0.2.8RC2-1.i386.rpm<br />
wget http://downloads.sourceforge.net/project/dyna-gen/dynagen%20source%20_%20Linux/dynagen%200.11.0/dynagen-0.11.0-1.fc9.noarch.rpm<br />
rpm -i dynagen-0.11.0-1.fc9.noarch.rpm<br />
<br />
* Set execution permissions for the script and add it to system start-up:<br />
chkconfig --add dynamips<br />
<br />
* Calculate the idle-pc value for your computer following the procedure in http://dynagen.org/tutorial.htm:<br />
/etc/init.d/dynamips start<br />
dynagen /usr/share/vnx/examples/R.net<br />
<br />
=== Additional install steps for Olive support ===<br />
<br />
Several additional steps are needed to support Olive (Juniper) routers in VNX scenarios:<br />
<br />
<ul><br />
<br />
<li>Download old qemu bios from 0.10.6 version and copy it to /usr/share/qemu directory:</li><br />
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.10.6/qemu-kvm-0.10.6.tar.gz<br />
tar xfvz qemu-kvm-0.10.6.tar.gz<br />
cp qemu-kvm-0.10.6/pc-bios/bios.bin /usr/share/qemu/bios-0.10.6.bin<br />
<br />
</ul><br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<!-- COSAS ANTIGUAS --><br />
<br />
<!--li>Modificar vnumlparser.pl, sustituyendo en la función mode_t la línea en ):</li><br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
<br />
por:<br />
<br />
if (! -e "/dev/net/tun") {<br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
}<br />
<br />
Explicación: el módulo tun se ha integrado en el kernel a partir de la 10.04, por lo que no es necesario cargarlo como hasta ahora mediante "modprobe tun". El cambio anterior simplemente comprueba si existe el dispositivo /dev/net/tun y carga el modulo en caso de que no exista.<br />
--><br />
<br />
<br />
<!--li>Modificar vnumlparser.pl, sustituyendo en la función mode_t la línea en ):</li><br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
<br />
por:<br />
<br />
if (! -e "/dev/net/tun") {<br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
}<br />
<br />
Explicación: el módulo tun se ha integrado en el kernel a partir de la 10.04, por lo que no es necesario cargarlo como hasta ahora mediante "modprobe tun". El cambio anterior simplemente comprueba si existe el dispositivo /dev/net/tun y carga el modulo en caso de que no exista.<br />
--><br />
<br />
<!--<br />
Pasos a seguir para instalar VNX sobre Ubuntu 9.10. <br />
<br />
'''Nota importante''': se han detectado importantes problemas de prestaciones cuando se utiliza el sistema de ficheros ext4 con Ubuntu 9.10. Por ello, y hasta que se localice el origen de dichas ineficiencias, se recomienda utilizar ext3. <br />
<ul><br />
<br />
<li> Instalar Ubuntu 9.10 y actualizar con:</li><br />
apt-get update; apt-get dist-upgrade<br />
--><br />
<!--<br />
<li>Añadir repositorios VNUML a /etc/apt/sources.lst:</li><br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian binary/" >> /etc/apt/sources.list<br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian-testing binary/" >> /etc/apt/sources.list<br />
--><br />
<!--<br />
<li>Install paquetes básicos de desarrollo, paquetes de virtualización (qemu-kvm, libvirt, vnuml) y librerías y paquetes auxiliares</li><br />
apt-get update<br />
apt-get install build-essential qemu-kvm libvirt-bin libvirt-dev \<br />
virt-manager virt-viewer vlan xterm bridge-utils screen uml-utilities \<br />
libxml-checker-perl libxml-parser-perl libnetaddr-ip-perl libnet-pcap-perl \<br />
libnet-ipv6addr-perl liberror-perl libexception-class-perl libxml-libxml-perl \<br />
libxml2-dev libgnutls-dev libdevmapper-dev libterm-readline-perl-perl <br />
<br />
<br />
<br />
curl vnuml linux-um <br />
<br />
<li>Si se usa la versión de Ubuntu de 64 bits hay que instalar las librerías de compatibilidad de 32 bits:</li><br />
apt-get install ia32-libs<br />
<br />
<li>Install qemu-kvm version 0.12.4 (version 0.11 which comes as apackage in 9.10 provokes hanging problems in Windows virtual machines when executing commands -something relates apparently with mounting cdroms in vms-):</li><br />
wget http://sourceforge.net/projects/kvm/files/qemu-kvm/0.11.1/qemu-kvm-0.11.1.tar.gz/download<br />
tar xfvz qemu-kvm-0.11.1.tar.gz<br />
cd qemu-kvm-0.11.1<br />
./configure --prefix=/usr && make && make install<br />
ln -s /usr/bin/qemu-system-x86_64 /usr/bin/kvm<br />
Editar /etc/modules y añadir:<br />
kvm <br />
kvm_intel<br />
<br />
wget http://sourceforge.net/projects/kvm/files/kvm-kmod/2.6.31.6b/kvm-kmod-2.6.31.6b.tar.bz2/download<br />
<br />
<li>Instalar libvirt 0.8.0:</li><br />
/etc/init.d/libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.8.0.tar.gz<br />
tar xfvz libvirt-0.8.0.tar.gz<br />
cd libvirt-0.8.0<br />
./configure --prefix=/usr && make && make install<br />
/etc/init.d/libvirt-bin start<br />
<br />
<li> Instalar la librería perl de acceso a libvirt (Sys::Virt) desde CPAN (dicha librería no esta disponible como paquete para Ubuntu 9.10):</li><br />
--><br />
<!-- wget http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.2.2.tar.gz<br />
tar xfvz Sys-Virt-0.2.2.tar.gz <br />
cd Sys-Virt-0.2.2<br />
perl Makefile.PL<br />
make install<br />
--><br />
<!--<br />
perl -MCPAN -e "CPAN::Shell->force(qw(install Sys::Virt));"<br />
Nota: constestar YES a la pregunta "Would you like me to configure as much as posible automatically?" y a "Is it OK to try to connect to the Internet?" <br />
<br />
<li>Instalar rootfilesystem de VNUML, enlaces del kernel y crear clave rsa:</li><br />
cd /usr/share/vnuml/filesystems<br />
wget http://www.dit.upm.es/vnuml/download/scripts/root-fs-installer<br />
perl root-fs-installer<br />
cd ../kernels<br />
ln -s linux-2.6.28.10-1m linux<br />
ssh-keygen -t rsa1<br />
<br />
<li>Instalar VNX:</li><br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-0.12b.tgz<br />
tar xfvz vnx-0.12b.tgz<br />
cd vnx-0.12b<br />
./install-vnx<br />
</ul><br />
<br />
Notas:<br />
http://www.ubuntu-es.org/node/128867<br />
175 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-headers-2.6.32-02063209_2.6.32-02063209_all.deb<br />
176 http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-image-2.6.32-02063209-generic_2.6.32-02063209_amd64.deb<br />
177 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-image-2.6.32-02063209-generic_2.6.32-02063209_amd64.deb<br />
178 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-headers-2.6.32-02063209-generic_2.6.32-02063209_amd64.deb<br />
--><br />
<br />
<!--<br />
=== Sobre Ubuntu 8.04 ===<br />
<br />
Pasos a seguir para instalar VNX sobre Ubuntu 8.04:<br />
<ul><br />
<br />
<li> Instalar Ubuntu 8.04 y actualizar con:</li><br />
apt-get update; apt-get dist-upgrade<br />
Rearrancar la máquina en caso de que se actualice la versión del kernel.<br />
<br />
<li> Añadir repositorio VNUML a /etc/apt/sources.lst:</li><br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian binary/" >> /etc/apt/sources.list<br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian-testing binary/" >> /etc/apt/sources.list<br />
<br />
<li> Instalar paquetes:</li><br />
apt-get update <br />
apt-get install virt-manager virt-viewer build-essential \<br />
libxml-libxml-perl vncviewer vlan xterm bridge-utils screen \<br />
curl vnuml linux-um libterm-readline-perl-perl zlib-bin zlib1g-dev \<br />
libxen3-dev libxml2-dev libgnutls-dev libsasl2-dev libsdl1.2-dev \<br />
libdevmapper-dev dnsmasq xbase-clients pkg-config<br />
<br />
<li>Si se usa la versión de Ubuntu de 64 bits hay que instalar las librerías de compatibilidad de 32 bits:</li><br />
apt-get install ia32-libs<br />
<br />
<li>Instalar qemu-kvm version 0.11.1 (la version 0.12.2 da errores):</li><br />
wget http://sourceforge.net/projects/kvm/files/qemu-kvm/0.11.1/qemu-kvm-0.11.1.tar.gz/download<br />
tar xfvz qemu-kvm-0.11.1.tar.gz<br />
cd qemu-kvm-0.11.1<br />
./configure --prefix=/usr && make && make install<br />
ln -s /usr/bin/qemu-system-x86_64 /usr/bin/kvm<br />
Editar /etc/modules y añadir:<br />
kvm <br />
kvm_intel<br />
<br />
<li>Instalar libvirt 0.7.6:</li><br />
apt-get install libvirt-bin<br />
/etc/init.d/libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.7.6.tar.gz<br />
tar xfvz libvirt-0.7.6.tar.gz<br />
cd libvirt-0.7.6<br />
./configure --prefix=/usr --without-storage-disk && make && make install<br />
/etc/init.d/libvirt-bin start<br />
<br />
<li>Instalar librería perl de acceso a libvirt (Sys::Virt) mediante CPAN (no está disponible como paquete ubuntu)</li><br />
perl -MCPAN -e "CPAN::Shell->force(qw(install Sys::Virt));"<br />
Note: answer NO to the question "Are you ready for manual configuration?"<br />
<br />
<li>Instalar rootfilesystem de VNUML, enlaces del kernel y crear clave rsa:</li><br />
cd /usr/share/vnuml/filesystems<br />
wget http://www.dit.upm.es/vnuml/download/scripts/root-fs-installer<br />
perl root-fs-installer<br />
cd ../kernels<br />
ln -s linux-2.6.28.10-1m linux<br />
ssh-keygen -t rsa1<br />
<br />
<li>Instalar VNX:</li><br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-0.12b.tgz<br />
tar xfvz vnx-0.12b.tgz<br />
cd vnx-0.12b<br />
./install-vnx<br />
</ul><br />
--></div>Davidhttps://web.dit.upm.es/vnumlwiki/index.php?title=Vnx-rootfsubuntu&diff=4104Vnx-rootfsubuntu2011-02-24T11:40:55Z<p>David: </p>
<hr />
<div>{{Title|How to create a Ubuntu root-file-system for VNX}}<br />
<br />
Follow this procedure to create a Ubuntu based root-file-system for VNX. The procedure has been tested with Ubuntu 9.10 and 10.04.<br />
<ul><br />
<li>Create the filesystem disk image:</li><br />
qemu-img create -f qcow2 root_fs_ubuntu-base.qcow2 5GB<br />
<li>Get Ubuntu installation CD. For example:</li><br />
wget ftp://ftp.rediris.es/mirror/ubuntu-releases/10.04.1/ubuntu-10.04.1-server-i386.iso<br />
cp ubuntu-10.04.1-server-i386.iso /almacen/iso<br />
<li>Create a libvirt XML definition (root_fs_ubuntu.xml) containing the virtual machine description:</li><br />
<pre><br />
<domain type='kvm'><br />
<name>Ubuntu</name><br />
<memory>524288</memory><br />
<vcpu>1</vcpu><br />
<os><br />
<type arch="i686">hvm</type><br />
<boot dev='hd'/><br />
<boot dev='cdrom'/><br />
</os><br />
<features><br />
<pae/><br />
<acpi/><br />
<apic/><br />
</features><br />
<clock sync="localtime"/><br />
<devices><br />
<emulator>/usr/bin/kvm</emulator><br />
<disk type='file' device='disk'><br />
<source file='/usr/share/vnx/filesystems/root_fs_ubuntu-base.qcow2'/><br />
<target dev='hda'/><br />
<driver name="qemu" type="qcow2"/><br />
</disk><br />
<disk type='file' device='cdrom'><br />
<source file='/almacen/iso/ubuntu-10.04.1-server-i386.iso'/><br />
<target dev='hdb'/><br />
</disk><br />
<interface type='network'><br />
<source network='default'/><br />
</interface><br />
<graphics type='vnc'/><br />
</devices><br />
</domain><br />
</pre><br />
Note: change "source file=" lines to whatever fits your case (use full paths). <br />
<br />
<li>Start the virtual machine with:</li><br />
virsh create root_fs_ubuntu.xml<br />
<li>Access virtual machine console with:</li><br />
virt-viewer Ubuntu<br />
Note: alternative you can start the machine and open the console at the same time with the command:<br />
/usr/share/vnx/bin/vnx_modify_rootfs root_fs_ubuntu.xml<br />
<li>Follow Ubuntu installation menus to install a basic system with ssh server. Once the installation is finished, stop the machine and edit root_fs_ubuntu.xml file and comment the following line in cdrom disk specification:</li><br />
<pre><br />
<!--source file='/almacen/iso/ubuntu-10.04-server-i386.iso'/--><br />
</pre><br />
<li>Start the virtual machine again and finish the installation:</li><br />
<ul><br />
<li>Access the console and sudo root: </li><br />
sudo su<br />
<li>Update the system</li><br />
apt-get update<br />
apt-get dist-upgrade<br />
<li>Install XML::DOM perl package and ACPI daemon:</li><br />
apt-get install libxml-dom-perl acpid<br />
<li>Only for Ubuntu 10.04:</li><br />
<ul><br />
<li>create /media/cdrom* directories:</li><br />
mkdir /media/cdrom0<br />
mkdir /media/cdrom1<br />
ln -s /media/cdrom0 /media/cdrom<br />
ln -s /cdrom /media/cdrom<br />
<li>add the following lines to /etc/fstab:</li><br />
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0<br />
/dev/scd1 /media/cdrom1 udf,iso9660 user,noauto,exec,utf8 0 0<br />
</ul><br />
<li>Configure a serial console on ttyS0:</li><br />
cd /etc/init<br />
cp tty1.conf ttyS0.conf<br />
sed -i -e 's/tty1/ttyS0/' ttyS0.conf<br />
<li>Activate startup traces on serial console by editting /boot/grub/grub.cfg file and adding "console=ttyS0" to the linux line. For example:</li><br />
linux /boot/vmlinuz-2.6.35-25-generic-pae root=UUID=eb1a0afb-48b2-4e42-ba6d-22bfae1055f3 ro quiet console=ttyS0<br />
<li>Install VNX autoconfiguration daemon:</li><br />
<ul><br />
<li>From the host execute:</li><br />
/usr/share/vnx/bin/vnx_update_aced Ubuntu /usr/share/vnx/aced/vnx-aced-lf-0.1b.tgz <br />
<li>From the virtual machine console:</li><br />
mount /media/cdrom<br />
/media/cdrom/install_vnxdaemon<br />
</ul><br />
<li>Delete udev rules files:</li><br />
rm /etc/udev/rules.d/70-persistent-net.rules<br />
rm /etc/udev/rules.d/70-persistent-cd.rules<br />
<li>Optional: install graphical user interface.</li><br />
<ul><br />
<li>Minimal:</li><br />
sudo apt-get install xorg gnome-core gksu gdm gnome-system-tools gnome-nettool firefox-gnome-support<br />
<li>Complete:</li><br />
sudo apt-get install ubuntu-desktop<br />
</ul><br />
<li>Optional: install other services:</li><br />
<ul><br />
<li>Apache server:</li><br />
sudo apt-get install apache2<br />
update-rc.d -f apache2 remove # to avoid automatic start<br />
<li>Other network tools</li><br />
sudo apt-get traceroute<br />
</ul><br />
<li>Stop the machine with:</li><br />
halt<br />
</ul><br />
</ul><br />
<br />
If everything went well, your root filesystem will be ready to be used with VNX. You can make a simple test using the simple_ubuntu.xml scenario distributed with VNX. <br />
<br />
=== Installing additional software ===<br />
<br />
To install additional software or modify your root file system, you just have to start it as described above and make the operations required on the filesystem.<br />
* Start the virtual machine (directly using virsh or the vnx_modify_rootfs utility):<br />
/usr/share/vnx/bin/vnx_modify_rootfs root_fs_ubuntu.xml <br />
* Install the software:<br />
apt-get install ...<br />
* Delete udev rules files:<br />
rm /etc/udev/rules.d/70-persistent-net.rules<br />
rm /etc/udev/rules.d/70-persistent-cd.rules<br />
* Stop the machine with:<br />
halt<br />
<br />
=== Updating ACE daemon ===<br />
<br />
If you have a root filesystem with the autoconfiguration and command execution daemon (ACE) already installed, you can use the autoupdate functionallity to update the daemon to a newer version. Just follow this procedure:<br />
<br />
* Edit the xml described above and comment the line defining the Ubuntu iso file for the cdrom:<br />
<!--source file='/almacen/iso/ubuntu-10.04-server-i386.iso'/--><br />
* Start the virtual machine (directly using virsh or the vnx_modify_rootfs utility):<br />
/usr/share/vnx/bin/vnx_modify_rootfs root_fs_ubuntu.xml <br />
* Execute the update utility:<br />
/usr/share/vnx/bin/vnx_update_aced Ubuntu /usr/share/vnx/aced/vnx-aced-lf-0.1b.tgz <br />
* Once the ace daemon is updated the virtual machine will be rebooted automatically.<br />
<br />
=== Known problems ===<br />
<br />
<ul><br />
<li>Each a cdrom is mounted (for example, ehenever a command is executed on the virtual machine) the following error appear in the console:</li><br />
<pre><br />
Jul 27 22:33:31 vnx kernel: [ 4384.875886] ata1.01: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6<br />
Jul 27 22:33:31 vnx kernel: [ 4385.291374] ata1.01: BMDMA stat 0x5<br />
Jul 27 22:33:31 vnx kernel: [ 4385.493411] sr 0:0:1:0: [sr0] CDB: Read(10): 28 00 00 00 00 18 00 00 01 00<br />
Jul 27 22:33:31 vnx kernel: [ 4385.493460] ata1.01: cmd a0/01:00:00:00:08/00:00:00:00:00/b0 tag 0 dma 2048 in<br />
Jul 27 22:33:31 vnx kernel: [ 4385.493461] res 01/60:00:00:00:08/00:00:00:00:00/b0 Emask 0x3 (HSM violation)<br />
Jul 27 22:33:31 vnx kernel: [ 4386.263553] ata1.01: status: { ERR }<br />
</pre><br />
However, the command are executed correctly. This error does not appear on Ubuntu 9.10 filesystems.<br />
<br />
</ul></div>Davidhttps://web.dit.upm.es/vnumlwiki/index.php?title=Vnx-install&diff=4103Vnx-install2011-02-24T11:31:18Z<p>David: </p>
<hr />
<div>{{Title|VNX (Virtual Networks over X virtualization) v0.14 beta}}<br />
<br />
== Installation over Ubuntu 10.04/9.10 ==<br />
<br />
This section describes the procedure for installing VNX over Ubuntu 10.04 or 9.10. Open a root shell window and follow these steps:<br />
<ul><br />
<br />
<li>Install all packages required (basic development, virtualization, perl libraries and auxiliar packages):</li><br />
apt-get update<br />
apt-get install build-essential qemu-kvm libvirt-bin vlan xterm \<br />
bridge-utils screen virt-manager virt-viewer libxml-checker-perl \<br />
libxml-parser-perl libnetaddr-ip-perl libnet-pcap-perl \<br />
libnet-ipv6addr-perl liberror-perl libexception-class-perl \<br />
uml-utilities libxml-libxml-perl libxml2-dev libgnutls-dev \<br />
libdevmapper-dev libterm-readline-perl-perl libnet-telnet-perl \<br />
libnet-ip-perl libreadonly-perl libmath-round-perl libappconfig-perl \<br />
libdbi-perl graphviz libnl-dev genisoimage gnome-terminal<br />
<br />
<!--Note: for Ubuntu 9.04 change "qemu-kvm" package by "qemu kvm" --><br />
<li>If you use 64 bits version of Ubuntu, install 32 bits compatibility libraries:</li><br />
apt-get install ia32-libs<br />
<br />
<li>Install libvirt 0.8.5:</li><br />
/etc/init.d/libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.8.5.tar.gz<br />
tar xfvz libvirt-0.8.5.tar.gz<br />
cd libvirt-0.8.5<br />
./configure --without-xen --prefix=/usr && make && make install<br />
/etc/init.d/libvirt-bin start<br />
<br />
'''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.<br />
<br />
<li>Install Sys::Virt perl module:</li><br />
<ul><br />
<li>For Ubuntu 10.04, just install the libsys-virt-perl package</li><br />
apt-get install libsys-virt-perl<br />
<!--<br />
'''IMPORTANT NOTE''': Windows XP virtual machines started with VNX over Ubuntu 9.10 frequently hang when executing commands or with high traffic loads. The problem could be related with virtual network drivers. We are investigating the problem to find a solution. By now, Ubuntu 10.04 is the recomended platform to test VNX.<br />
--><br />
<li>For Ubuntu 9.10, as Sys::Virt library is not available as a package, install it manually:</li><br />
wget http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.2.3.tar.gz<br />
tar xfvz Sys-Virt-0.2.3.tar.gz <br />
cd Sys-Virt-0.2.3<br />
perl Makefile.PL<br />
make install<br />
</ul><br />
<br />
<li>Install VNX:</li><br />
mkdir /tmp/vnx-update<br />
cd /tmp/vnx-update<br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-latest.tgz<br />
tar xfvz vnx-latest.tgz<br />
cd vnx-*<br />
./install_vnx<br />
<br />
<li>Create the VNX config file (/etc/vnx.conf). You just can move the sample config file:</li><br />
mv /etc/vnx.conf.samble /etc/vnx.conf<br />
<br />
<li>Download root file systems from http://idefix.dit.upm.es/download/vnx/filesystems and copy them to /usr/share/vnx/filesystems directory:</li><br />
cd /usr/share/vnx/filesystems<br />
<br />
# ubuntu server<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.10-v01.qcow2.bz2<br />
bunzip2 root_fs_ubuntu-10.10-v01.qcow2.bz2<br />
ln -s root_fs_ubuntu-10.10-v01.qcow2 root_fs_ubuntu<br />
<br />
# ubuntu with gui<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_ubuntu-10.04-gui-v01.qcow2.bz2<br />
bunzip2 root_fs_ubuntu-10.04-gui-v01.qcow2.bz2<br />
ln -s root_fs_ubuntu-10.04-gui-v01.qcow2 root_fs_ubuntu-gui<br />
<br />
# freebsd server<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-v01.qcow2.bz2<br />
bunzip2 root_fs_freebsd-v01.qcow2.bz2<br />
ln -s root_fs_freebsd-v01.qcow2 root_fs_freebsd<br />
<br />
# freebsd gui<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_freebsd-gui-v01.qcow2.bz2<br />
bunzip2 root_fs_freebsd-gui-v01.qcow2.bz2<br />
ln -s root_fs_freebsd-gui-v01.qcow2 root_fs_freebsd-gui<br />
<br />
# winxp and win7<br />
# Sorry! Unfortunately for legal reasons we cannot distribute windows XP<br />
# or Windows 7 root filesystems. See VNX documentation for detailed recipes<br />
# to create these root fylesystems from scratch<br />
<br />
<li>Additionally, if you plan to use VNUML root filesystem:</li><br />
# VNUML root_fs_tutorial and kernel<br />
cd /usr/share/vnx/filesystem<br />
wget -N http://idefix.dit.upm.es/download/vnx/filesystems/root_fs_tutorial-0.6.0.bz2<br />
bunzip2 root_fs_tutorial-0.6.0.bz2<br />
ln -s root_fs_tutorial-0.6.0 root_fs_tutorial<br />
cd /usr/share/vnx/kernels<br />
wget -N http://jungla.dit.upm.es/~vnx/download/kernels/linux-2.6.18.1-bb2-xt-4m<br />
chmod +x linux-2.6.18.1-bb2-xt-4m<br />
ln -s linux-2.6.18.1-bb2-xt-4m linux<br />
<br />
</ul><br />
<br />
'''NOTE for Ubuntu 10.04.1''': It seems that an additional package has to be installed:<br />
apt-get install kvm-pxe<br />
<br />
=== Additional install steps for Dynamips support ===<br />
<br />
* Install Dynamips and Dynagen:<br />
apt-get install dynamips dynagen<br />
<br />
* Create a file /etc/init.d/dynamips (taken from http://7200emu.hacki.at/viewtopic.php?t=2198):<br />
<pre><br />
#!/bin/sh<br />
# Start/stop the dynamips program as a daemon.<br />
#<br />
### BEGIN INIT INFO<br />
# Provides: dynamips<br />
# Default-Start: 2 3 4 5<br />
# Default-Stop: 0 1 6<br />
# Short-Description: Cisco hardware emulator daemon<br />
### END INIT INFO<br />
<br />
DAEMON=/usr/bin/dynamips<br />
NAME=dynamips<br />
PORT=7200<br />
PIDFILE=/var/run/$NAME.pid <br />
LOGFILE=/var/log/$NAME.log<br />
DESC="Cisco Emulator"<br />
SCRIPTNAME=/etc/init.d/$NAME<br />
<br />
test -f $DAEMON || exit 0<br />
<br />
. /lib/lsb/init-functions<br />
<br />
<br />
case "$1" in<br />
start) log_daemon_msg "Starting $DESC " "$NAME"<br />
start-stop-daemon --start --chdir /tmp --background --make-pidfile --pidfile $PIDFILE --name $NAME --startas $DAEMON -- -H $PORT -l $LOGFILE<br />
log_end_msg $?<br />
;;<br />
stop) log_daemon_msg "Stopping $DESC " "$NAME"<br />
start-stop-daemon --stop --quiet --pidfile $PIDFILE --name $NAME<br />
log_end_msg $?<br />
;;<br />
restart) log_daemon_msg "Restarting $DESC " "$NAME"<br />
start-stop-daemon --stop --retry 5 --quiet --pidfile $PIDFILE --name $NAME<br />
start-stop-daemon --start --chdir /tmp --background --make-pidfile --pidfile $PIDFILE --name $NAME --startas $DAEMON -- -H $PORT -l $LOGFILE<br />
log_end_msg $?<br />
;;<br />
status)<br />
status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $? <br />
#status $NAME<br />
#RETVAL=$?<br />
;; <br />
*) log_action_msg "Usage: $SCRIPTNAME {start|stop|restart|status}"<br />
exit 2<br />
;;<br />
esac<br />
exit 0<br />
<br />
</pre><br />
<br />
* Set execution permissions for the script and add it to system start-up:<br />
chmod +x /etc/init.d/dynamips<br />
update-rc.d dynamips defaults<br />
<br />
* Calculate the idle-pc value for your computer following the procedure in http://dynagen.org/tutorial.htm:<br />
/etc/init.d/dynamips start<br />
dynagen /usr/share/vnx/examples/R.net<br />
<br />
=== Additional install steps for Olive support ===<br />
<br />
Several additional steps are needed to support Olive (Juniper) routers in VNX scenarios:<br />
<br />
<ul><br />
<br />
<!-- Ya no hace falta desde que se usa <qemu:commandline><br />
<br />
<li>Install a patched version of libvirt 0.8.5 with support to define the bios used by a virtual machine:</li><br />
<br />
<ul><br />
<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><br />
<pre><br />
diff -crB libvirt-0.8.5.orig/src/conf/domain_conf.c libvirt-0.8.5/src/conf/domain_conf.c<br />
*** libvirt-0.8.5.orig/src/conf/domain_conf.c 2010-11-22 11:38:08.000000000 +0100<br />
--- libvirt-0.8.5/src/conf/domain_conf.c 2010-11-22 11:47:41.000000000 +0100<br />
***************<br />
*** 4267,4272 ****<br />
--- 4267,4274 ----<br />
if (node)<br />
def->mem.hugepage_backed = 1;<br />
<br />
+ def->biosfile = virXPathString("string(./biosfile[1])", ctxt);<br />
+ <br />
/* Extract other memory tunables */<br />
if (virXPathULong("string(./memtune/hard_limit)", ctxt,<br />
&def->mem.hard_limit) < 0)<br />
diff -crB libvirt-0.8.5.orig/src/conf/domain_conf.h libvirt-0.8.5/src/conf/domain_conf.h<br />
*** libvirt-0.8.5.orig/src/conf/domain_conf.h 2010-11-22 11:38:08.000000000 +0100<br />
--- libvirt-0.8.5/src/conf/domain_conf.h 2010-11-22 11:40:18.000000000 +0100<br />
***************<br />
*** 885,890 ****<br />
--- 885,891 ----<br />
unsigned long min_guarantee;<br />
unsigned long swap_hard_limit;<br />
} mem;<br />
+ char *biosfile;<br />
unsigned short vcpus;<br />
unsigned short maxvcpus;<br />
int cpumasklen;<br />
diff -crB libvirt-0.8.5.orig/src/qemu/qemu_conf.c libvirt-0.8.5/src/qemu/qemu_conf.c<br />
*** libvirt-0.8.5.orig/src/qemu/qemu_conf.c 2010-11-22 11:38:08.000000000 +0100<br />
--- libvirt-0.8.5/src/qemu/qemu_conf.c 2010-11-22 11:41:05.000000000 +0100<br />
***************<br />
*** 3984,3989 ****<br />
--- 3984,3995 ----<br />
ADD_ARG_LIT(emulator);<br />
ADD_ARG_LIT("-S");<br />
<br />
+ if(def->biosfile)<br />
+ {<br />
+ ADD_ARG_LIT("-bios");<br />
+ ADD_ARG_LIT(def->biosfile);<br />
+ }<br />
+ <br />
/* This should *never* be NULL, since we always provide<br />
* a machine in the capabilities data for QEMU. So this<br />
* check is just here as a safety in case the unexpected<br />
</pre><br />
<br />
<li>Install libvirt 0.8.5 with that patch applied:</li><br />
service libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.8.5.tar.gz<br />
tar xfvz libvirt-0.8.5.tar.gz <br />
cd libvirt-0.8.5<br />
patch -p1 -i ../libvirt-0.8.5-biosfile.patch <br />
./configure --without-xen --prefix=/usr && make && make install<br />
service libvirt-bin start<br />
<br />
</ul><br />
--><br />
<li>Download old qemu bios from 0.10.6 version and copy it to /usr/share/qemu directory:</li><br />
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.10.6/qemu-kvm-0.10.6.tar.gz<br />
tar xfvz qemu-kvm-0.10.6.tar.gz<br />
cp qemu-kvm-0.10.6/pc-bios/bios.bin /usr/share/qemu-kvm/bios-0.10.6.bin<br />
<br />
<!-- Not needed, it seems to work without downloading this drivers<br />
<li>Download i82559 ROM from the latest qemu versions (Ubuntu 10.04 does not include that ROM in qemu-kvm package):</li><br />
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.12.5/qemu-kvm-0.12.5.tar.gz<br />
tar xfvz qemu-kvm-0.12.5.tar.gz<br />
cp qemu-kvm-0.12.5/pc-bios/pxe-i82559er.bin /usr/share/qemu-kvm/<br />
--><br />
</ul><br />
<br />
<br />
== Installation over Fedora 11 (Draft) ==<br />
<br />
Follow this steps to install VNX over Fedora 11:<br />
<ul><br />
<br />
<li>Install packages:</li><br />
yum -y groupinstall "Development Tools"<br />
yum install qemu-kvm libvirt virt-manager virt-viewer perl-XML-LibXML<br />
yum install perl-XML-DOM perl-NetAddr-IP perl-Readonly perl-TermReadKey<br />
yum install perl-Net-Pcap perl-Net-IPv6Addr perl-Net-Telnet perl-Error<br />
yum install perl-Exception-Class perl-ExtUtils-MakeMaker tunctl screen wget<br />
yum install libxml2-devel gnutls-devel device-mapper-devel uml_utilities <br />
yum install roxterm xterm graphviz perl-AppConfig<br />
<br />
<li>Install libvirt 0.8.5:</li><br />
/etc/init.d/libvirtd stop<br />
wget http://libvirt.org/sources/libvirt-0.8.5.tar.gz<br />
tar xfvz libvirt-0.8.5.tar.gz<br />
cd libvirt-0.8.5<br />
./configure --without-xen --prefix=/usr && make && make install<br />
/etc/init.d/libvirtd start<br />
<br />
<li>Install SysVirt manually:</li><br />
wget http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.2.4.tar.gz<br />
tar xfvz Sys-Virt-0.2.4.tar.gz<br />
cd Sys-Virt-0.2.4<br />
perl Makefile.PL<br />
make install<br />
<!--<br />
<li> Instalar VNUML sobre Fedora 11 siguiendo la receta en http://www.dit.upm.es/vnumlwiki/index.php/Fedora11</li><br />
<br />
<li> Instalar paquetes y librerías necesarias:</li><br />
yum install qemu-kvm libvirt virt-manager virt-viewer perl-XML-LibXML perl-Sys-Virt<br />
yum -y install bridge-utils readline-devel perl-Module-Build screen expat-devel libpcap-devel <br />
yum -y install perl-Net-Pcap perl-NetAddr-IP perl-Net-IPv6Addr perl-XML-DOM perl-Exception-Class<br />
yum -y install perl-TermReadKey perl-Error perl-CPAN uml_utilities xterm tunctl<br />
<br />
<li>Install XML::Checker perl library:</li><br />
perl -MCPAN -e shell<br />
install XML::Checker<br />
--><br />
<li>Add symbolic link for kvm:</li><br />
ln -s /usr/bin/qemu-kvm /usr/bin/kvm<br />
<br />
<li>Instalar VNX:</li><br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-latest.tgz<br />
tar xfvz vnx-latest.tgz<br />
cd vnx-*<br />
./install-vnx<br />
<br />
<li>Create the VNX config file (/etc/vnx.conf). You just can move the sample config file:</li><br />
mv /etc/vnx.conf.samble /etc/vnx.conf<br />
<br />
<li>Deshabilitar el firewall o, alternativamente, configurar los interfaces tipo "tun" como confiables (Sistema->Firewall->Interfaces Confiables").</li><br />
</ul><br />
<br />
=== Additional install steps for Dynamips support ===<br />
<br />
* Install Dynamips and Dynagen:<br />
wget http://downloads.sourceforge.net/project/dyna-gen/dynamips%20Linux%20RPM/0.2.8-RC2/dynamips-0.2.8RC2-1.i386.rpm<br />
rpm -i dynamips-0.2.8RC2-1.i386.rpm<br />
wget http://downloads.sourceforge.net/project/dyna-gen/dynagen%20source%20_%20Linux/dynagen%200.11.0/dynagen-0.11.0-1.fc9.noarch.rpm<br />
rpm -i dynagen-0.11.0-1.fc9.noarch.rpm<br />
<br />
* Set execution permissions for the script and add it to system start-up:<br />
chkconfig --add dynamips<br />
<br />
* Calculate the idle-pc value for your computer following the procedure in http://dynagen.org/tutorial.htm:<br />
/etc/init.d/dynamips start<br />
dynagen /usr/share/vnx/examples/R.net<br />
<br />
=== Additional install steps for Olive support ===<br />
<br />
Several additional steps are needed to support Olive (Juniper) routers in VNX scenarios:<br />
<br />
<ul><br />
<br />
<li>Download old qemu bios from 0.10.6 version and copy it to /usr/share/qemu directory:</li><br />
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.10.6/qemu-kvm-0.10.6.tar.gz<br />
tar xfvz qemu-kvm-0.10.6.tar.gz<br />
cp qemu-kvm-0.10.6/pc-bios/bios.bin /usr/share/qemu/bios-0.10.6.bin<br />
<br />
</ul><br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<!-- COSAS ANTIGUAS --><br />
<br />
<!--li>Modificar vnumlparser.pl, sustituyendo en la función mode_t la línea en ):</li><br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
<br />
por:<br />
<br />
if (! -e "/dev/net/tun") {<br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
}<br />
<br />
Explicación: el módulo tun se ha integrado en el kernel a partir de la 10.04, por lo que no es necesario cargarlo como hasta ahora mediante "modprobe tun". El cambio anterior simplemente comprueba si existe el dispositivo /dev/net/tun y carga el modulo en caso de que no exista.<br />
--><br />
<br />
<br />
<!--li>Modificar vnumlparser.pl, sustituyendo en la función mode_t la línea en ):</li><br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
<br />
por:<br />
<br />
if (! -e "/dev/net/tun") {<br />
!$execution->execute ($bd->get_binaries_path_ref->{"modprobe"} . " tun") or $execution->smartdie ("module tun can not be initialized: $!");<br />
}<br />
<br />
Explicación: el módulo tun se ha integrado en el kernel a partir de la 10.04, por lo que no es necesario cargarlo como hasta ahora mediante "modprobe tun". El cambio anterior simplemente comprueba si existe el dispositivo /dev/net/tun y carga el modulo en caso de que no exista.<br />
--><br />
<br />
<!--<br />
Pasos a seguir para instalar VNX sobre Ubuntu 9.10. <br />
<br />
'''Nota importante''': se han detectado importantes problemas de prestaciones cuando se utiliza el sistema de ficheros ext4 con Ubuntu 9.10. Por ello, y hasta que se localice el origen de dichas ineficiencias, se recomienda utilizar ext3. <br />
<ul><br />
<br />
<li> Instalar Ubuntu 9.10 y actualizar con:</li><br />
apt-get update; apt-get dist-upgrade<br />
--><br />
<!--<br />
<li>Añadir repositorios VNUML a /etc/apt/sources.lst:</li><br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian binary/" >> /etc/apt/sources.list<br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian-testing binary/" >> /etc/apt/sources.list<br />
--><br />
<!--<br />
<li>Install paquetes básicos de desarrollo, paquetes de virtualización (qemu-kvm, libvirt, vnuml) y librerías y paquetes auxiliares</li><br />
apt-get update<br />
apt-get install build-essential qemu-kvm libvirt-bin libvirt-dev \<br />
virt-manager virt-viewer vlan xterm bridge-utils screen uml-utilities \<br />
libxml-checker-perl libxml-parser-perl libnetaddr-ip-perl libnet-pcap-perl \<br />
libnet-ipv6addr-perl liberror-perl libexception-class-perl libxml-libxml-perl \<br />
libxml2-dev libgnutls-dev libdevmapper-dev libterm-readline-perl-perl <br />
<br />
<br />
<br />
curl vnuml linux-um <br />
<br />
<li>Si se usa la versión de Ubuntu de 64 bits hay que instalar las librerías de compatibilidad de 32 bits:</li><br />
apt-get install ia32-libs<br />
<br />
<li>Install qemu-kvm version 0.12.4 (version 0.11 which comes as apackage in 9.10 provokes hanging problems in Windows virtual machines when executing commands -something relates apparently with mounting cdroms in vms-):</li><br />
wget http://sourceforge.net/projects/kvm/files/qemu-kvm/0.11.1/qemu-kvm-0.11.1.tar.gz/download<br />
tar xfvz qemu-kvm-0.11.1.tar.gz<br />
cd qemu-kvm-0.11.1<br />
./configure --prefix=/usr && make && make install<br />
ln -s /usr/bin/qemu-system-x86_64 /usr/bin/kvm<br />
Editar /etc/modules y añadir:<br />
kvm <br />
kvm_intel<br />
<br />
wget http://sourceforge.net/projects/kvm/files/kvm-kmod/2.6.31.6b/kvm-kmod-2.6.31.6b.tar.bz2/download<br />
<br />
<li>Instalar libvirt 0.8.0:</li><br />
/etc/init.d/libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.8.0.tar.gz<br />
tar xfvz libvirt-0.8.0.tar.gz<br />
cd libvirt-0.8.0<br />
./configure --prefix=/usr && make && make install<br />
/etc/init.d/libvirt-bin start<br />
<br />
<li> Instalar la librería perl de acceso a libvirt (Sys::Virt) desde CPAN (dicha librería no esta disponible como paquete para Ubuntu 9.10):</li><br />
--><br />
<!-- wget http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.2.2.tar.gz<br />
tar xfvz Sys-Virt-0.2.2.tar.gz <br />
cd Sys-Virt-0.2.2<br />
perl Makefile.PL<br />
make install<br />
--><br />
<!--<br />
perl -MCPAN -e "CPAN::Shell->force(qw(install Sys::Virt));"<br />
Nota: constestar YES a la pregunta "Would you like me to configure as much as posible automatically?" y a "Is it OK to try to connect to the Internet?" <br />
<br />
<li>Instalar rootfilesystem de VNUML, enlaces del kernel y crear clave rsa:</li><br />
cd /usr/share/vnuml/filesystems<br />
wget http://www.dit.upm.es/vnuml/download/scripts/root-fs-installer<br />
perl root-fs-installer<br />
cd ../kernels<br />
ln -s linux-2.6.28.10-1m linux<br />
ssh-keygen -t rsa1<br />
<br />
<li>Instalar VNX:</li><br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-0.12b.tgz<br />
tar xfvz vnx-0.12b.tgz<br />
cd vnx-0.12b<br />
./install-vnx<br />
</ul><br />
<br />
Notas:<br />
http://www.ubuntu-es.org/node/128867<br />
175 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-headers-2.6.32-02063209_2.6.32-02063209_all.deb<br />
176 http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-image-2.6.32-02063209-generic_2.6.32-02063209_amd64.deb<br />
177 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-image-2.6.32-02063209-generic_2.6.32-02063209_amd64.deb<br />
178 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.9/linux-headers-2.6.32-02063209-generic_2.6.32-02063209_amd64.deb<br />
--><br />
<br />
<!--<br />
=== Sobre Ubuntu 8.04 ===<br />
<br />
Pasos a seguir para instalar VNX sobre Ubuntu 8.04:<br />
<ul><br />
<br />
<li> Instalar Ubuntu 8.04 y actualizar con:</li><br />
apt-get update; apt-get dist-upgrade<br />
Rearrancar la máquina en caso de que se actualice la versión del kernel.<br />
<br />
<li> Añadir repositorio VNUML a /etc/apt/sources.lst:</li><br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian binary/" >> /etc/apt/sources.list<br />
echo "deb http://jungla.dit.upm.es/~vnuml/debian-testing binary/" >> /etc/apt/sources.list<br />
<br />
<li> Instalar paquetes:</li><br />
apt-get update <br />
apt-get install virt-manager virt-viewer build-essential \<br />
libxml-libxml-perl vncviewer vlan xterm bridge-utils screen \<br />
curl vnuml linux-um libterm-readline-perl-perl zlib-bin zlib1g-dev \<br />
libxen3-dev libxml2-dev libgnutls-dev libsasl2-dev libsdl1.2-dev \<br />
libdevmapper-dev dnsmasq xbase-clients pkg-config<br />
<br />
<li>Si se usa la versión de Ubuntu de 64 bits hay que instalar las librerías de compatibilidad de 32 bits:</li><br />
apt-get install ia32-libs<br />
<br />
<li>Instalar qemu-kvm version 0.11.1 (la version 0.12.2 da errores):</li><br />
wget http://sourceforge.net/projects/kvm/files/qemu-kvm/0.11.1/qemu-kvm-0.11.1.tar.gz/download<br />
tar xfvz qemu-kvm-0.11.1.tar.gz<br />
cd qemu-kvm-0.11.1<br />
./configure --prefix=/usr && make && make install<br />
ln -s /usr/bin/qemu-system-x86_64 /usr/bin/kvm<br />
Editar /etc/modules y añadir:<br />
kvm <br />
kvm_intel<br />
<br />
<li>Instalar libvirt 0.7.6:</li><br />
apt-get install libvirt-bin<br />
/etc/init.d/libvirt-bin stop<br />
wget http://libvirt.org/sources/libvirt-0.7.6.tar.gz<br />
tar xfvz libvirt-0.7.6.tar.gz<br />
cd libvirt-0.7.6<br />
./configure --prefix=/usr --without-storage-disk && make && make install<br />
/etc/init.d/libvirt-bin start<br />
<br />
<li>Instalar librería perl de acceso a libvirt (Sys::Virt) mediante CPAN (no está disponible como paquete ubuntu)</li><br />
perl -MCPAN -e "CPAN::Shell->force(qw(install Sys::Virt));"<br />
Note: answer NO to the question "Are you ready for manual configuration?"<br />
<br />
<li>Instalar rootfilesystem de VNUML, enlaces del kernel y crear clave rsa:</li><br />
cd /usr/share/vnuml/filesystems<br />
wget http://www.dit.upm.es/vnuml/download/scripts/root-fs-installer<br />
perl root-fs-installer<br />
cd ../kernels<br />
ln -s linux-2.6.28.10-1m linux<br />
ssh-keygen -t rsa1<br />
<br />
<li>Instalar VNX:</li><br />
wget -N http://idefix.dit.upm.es/download/vnx/vnx-0.12b.tgz<br />
tar xfvz vnx-0.12b.tgz<br />
cd vnx-0.12b<br />
./install-vnx<br />
</ul><br />
--></div>David