Xen Project Hypervisor: Difference between revisions

m Minor MoS edits
Use {{file}} instead of syntaxHighlight.
Line 7: Line 7:
Since [https://nixos.org/manual/nixos/unstable/release-notes#sec-release-24.11-highlights NixOS 24.11], installing the Xen Hypervisor is as simple as adding the following to your [[Overview_of_the_NixOS_Linux_distribution#Declarative_Configuration|NixOS configuration]]:
Since [https://nixos.org/manual/nixos/unstable/release-notes#sec-release-24.11-highlights NixOS 24.11], installing the Xen Hypervisor is as simple as adding the following to your [[Overview_of_the_NixOS_Linux_distribution#Declarative_Configuration|NixOS configuration]]:


<syntaxHighlight lang=nix>
{{file|configuration.nix|nix|
<nowiki>
{
{
   virtualisation.xen.enable = true;
   virtualisation.xen.enable = true;
}
}
</syntaxHighlight>
</nowiki>
}}
{{Evaluate|boot}}
{{Evaluate|boot}}


Line 27: Line 29:
There are many options available for configuring the Domain 0. Here is a recommended non-default configuration:
There are many options available for configuring the Domain 0. Here is a recommended non-default configuration:


<syntaxHighlight lang=nix>
{{file|configuration.nix|nix|
<nowiki>
{
{
   virtualisation.xen = {
   virtualisation.xen = {
Line 43: Line 46:
   };
   };
}
}
</syntaxHighlight>
</nowiki>
}}


{{Security Warning Low Priority|Some option combinations are known to cause security vulnerabilities that may be exploited to cause a denial of service attack. That said, the assertions system present in the <code>xen-dom0.nix</code> module <b>will prevent you from evaluating a known-unsafe configuration.</b>|heading=Some configurations may cause a system to become vulnerable to known security issues.}}
{{Security Warning Low Priority|Some option combinations are known to cause security vulnerabilities that may be exploited to cause a denial of service attack. That said, the assertions system present in the <code>xen-dom0.nix</code> module <b>will prevent you from evaluating a known-unsafe configuration.</b>|heading=Some configurations may cause a system to become vulnerable to known security issues.}}
Line 51: Line 55:
Currently, unprivileged domains can only be created/destroyed imperatively. See the usual [https://xenbits.xenproject.org/docs/unstable/ Xen documentation] for more specific usage information. To get you started, here's an example Xen configuration file that can produce a fully virtualised domain:
Currently, unprivileged domains can only be created/destroyed imperatively. See the usual [https://xenbits.xenproject.org/docs/unstable/ Xen documentation] for more specific usage information. To get you started, here's an example Xen configuration file that can produce a fully virtualised domain:


<syntaxHighlight lang=cfg>
{{file|example-hvm.cfg|cfg|
<nowiki>
name='example-domain'
name='example-domain'
memory='2048'
memory='2048'
Line 58: Line 63:
disk=[ '/path/to/where/you/want/to/store/the/virtual/disk.qcow2,qcow2,hda,w', 'file:/path/to/a/nixos-installation.iso,hdc:cdrom,r']
disk=[ '/path/to/where/you/want/to/store/the/virtual/disk.qcow2,qcow2,hda,w', 'file:/path/to/a/nixos-installation.iso,hdc:cdrom,r']
boot='cd'
boot='cd'
</syntaxHighlight>
</nowiki>
}}


See {{man|xl.cfg|sec=5}} for more configuration options.
See {{man|xl.cfg|sec=5}} for more configuration options.
Line 64: Line 70:
You can then start the domain using the following command:
You can then start the domain using the following command:


{{Commands|# xl create /path/to/the-above-config-file.cfg -Fc}}
{{Commands|# xl create /path/to/example-hvm.cfg -Fc}}


== See also ==
== See also ==