Category:Virtualization: Difference between revisions

From NixOS Wiki
Klinger (talk | contribs)
little bit expanded to faster find the right link.
Refactor page: split tables, improve introduction
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
This guide page exists to point out resources related to virtualization in the Nix ecosystem.
This category page exists to list resources related to <strong>virtualisation</strong> in the Nix ecosystem.


== NixOS as VM guest ==
== Overview ==
This section is for information about running NixOS as a guest virtual machine.


=== VirtualBox as host ===
You can use the following technologies for classic virtualisation on NixOS. You can also use [[:Category:Container|containers]], though they come with their own advantages and drawbacks.
NixOS.org hosts an [https://nixos.org/download.html#nixos-virtualbox official VirtualBox virtual appliance image] in OVA format. It is also possible to install via install image.  


=== VMware as host ===
* QEMU/KVM (see [[Virt-manager]])
See [[VMware]] for help using VMware to virtualize NixOS.
* [[VirtualBox]]
* [[VMware]]
* The [[Xen Project Hypervisor]]


=== microvm.nix ===
{| class="wikitable"
NixOS on NixOS with configurable virtual machine manager: https://github.com/astro/microvm.nix
|+Installing a hypervisor on the host system.
!Hypervisor
!Code snippet to be added to <code>configuration.nix</code>
|-
|QEMU/KVM
|{{file|configuration.nix|nix|
<nowiki>
{
  virtualisation.libvirtd.enable = true;


== NixOS as a VM host ==
  # if you use libvirtd on a desktop environment
This section covers if you want to run virtual machines from within Nix(OS).
  programs.virt-manager.enable = true; # can be used to manage non-local hosts as well
}
</nowiki>
}}
|-
|Xen Project Hypervisor
|{{file|configuration.nix|nix|
<nowiki>
{
  virtualisation.xen.enable = true;
}
</nowiki>
}}
|-
|VirtualBox
|{{file|configuration.nix|nix|
<nowiki>
{
  virtualisation.virtualbox.host.enable = true;
  users.extraGroups.vboxusers.members = [ "username" ];
 
  # Non-free Extension Pack
  nixpkgs.config.allowUnfree = true;
  virtualisation.virtualbox.host.enableExtensionPack = true;
}
</nowiki>
}}
|-
|VMware
|{{file|configuration.nix|nix|
<nowiki>
{
  virtualisation.vmware.host.enable = true;
}
</nowiki>
}}
|}


=== running VMware host on NixOS ===
{| class="wikitable"
1. In your configuration.nix add the following line
|+Installing the appropriate guest utilities on a virtualised system.
<code> virtualisation.vmware.host.enable = true; </code>
!Hypervisor the guest is running on
!Code snippet to be added to the guest's <code>configuration.nix</code>
|-
|QEMU/KVM
|{{file|configuration.nix|nix|
<nowiki>
{
  services.qemuGuest.enable =true;
  services.spice-vdagentd.enable = true;
}
</nowiki>
}}
|-
|VirtualBox
|{{file|configuration.nix|nix|
<nowiki>
{
  virtualisation.virtualbox.guest.enable = true;
  virtualisation.virtualbox.guest.x11 = true;
}
</nowiki>
}}
|-
|VMware
|{{file|configuration.nix|nix|
<nowiki>
{
  services.xserver.videoDrivers = [ "vmware" ];
  virtualisation.vmware.guest.enable = true;
}
</nowiki>
}}
|-
|microvm.nix
|Consult the [https://astro.github.io/microvm.nix/ MicroVM.nix documentation]


2. reboot
[[Category:Software]]
 
[[Category:Desktop]]
=== running VirtualBox host on NixOS ===
[[Category:Server]]
See [[VirtualBox]] for more.
 
=== running QEMU/KVM host on NixOS ===
See [[Virt-manager]]
 
 
[[Category:Guide]]
[[Category:Virtualization]]

Latest revision as of 22:15, 27 October 2024

This category page exists to list resources related to virtualisation in the Nix ecosystem.

Overview

You can use the following technologies for classic virtualisation on NixOS. You can also use containers, though they come with their own advantages and drawbacks.

Installing a hypervisor on the host system.
Hypervisor Code snippet to be added to configuration.nix
QEMU/KVM
configuration.nix
{
  virtualisation.libvirtd.enable = true;

  # if you use libvirtd on a desktop environment
  programs.virt-manager.enable = true; # can be used to manage non-local hosts as well
}
Xen Project Hypervisor
configuration.nix
{
  virtualisation.xen.enable = true;
}
VirtualBox
configuration.nix
{
  virtualisation.virtualbox.host.enable = true;
  users.extraGroups.vboxusers.members = [ "username" ];
  
  # Non-free Extension Pack
  nixpkgs.config.allowUnfree = true;
  virtualisation.virtualbox.host.enableExtensionPack = true;
}
VMware
configuration.nix
{
  virtualisation.vmware.host.enable = true;
}
Installing the appropriate guest utilities on a virtualised system.
Hypervisor the guest is running on Code snippet to be added to the guest's configuration.nix
QEMU/KVM
configuration.nix
{
  services.qemuGuest.enable =true;
  services.spice-vdagentd.enable = true;
}
VirtualBox
configuration.nix
{
  virtualisation.virtualbox.guest.enable = true;
  virtualisation.virtualbox.guest.x11 = true;
}
VMware
configuration.nix
{
  services.xserver.videoDrivers = [ "vmware" ];
  virtualisation.vmware.guest.enable = true;
}
microvm.nix Consult the MicroVM.nix documentation