http://studioware.com/wikislax/index.php?title=Compiling_Xen&feed=atom&action=historyCompiling Xen - Revision history2024-03-19T12:34:20ZRevision history for this page on the wikiMediaWiki 1.29.2http://studioware.com/wikislax/index.php?title=Compiling_Xen&diff=54&oldid=prevWikislax: /* Compiling a dom0 Kernel */2018-07-07T04:18:44Z<p><span dir="auto"><span class="autocomment">Compiling a dom0 Kernel</span></span></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;' lang='en'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 04:18, 7 July 2018</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l94" >Line 94:</td>
<td colspan="2" class="diff-lineno">Line 94:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>== Compiling a dom0 Kernel ==</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>== Compiling a dom0 Kernel ==</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Domain-0 (dom0 for short) is a special guest (virtual machine) that the Xen hypervisor always loads on host startup. Dom0 is used to control and manage the Xen hypervisor, and provides virtual disks and networks for other unprivileged guests (=domUs). Dom0 support was introduced in Linux kernel 3.0. The kernel generated must include the .config file domU and [http://wiki.xen.org/wiki/Mainline_Linux_Kernel_Configs#Configuring_the_kernel dom0 options]. Here is a minimal example of such a [{{SERVER}}/<del class="diffchange diffchange-inline">slax</del>/download/config-dom0 .config dom0] file. Feel free to use it as a base, replacing device drivers as required. The rest of the kernel compilation is nominal :</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Domain-0 (dom0 for short) is a special guest (virtual machine) that the Xen hypervisor always loads on host startup. Dom0 is used to control and manage the Xen hypervisor, and provides virtual disks and networks for other unprivileged guests (=domUs). Dom0 support was introduced in Linux kernel 3.0. The kernel generated must include the .config file domU and [http://wiki.xen.org/wiki/Mainline_Linux_Kernel_Configs#Configuring_the_kernel dom0 options]. Here is a minimal example of such a [{{SERVER}}/<ins class="diffchange diffchange-inline">wikislax</ins>/download/config-dom0 .config dom0] file. Feel free to use it as a base, replacing device drivers as required. The rest of the kernel compilation is nominal :</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>  # tar -C /usr/src -xvf linux-4.4.88.tar.bz2</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>  # tar -C /usr/src -xvf linux-4.4.88.tar.bz2</div></td></tr>
</table>Wikislaxhttp://studioware.com/wikislax/index.php?title=Compiling_Xen&diff=19&oldid=prevWikislax: Created page with "{{RightTOC}} == What is Xen ? == [http://wiki.xen.org/wiki/Xen_Overview Xen] is an hypervisor, a thin software layer executing multiple virtual machines, each running its ow..."2017-12-06T21:25:49Z<p>Created page with "{{RightTOC}} == What is Xen ? == [http://wiki.xen.org/wiki/Xen_Overview Xen] is an hypervisor, a thin software layer executing multiple virtual machines, each running its ow..."</p>
<p><b>New page</b></p><div>{{RightTOC}}<br />
<br />
== What is Xen ? ==<br />
<br />
[http://wiki.xen.org/wiki/Xen_Overview Xen] is an hypervisor, a thin software layer executing multiple virtual machines, each running its own operating system. Xen is normally used as a server virtualization platform, running on headless servers without graphical console and controlled through the network. However it is also possible to run Xen on graphical desktops, and with proper hardware virtualization, to dedicate the primary graphics card (and keyboard / mouse) to a virtual machine, making it possible to have high performance full 3D and video acceleration in a virtual machine (see [http://wiki.xen.org/wiki/Xen_VGA_Passthrough Xen VGA Passthru]). Xen is otherwise free and open source.<br />
<br />
== A few quirks ==<br />
<br />
The '''dev86-0.16.21-x86_64-1.txz''' package included with Slackware 14.2 does not afford compiling '''xen-4.9.0''' properly, and must be replaced by '''[{{SERVER}}/wikislax/download/dev86-0.16.17-x86_64-2.txz dev86-0.16.17-x86_64-2.txz]''', that can be found on the Slackware 13.37, 14.0, or 14.1 distribution disks, in directory '''slackware64/d'''. Trying to compile dev86 [http://v3.sk/~lkundrak/dev86/ from source] is not an alternative : dev86 source versions 0.16.18 to 0.16.21 have the same issue compiling xen-4.9.0, and older 0.16.17 does not compile on Slackware 14.2.<br />
<br />
# removepkg /var/log/packages/dev86-0.16.21-x86_64-1.txz<br />
# installpkg dev86-0.16.17-x86_64-2.txz<br />
<br />
Also, the '''grub-2.00''' included with Slackware 14.2 does not afford booting xen. However, getting the latest version '''grub-2.02''' from source does work.<br />
<br />
== Hardware requirements ==<br />
<br />
Xen runs on Intel X86 hardware and requires a processor and motherboard supporting VT-x and optionally VT-d for hardware virtualization. See this [http://www.intel.com/support/motherboards/desktop/sb/cs-030922.htm page] for a list of Intel compatible motherboards and chipsets and this [http://ark.intel.com/ page] for a list of compatible processors. Our system running Xen successfully at the time of this writing (and since June 2012) is based on a DZ77GA70K Intel motherboard, an Intel® Core™ i7-3770 Processor (the overclockable i7-3770 "K" model does not afford virtualization), 32 Gb of PC12800 memory and an MSI GeForce G210 graphics board.<br />
<br />
== Documentation difficulties ==<br />
<br />
Although the software itself works well and is pretty straighforward, good quality Internet information is missing. The volume of information on the Xen wiki is plethoric, but mostly irrelevant as pertaining to old versions of everything. Building the big picture requires interpretation of tiny bits in forum messages, a pretty painful process, although I have to recognize that it worked for me in the end. An alternative is to use one of these old-style information repositories named "books". Yes it is pretty old-fashionned ;) but actually there are good ones on the topic. Here is [http://www.amazon.co.uk/The-Book-Xen-Practical-Administrator/dp/1593271867/ref=sr_1_1?s=books&ie=UTF8&qid=1341037874&sr=1-1 the most recent I found], it is a good value but of course you can find more on [http://www.amazon.co.uk/s/ref=nb_sb_noss_2?url=search-alias%3Dstripbooks&field-keywords=xen&x=0&y=0 amazon(.co.uk)].<br />
<br />
== Software constraints ==<br />
<br />
To make a long story short, at the time of this writing (and since June 2012) working with nVidia graphic boards on Xen and X11 requires the "nouveau" driver. Other drivers like nv or the nVidia proprietary driver do not support Xen and switch off the screen when launched or do not display properly. "Nouveau" requires a fairly recent version of X11. Slackware 13.37 or newer is required. "Nouveau" is available in kernel 3.4.2 upstream and was previously included as a staging driver. Xen dom0 support was included in kernel 3.0. To benefit from both Xen and "Nouveau", the best is to use kernel 3.4.2 upstream.<br />
<br />
== Compiling acpica ==<br />
<br />
Xen requires acpica. [https://www.acpica.org/downloads Download] then install as below :<br />
<br />
# tar -C /usr/local -xvf acpica-unix-yyyymmdd.tar.gz<br />
# cd /usr/local<br />
# chown -R root:root acpica-unix-yyyymmdd<br />
# cd acpica-unix-yyyymmdd<br />
# make<br />
# make install<br />
# cd ..<br />
# rm -r acpica-unix-yyyymmdd<br />
<br />
== Compiling yajl ==<br />
<br />
Xen requires yajl. [http://lloyd.github.io/yajl/ Download] then install as below. <u>Note</u> : there is no option to specify the target library directory so the files need to be moved manually.<br />
<br />
# tar -C /usr/local -xvf lloyd-yajl-x.y.z.66cb08c.tar.gz<br />
# cd /usr/local<br />
# chown -R root:root lloyd-yajl-66cb08c<br />
# cd lloyd-yajl-66cb08c<br />
# ./configure<br />
# make<br />
# make install<br />
# cd ../lib<br />
# mv libyajl* ../lib64<br />
# ldconfig<br />
# cd ..<br />
# rm -r lloyd-yajl-66cb08c<br />
<br />
== Compiling Xen ==<br />
<br />
[http://xen.org/products/xen_source.html Download Xen] from the official [http://www.xen.org xen.org] site. <u>Note</u> : File stubs-32.h is missing in the compiler includes so we add a link to the existing stubs-64.h. Also, some Xen Python scripts are installed in /usr/local/lib64/python-2.7/site-packages which python cannot find so we add links from the standard library as well.<br />
<br />
# cd /usr/include/gnu<br />
# ln -s stubs-64.h stubs-32.h<br />
# cd<br />
# tar -C /usr/local -xvf xen-x.y.z.tar.gz<br />
# cd /usr/local<br />
# chown -R root:root xen-x.y.z<br />
# cd xen-x.y.z<br />
# ./configure --libdir=/usr/local/lib64 --with-initddir=/etc/rc.d<br />
# make world<br />
# make install<br />
# make clean<br />
# cd ../lib64/python2.7/site-packages<br />
# ln -s xen /usr/lib64/python2.7/site-packages<br />
# ln -s xen-3.0-py2.7.egg-info /usr/lib64/python2.7/site-packages<br />
<br />
== Adjusting rc.local* ==<br />
<br />
Xen needs a couple of daemons to run to ensure VM management. Add these lines to rc.local and rc.local_shutdown :<br />
<br />
PATH=/usr/local/sbin:/usr/local/bin:$PATH<br />
export PATH<br />
<br />
# start xencommons<br />
if [ -x /etc/rc.d/xencommons ]; then<br />
/etc/rc.d/xencommons start<br />
fi<br />
<br />
# stop xencommons<br />
if [ -x /etc/rc.d/xencommons ]; then<br />
/etc/rc.d/xencommons stop<br />
fi<br />
<br />
== Compiling a dom0 Kernel ==<br />
<br />
Domain-0 (dom0 for short) is a special guest (virtual machine) that the Xen hypervisor always loads on host startup. Dom0 is used to control and manage the Xen hypervisor, and provides virtual disks and networks for other unprivileged guests (=domUs). Dom0 support was introduced in Linux kernel 3.0. The kernel generated must include the .config file domU and [http://wiki.xen.org/wiki/Mainline_Linux_Kernel_Configs#Configuring_the_kernel dom0 options]. Here is a minimal example of such a [{{SERVER}}/slax/download/config-dom0 .config dom0] file. Feel free to use it as a base, replacing device drivers as required. The rest of the kernel compilation is nominal :<br />
<br />
# tar -C /usr/src -xvf linux-4.4.88.tar.bz2<br />
# cd /usr/local<br />
# rm linux<br />
# ln -s linux-4.4.88 linux<br />
# cd linux<br />
# make menuconfig<br />
# make<br />
# make modules_install<br />
# cp arch/x86_64/boot/bzImage /boot/vmlinuz-4.4.88-dom0<br />
# cp System.map /boot/System.map-4.4.88-dom0<br />
# cp .config /boot/config-4.4.88-dom0<br />
<br />
We're now all set up, Xen is ready to be booted by grub2 !<br />
<br />
<br/><br />
<br />
{{ pFoot |[[Compiling from Source]]|[[Main Page]]|[[Using Grub2]]}}</div>Wikislax