nyuuzyou/wikis huggingface dataset:
Linux PVH

= PVH and Linux =
The only things needed to make this work as PVH are:
* Get the latest version of Xen (4.10 at least) and compile/install it. See for details
* Get the latest version of Linux (or a reasonable recent one, at least 4.11 is required), see for details. The steps are:
 cd $HOME
 git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
 cd linux
* Compile with CONFIG_XEN_PVH=y:
** Based on your current distro.
 cp /boot/config-`uname -r `$HOME/linux/.config
 make menuconfig
Where one will select Processor type and features ---> Linux guest support --->Support for running as a PVH guest
This entry requires Processor type and features ---> Linux guest support --->Xen PVHVM guest support to be set.
** Or from scratch:
 make localmodconfig
You should see:
"Support for running as a PVH guest (XEN_PVH) [N/y]"
In case you missed it:
 make menuconfig
Processor type and features ---> Linux guest support --->
Xen guest support (selecting that will now show you):
Support for running as a PVH guest
** If you prefer to edit .config, these should be enabled:
 CONFIG_HYPERVISOR_GUEST=y
 CONFIG_PARAVIRT=y
 CONFIG_PARAVIRT_GUEST=y
 CONFIG_PARAVIRT_SPINLOCKS=y
 CONFIG_XEN=y
 CONFIG_XEN_PVHVM=y
 CONFIG_XEN_PVH=y
You will also have to enable the block, network drivers, console, etc which are in different submenus.
* Install it. Usually doing:
 make modules_install && install
is suffice. It should generate the initramfs.cpio.gz and the kernel and stash them in /boot directory.
* Launch it with type="pvh" in your guest config (for example):
 extra="console=hvc0 earlyprintk=xen initcall_debug debug"
 kernel="/boot/vmlinuz-4.14+"
 ramdisk="/boot/initramfs-4.14+.cpio.gz"
 memory=1024
 vcpus=4
 name="pvh"
 vif = [ 'mac=00:0F:4B:00:00:68' ]
 vfb = [ 'vnc=1, vnclisten=0.0.0.0,vncunused=1']
 disk=['phy:/dev/sdb1,xvda,w']
 type="pvh"
 on_reboot="preserve"
 on_crash="preserve"
 on_poweroff="preserve
using 'xl'. Xend 'xm' does not have PVH support.
= Items not supported by PVH =
* PCI pass through (as of Xen 4.10)
= Items that have not been tested extensively or at all: =
* Running it in dom0 mode (as the patches for that are not yet in Linux upstream).
== Things that are broken: ==
If you encounter errors, please email with the following (please note that the guest config has on_reboot="preserve", on_crash="preserve" - which you should have in your guest config to contain the memory of the guest):
* xl dmesg
* xl list
* xenctx -s $HOME/linux/System.map -f -a -C <domain id>
(xenctx is sometimes found in /usr/lib/xen/bin/xenctx)
* The console output from the guest
* Anything else you can think off.
to xen-devel@lists.xenproject.org
Stash away your vmlinux file (it is too big to send via email) - as we might need it later on.
That is it!
Thank you!
Category:UsersCategory:Xen 4.11Category:Xen 4.10Category:Xen 4.9Category:Xen 4.8Category:Test Day
LiveCD

Using a Xen Project LiveCD is a great way to start using the software. If you have read about Xen Project, but are unsure if it is for you, you can use a LiveCD to roadtest the features of the software, without writing to persistent storage. This lets you decide if the Xen Project hypervisor is the solution for you, before doing any harddisk partitioning, or formatting. Just remember not to spend too long configuring, as changes are lost when the server is restarted!
The Xen Project LiveCD is now unmaintained, and slightly out-of-date. Some features of the current release are not included in the LiveCD, however it can still be a useful starting point.
* Alpine Linux Xen Project 4.x Live CD (also see xen-users and Alpine Linux Xen Project LiveCD wiki page )
* Live CD (Xen 3.2 + Debian 5.0)
* Fedora Live CD with Xen Project 4.4 announcement and pointer
Category:Xen
Category:Users
Category:Host Install
Category:Debian
Category:Alpine Linux
Category:Fundamentals
Making it easier to install VMs on XCP

Note: this has been superseded by adding support to packer and vagrant
Installing a linux VM on XCP requires the following steps:
# Clone a template
# Add a CDROM or a VIF
# Tweak some VM.other_config:parameters (e.g. to include the exact URL of an install repo)
# Manipulate the VBD.bootable flags
# Answer the VM installer's questions
Ideally we would have
* Fewer steps (more sensible defaults)
* More tolerance to user error (e.g. if the network URL isn't perfect, use a heuristic to find the install files)
Here's an example showing how to install CentOS6:
* CentOS 6 Virtual Machine installation on Xen
= Ideas for improvement =
# Add a VIF to our default templates to the main management network. This would make network installation easier.
# If no network install URL is provided, fall back to a known good one
## Even better would be to use a tool like Debian netselect to choose a good one
# If a network install URL is provided but it slightly wrong (typical failure would be to point at a subdirectory by mistake), attempt to auto-correct it
# If a CDROM is attached, attempt to detect the install files and work out what kind of system it is (debianlike or rhlike)
# Allow the user to request an auto-install via an answerfile or preseed file
## Even better would be to serve-up default answerfiles from the system
;Getting away from eliloader
Some operating systems (Debian Lenny/Squeeze/Wheezy, Ubuntu ~L,M,N,O, OpenSuse) can be easily installed via pre-shipped initrd (netinst) and kernel. This will:
# Reduce all operations with other-config:install-repository
# Allow to install operating systems without internet connectivity between dom0 and internet (note: guests can have it, but dom0 no more), this will make isolation of management network more reliable (Someone ether though about attack on dom0 via bad initrd, f.e. very big to eat all dom0 disk space?).
# Simplify steps to start VM
# elilo can be used for other templates (like older rhel with initrd patching).
;Allow local console for PV-guests.
When user make xe vm-start for initially created vm from special template, we can do following:
# disable vnc console for initial startup (one time)
# run VM on host where command was entered (will not work with remote xe)
# do xl console for VM domain.
User expirience will be very nice: xe vm-install template=BoBoBo, xe vm-start, and user got console of installing virtial machine.
= Measuring the improvements =
# Count the number of characters you need to type to install a particular guest type (eg Debian 6.0). Lower is better.
Category:XAPI Devel
Migration

= Performing VM migration under Xen =
Xen can migrate virtual machines between different servers, running Xen. This can be useful if you need to take a physical server offline, for maintenance. Rather than having to shutdown the VMs running on that host during the maintenance, you can migrate them to another physical server, and keep them running. Performing a migration does not require restarting the virtual server, and has no noticeable downtime.
== Setup ==
The persistent storage for the VMs must be shared, so that both Dom0s can see the same disk, at the same location.
Then run `xl migrate <domain> <host>` to migrate the VM
== Migrate without shared storage ==
If you have no real shared storage (eg SAN) available, you can still test VM migration, using NBD. This allows you to share the harddrive of one host with another. The disadvantage of this is that whilst you can migrate the VM, you cannot shutdown the host that contains the storage.
* Install nbd-client on all Dom0s you will migrate between (apt-get install nbd-client on Debian-based distros)
* Install nbd-server (apt-get intall nbd-server) on the Dom0 of the machine that contains the storage
* Add the following to /etc/nbd-server/config
[<name>]
 exportname = <path to disk to share>
 port = 9000
* Run `nbd-client 127.0.0.1 9000 /dev/nbd1` on the same machine
* Run `nbd-client <hostname of machine that contains the storage> 9000 /dev/nbd1` on the machine you are migrating to
* Modify your /etc/xen/foo.cfg file to use /dev/nbd1 as its disk, on the host backing the storage
* Start the VM
* Run `xl migrate <Domain> <new host>`
== Additional Information ==
* A good external article from the SUSE SLES 12 manual
Category:Users
Category:Xen
Category:HowTo
Mini-OS

Mini-OS is a tiny OS kernel distributed with the Xen Project Hypervisor sources. It is mainly used as operating system for stub domains that are used for Dom0 Disaggregation. But it is also used as a basis for development of Unikernels, having been instrumental in the formation of multiple examples including ClickOS and Rump kernels.
As of March 2015 mini-os now has its own git tree. Previously (release 4.5.0 and earlier) it was part of xen.git in the extras/mini-os subdirectory.
Also See
* A tour of Mini-OS
* Mailing list
* Code
* README file in the mini-os source tree.
Category:Xen
Category:Glossary
Category:Unikernels
Category:Minios
Minimal-init

This script is relevant to Xen ARMv7 with Virtualization Extensionsdevelopment. In order to make your Dom0 boot sequence faster on a Versatile Express, you might want to consider passing init=/bin/bash to your kernel and then manually executing this minimal init script.
 #!/bin/bash
 
 mount /proc
 mount -t xenfs xenfs /proc/xen
 mknod /dev/xen/evtchn c 10 61
 mknod /dev/xen/privcmd c 10 59
 mknod /dev/xen/gntdev c 10 60
 mknod /dev/xen/xenbus_backend c 10 62
 mknod /dev/xen/xenbus c 10 63
 mknod -m660 /dev/loop0 b 7 0
 mount -t sysfs sysfs /sys
 mkdir -p /dev/pts
 mount -t devpts devpts /dev/pts
 
 export LD_LIBRARY_PATH=/usr/local/lib
 
 echo "Starting Xenstored"
 xenstored -T /root/xenstored.log &>/root/xenstored.out
 echo "Xenstored started"
 
 echo "Starting xenconsoled"
 xenconsoled -i &
 echo "Xenconsoled started"
 
 echo "Setting up loop0"
 losetup /dev/loop0 /root/guestfs
 losetup -a
 
 echo "Writing dom0 name to xenstore"
 /usr/bin/xenstore-write "/local/domain/0/name" "Domain-0"
 echo "Done"
Category:XenARM
Category:Developers
MirageOS

MirageOS is a library operating system that constructs unikernels for secure, high-performance network applications across a variety of cloud computing and mobile platforms.
MirageOS applications are written in OCaml and compiled into a complete image that can be run on Xen. The libraries include a network stack, http, and a complete SSL library, and Irmin, a distributed git-like data store.
MirageOS is an official Xen Project incubator project.
Code is released under the ISC license, with some code released under LGPLv2.
==Resources==
* The primary website is mirage.io.
* Developer information can also be found at Mirage page index
* Source code is on github. 
Category:Unikernels
Category:Mirage
Category:OCaml
Mirage architecture

The following diagram shows the main Mirage components:
* mirage: the low-level mirage "platform". This contains the code needed to boot on Unix, xen, kFreeBSD and in a browser. This package defines the common interfaces supported on all environments, for example the concept of "time". The xen netfront driver lives here, but blkfront does not. There is a proposal to move xen netfront to another repository.
* mirari: a build and deployment helper tool. To see examples using mirari, look at the mirage-skeleton repository.
* mirage-net: the mirage network stack. This contains both "socket" and "direct" implementations of ethernet, DHCP, TCP/IP. The "socket" interfaces will use an existing Unix OS socket interface, while "direct" implements everything on top of a system (such as xen netfront or Unix tuntap) supporting "frame send" "frame receive" primitives
* blkfront: the mirage xen block driver ("blkfront"). This uses the standard xen shared memory protocol to read and write blocks from a disk "backend".
* cohttp: an HTTP/1.1 client and server library
* dns: an implementation of the DNS protocol
* irminsule: a distributed filesystem and block store that follows the same design principles as Git
Mirage split netfront

The base mirage repository should contain the minimum amount of code to boot a controllable kernel/process on xen/Unix. At the moment it also contains the xen netfront driver: we should remove this into a separate library which can be used both by Mirage and also standalone (e.g. for testing). The block driver has already been removed successfully.
Once netfront has been removed, there will only be a few minor dependencies on xenstore left in the base repo, which will also be fairly easily removed.
Category:Mirage Devel
NUMA node affinity in the Xen hypervisor

= Setting a Domain’s node affinity =
By default, on creation Xen domains have the Xen hypervisor feature flag `auto_node_affinity` enabled.
It automatically deduces and updates the domain's NUMA `node_affinity` to the vCPUs its vCPUs are affine to.
The buddy allocator of the Xen hypervisor uses the domains node_affinity
to select the NUMA node(s) it prefers to allocate from, unless it was passed a specific NUMA node to allocate from.
For more details, see:
https://xapi-project.github.io/new-docs/lib/xenctrl/xc_domain_node_setaffinity/
== See also ==
* Improved NUMA memory allocation
** NUMA node-specifc memory allocation
** Walkthrough: VM build using xenguest
Category:NUMA
Category:NUMA Initiatives 2025
Category:Resource Management
NagiosXCP

Nagios can already be used to directly monitor the XCP dom0 host's external services, however, if you wish to do more than just ping the dom0 host, you can install Nagios NRPE on the XCP dom0 directly.
Please note the below instructions are not perfect as they don't necessarily install all the dependency packages needed by all of the available Nagios plugins (e.g. SNMP libraries, etc).
=Disable iptables=
XCP comes with iptables installed and enabled by default. You will either need to explicitly enable the services in iptables that you would like to allow through (e.g. NRPE port 5666), or if your system is already secure behind a firewall, you can completely disable iptables like this:
/etc/rc.d/init.d/iptables stop
chkconfig --del iptables
=Install NRPE=
A quick install for NRPE and the nagios plugins can be done like this:
#packages for 32-bit centos5
wget http://pkgs.repoforge.org/fping/fping-2.4-1.b2.3.el5.rf.i386.rpm http://pkgs.repoforge.org/nagios-plugins/nagios-plugins-1.4.15-2.el5.rf.i386.rpm http://pkgs.repoforge.org/nagios-nrpe/nagios-nrpe-2.12-1.el5.rf.i386.rpm
rpm -ivh fping-2.4-1.b2.3.el5.rf.i386.rpm
rpm -ivh nagios-plugins-1.4.15-2.el5.rf.i386.rpm --nodeps
rpm -ivh nagios-nrpe-2.12-1.el5.rf.i386.rpm
=Allow sudo commands=
Some of the custom plugins I use require sudo, so I chose to enable running all plugins as root. This is a security risk and so should only be done if needed.
visudo
# Comment out the line for "Defaults requiretty"
# Add the line "nagios ALL=(ALL) NOPASSWD: /usr/lib/nagios/plugins/"
vi /etc/nagios/nrpe.cfg
# Enable the line for command_prefix with sudo
# Modify the commands as you would like, in particular I added the disk check:
# "command[check_disk1]=/usr/lib/nagios/plugins/check_disk -w 10% -c 5% -p /dev/sda1"
# Modify allowed_hosts to enable access from your Nagios machine: e.g. "allowed_hosts=192.168.1.20"
chkconfig --add nrpe
service nrpe start
=References=
* http://timg.ws/2010/01/12/installing-nrpe-for-nagios-monitoring/
Category:Users
Category:XCP
Category:HowTo
Networking with the XAPI toolstack

The script for installing a Linux VM on Kronos provides for basic networking support.
To get networking working for Windows, you'll need to set up the bridge manually:
 brctl addbr xenbr0
 brctl addif xenbr0 eth0
You may need to move the IP address to the bridge rather than the physical interface. Having done this, try a pif-scan:
 xe pif-scan
This should create the network for your interface.
After that you can (not sure if this is necessary) configure management interface. Because we already do have configured interface, it just saying XCP real situation around.
 xe pif-reconfigure-ip pif-uuid=... mode=static IP=... mask=... gateway=... DNS=...
 xe host-management-reconfigure pif-uuid=...
After scan and configuring it better to reboot to change status (plugged) to actual state of interface.
Category:XAPI
Category:Users
Category:Networking
NewToXen

.
__NOTOC__
= New To Xen =
This wiki page is for people looking for introductory material to the Xen community and various Xen products (projects). 
== General Information ==
* General Overview
* Xen Frequently Asked Questions
* Information for Beginners
== Xen in Action ==
* Examples of open source Xen running in global production environments 
* Xen vs. XCP
** Xen is a source code distribution (a bit like the Linux Kernel)
** If you want to use binaries, use XCP and XCP on xen.org instead of Xen. XCP can be installed from either an ISO, which contains Xen, Linux binaries and the XenAPI toolstack, or as a managed package on Debian, and Ubuntu,
== Xen Hypervisor ==
* Xen Try the Xen hypervisor without installation using the LiveCD - Note that there is no Live CD for Xen 4.x - We are looking for volunteers to put one together!
* Xen Books
== Paid Support and Providers ==
See Vendors, Projects and Commercial Users of Xen
== Downloads ==
* Xen Archives (these are source releases)
* XCP Archives (these are binary distributions)
== Technology ==
* Compatibility Lists
* Dom0 distro compatibility list and appropriate links
* DomU distro compatibility list and appropriate links
* Documentation pitched at Beginners
* FAQs: The majority of these are grouped by topic, but XenCommonProblems and XenUsersQuestions contain ungrouped questions. Have a look there, if you do not find an answer to your question.
* HOW TOs: How to examples on a variety of xen instllations
* Tutorials: Tutoprials on specific topics
* Examples: Examples (a bit rough on the edges)
== Community ==
* Links to documentation
* Links to resources where to get help
* Xen.org open source governance (also see Category:Developers
* Trademark and logos
* Jobs in the Community
Category:Beginners
Category:Overview
New Panda Mascot Artwork

Suggestions should be simply added to the talk page.
== New Panda Flying in Clouds ==
File:Panda-flying-in-the-clouds.jpg‎ ‎
File:Panda-flying-in-the-clouds-with-clouds-large.png‎
== Other new Panda's ==
I uploaded some small concepts here for now. More artwork in images.
== Existing Sitting Panda and Xen Fu Panda ==
The existing Panda and Logo assets are available here:
http://xen.org/community/logos.html
Several blog posts have been written about the first two panda mascots.
http://blog.xen.org/?s=mascot
Category:Community
OCaml Cyclical Build Dependencies

This page provides some suggestions for how to resolve cyclic build dependencies.
=== Symptom ===
OMake gives an error like the following:
*** omake: deadlock on a.cmx
*** omake: is a dependency of b.cmx
*** omake: is a dependency of a.cmx
=== Problem ===
You have a cyclic dependency between your modules, so OMake cannot find a linear order of compilation.
For example, the following set of modules exhibits this problem:
 a.ml
let bar () = ()
let foo () = B.bar ()
let gip () = bar ()
 b.ml
let bar () = A.bar ()
The edges in the call graph are:
A -> B
B -> A
which is cyclic.
=== Possible Solutions ===
Here are some potential ways around the problem.
==== Avoid the situation by careful design ====
Design the interfaces between modules such that there is a directed, acyclic flow in the graph of modules where edges are function calls. In the example above, the call back from module B to module A would be disallowed.
For example, in our codebase, we have ocaml/xapi/xapi.ml as the "main" module, calling functions in other modules: those modules should never contain functions which call functions back in ocaml/xapi/xapi.ml.
However, sometimes this approach is not possible if you are adding extra functionality to existing code.
==== Move a function into a new file ====
A potential solution is to move a function into a separate module to break the cyclic dependency. The fix to the example above would be:
 a_bar.ml
let bar () = ()a.ml
let foo () = B.bar ()
let gip () = A_bar.bar ()
 b.ml
let bar () = A_bar.bar ()
The edges in the call graph are now
A -> B
A -> A_bar
B -> A_bar
which is acyclic.
==== Pass the function in as a parameter ====
By passing the "callback" function as a parameter, there is no need for the reverse link in the call graph, breaking the cyclic dependency. The fix to the example above would be:
 a.ml
let bar () = ()
let foo () = B.bar bar
let gip () = bar ()
 b.ml
let bar f = f ()
The edges in the call graph are now
A -> B
which is acyclic.
==== Using functors ====
In some situations, you need to pass a lot of "callback" functions and maybe also type declarations. In this case, it could be useful to use functors.
 a.ml
let bar () = ()
let gip () = bar ()
module type B_sig = sig val bar : unit -> unit end
module A (B : B_sig) = struct
let foo () = B.bar ()
end
 b.ml
module B = struct let bar () = A.bar () end
module A = A(B)
let bar = B.bar
The edges in the call graph are now
B -> A
which is acyclic.
However, in this very simple example, it is not really a good idea to use functors 
==== Using global references ====
Warning: this is a very ugly solution, try to not use it, but sometimes there are no other ways, so .... (and it is used inside the source code of xapi).
 a.ml
let bar () = ()
let _ = B.bar := bar
let foo () = !B.bar ()
let gip () = bar ()
 b.ml
let bar = ref (fun () -> ())
The edges in the call graph are now
A -> B
which is acyclic.
Category:OCaml
Category:XAPI Devel
OCaml Installation Advice

=== Editable Top-Level ===
OCaml provides a top-level (entered by running "ocaml") which is an excellent way to test code snippets. However, the ordinary interface lacks any editing features. This is most easily remedied using the ledit program by adding:
alias ocaml="ledit ocaml"
to your startup scripts.
=== Emacs ===
==== Tuareg-mode ====
Although the OCaml distribution provides a simple editing mode for emacs, the Tuareg mode is better in many ways, including reliability.
==== Type Throwback ====
Types in ML programs are almost always inferred by the ML compiler. This greatly improves brevity but the lack of type information can be a hindrance to the programmer when developing software in ML. OCaml addresses this issue by providing a mechanism for type throwback. To use type throwback with emacs you can install the ocaml-mode package and then compile your code using the -dtypes compiler option. The key combination C-c C-t then brings up the inferred type of the current subexpression.
=== Eclipse ===
ocaIDE is a nice ocaml pluggin for Eclipse. You can go to the definition of any function in holding CTRL + left click. You can also have code auto-completion with CTRL+SPACE.
Category:OCaml
Category:XAPI Devel
OCaml Resources

This page contains links to useful external resources related to OCaml.
* OCaml book by O'Reilly
* OCaml Tutorial for C/Java Programmers
* CalTech Course on OCaml - pdf
* How OCaml Works from Theory to Practice (ADVANCED) - pdf
* Testing - http://caml.inria.fr/cgi-bin/hump.en.cgi?sort=0&browse=115
** FORT: Framwork for Ocaml Regression Testing 
** OCaml-Benchmark: small module to benchmark running times of code.
** OUnit: unit test framework for Ocaml. Based on HUnit, unit testing framework for Haskell. 
Category:OCaml
Category:XAPI Devel