XEN: Difference between revisions

From Braindump
Jump to navigation Jump to search
No edit summary
No edit summary
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
=== XEN Distributions ===
=== XEN Distributions ===
Xen Project (Since 2003, University of Cambridge
{| class="wikitable"
|+
!
!
!
!
!
|-
|2003
|Xen Project
|University of Cambridge
|https://xenproject.org/
|https://xenbits.xen.org/gitweb/
|-
|2007
|Citrix XenServer
|Citrix acquired XenSource
|
|
|-
|2010
|XCP (Xen Cloud Platform)
|Citrix opensource (hypervisor + management)
|
|
|-
|2018
|XCP-ng
|forked from XCP after citrix restrictions.
Xen API (XAPI) / Xen Orchestra
|https://xenproject.org/projects/xcp-ng/
|
|-
|2022
|XenServer
|Vista Equity Partners & Evergreen Coast Capital
acquired Citrix
|https://www.xenserver.com/story
|
|}


Citrix XenServer acquired XenSource in 2007.
XEN is a kernel, booted by GRUB, which can then boot a Linux kernel as Dom0. The first operating system that can control the XEN kernel and boot a privileged virtual machine as DomU. VM's are called domains, which have a name and an id. On the DomU (host), XEN can be controlled on the DomU with the command xe, xm or xl depending on the Xen version. The unprivileged vm's are named Dom0


XCP (Xen Cloud Platform), Citrix opensource (hypervisor + management) between 2010 and 2013.
xl info
xl create /etc/xen/win.hvm
xl list
xl destroy 2


XCP-ng in 2018, forked from XCP.
XEN can emulate devices (HVM) or paravirtualize devices (PV). With PV you need the guest (Dom0) to be aware that it is a virtual machine and have the guest tools with the drivers involved. PV is faster than HVM.


https://wiki.xenproject.org/wiki/Understanding_the_Virtualization_Spectrum
[[File:Xen pv hvm.png|thumb]]




XEN is a kernel, booted by GRUB, which can then boot a Linux kernel as Dom0. The first operating system that can control the XEN kernel and boot other VM's as DomU. The command to control the DomU's can be xe, xm or xl depending on the Xen version. A VM is called a domain, which has a name and an id.


xl info
XEN supports the fully emulated HVM network interface Intel E1000 and Realtek RTL8137C2+, which emulates the hardware, so that the default OS drivers can be used. The interface will appear as vif25.1-emu on the host.


xl create /etc/xen/win.hvm
XEN PV paravirtualized devices (VIF) that use XEN drivers to talk directly to the XEN backends (e.g. XENQEMU) will show up as vif25.0


xl list
vif = ['bridge=lan,model=e1000,rate=10Gb/s','bridge=lan,type=vif']


xl destroy 2
https://wiki.xenproject.org/wiki/Xen_Networking


https://xenbits.xen.org/docs/unstable/man/xl-network-configuration.5.html


XEN can use Fully Emulated HVM from real devices (VIF-EMU), which can use the real drivers, but emulate the hardware, or PV paravirtualized devices (VIF) that use drivers to talk directly to the XEN backends (e.g. XENQEMU). The VIF number corresponds to the domain
https://xenproject.org/resources/downloads/


Drivers are part of the Paravirtualized Tools for XEN
Boot


<nowiki>https://wiki.xenproject.org/wiki/Xen_Networking</nowiki>
XEN uses SeaBios, the default QEMU BIOS, which can also run as payload of coreboot on physical hardware for the initialization of the devices.


<nowiki>https://xenbits.xen.org/docs/unstable/man/xl-network-configuration.5.html</nowiki>
(Default UEFI implementation is Tianocore)


<nowiki>https://xenproject.org/resources/downloads/</nowiki>
https://github.com/xcp-ng/win-pv-drivers/releases


<nowiki>https://github.com/xcp-ng/win-pv-drivers/releases</nowiki>
The drivers are not signed, to install them on windows the testsigning must be switch on, otherwise the driver installation will fail without error message.
 
bcdedit /set testsigning on
 
xl network-list 25
Idx BE Mac Addr.        handle state evt-ch  tx-/rx-ring-ref BE-path
0  0  00:16:3e:5b:b7:e2    0    4    -1    -1/-1          /local/domain/0/backend/vif/25/0
1  0  00:16:3e:4d:95:03    1    4    -1    -1/-1          /local/domain/0/backend/vif/25/1


=== Alpine Linux ===
=== Alpine Linux ===

Latest revision as of 06:04, 14 September 2025

XEN Distributions

2003 Xen Project University of Cambridge https://xenproject.org/ https://xenbits.xen.org/gitweb/
2007 Citrix XenServer Citrix acquired XenSource
2010 XCP (Xen Cloud Platform) Citrix opensource (hypervisor + management)
2018 XCP-ng forked from XCP after citrix restrictions.

Xen API (XAPI) / Xen Orchestra

https://xenproject.org/projects/xcp-ng/
2022 XenServer Vista Equity Partners & Evergreen Coast Capital

acquired Citrix

https://www.xenserver.com/story

XEN is a kernel, booted by GRUB, which can then boot a Linux kernel as Dom0. The first operating system that can control the XEN kernel and boot a privileged virtual machine as DomU. VM's are called domains, which have a name and an id. On the DomU (host), XEN can be controlled on the DomU with the command xe, xm or xl depending on the Xen version. The unprivileged vm's are named Dom0

xl info
xl create /etc/xen/win.hvm
xl list
xl destroy 2

XEN can emulate devices (HVM) or paravirtualize devices (PV). With PV you need the guest (Dom0) to be aware that it is a virtual machine and have the guest tools with the drivers involved. PV is faster than HVM.

https://wiki.xenproject.org/wiki/Understanding_the_Virtualization_Spectrum


XEN supports the fully emulated HVM network interface Intel E1000 and Realtek RTL8137C2+, which emulates the hardware, so that the default OS drivers can be used. The interface will appear as vif25.1-emu on the host.

XEN PV paravirtualized devices (VIF) that use XEN drivers to talk directly to the XEN backends (e.g. XENQEMU) will show up as vif25.0

vif = ['bridge=lan,model=e1000,rate=10Gb/s','bridge=lan,type=vif']

https://wiki.xenproject.org/wiki/Xen_Networking

https://xenbits.xen.org/docs/unstable/man/xl-network-configuration.5.html

https://xenproject.org/resources/downloads/

Boot

XEN uses SeaBios, the default QEMU BIOS, which can also run as payload of coreboot on physical hardware for the initialization of the devices.

(Default UEFI implementation is Tianocore)

https://github.com/xcp-ng/win-pv-drivers/releases

The drivers are not signed, to install them on windows the testsigning must be switch on, otherwise the driver installation will fail without error message.

bcdedit /set testsigning on
xl network-list 25
Idx BE Mac Addr.         handle state evt-ch   tx-/rx-ring-ref BE-path
0   0  00:16:3e:5b:b7:e2     0     4     -1    -1/-1          /local/domain/0/backend/vif/25/0
1   0  00:16:3e:4d:95:03     1     4     -1    -1/-1          /local/domain/0/backend/vif/25/1

Alpine Linux

Alpine Linux downloads come with a XEN ISO that can be used, but using a regulare version can also run XEN

https://wiki.alpinelinux.org/wiki/Xen_Dom0

setup-xen-dom0
apk add xen-hypervisor
apk add bridge
apk add seabios ovmf
echo "xen-netback" >> /etc/modules
echo "xen-blkback" >> /etc/modules
echo "tun" >> /etc/modules
rc-update add xenconsoled
rc-update add xendomains
rc-update add xenqemu
rc-update add xenstored

Contents of /etc/default/grub

GRUB_CMDLINE_XEN_DEFAULT="dom0_mem=1024M,max:1024M" GRUB_DEFAULT="saved" GRUB_SAVEDEFAULT="true"
grub-mkconfig -o /boot/grub/grub.cfg
grub-set-default "$(grep ^menuentry /boot/grub/grub.cfg | grep Xen | cut -d \' -f 2 | head -1)"

efibootmgr -c -d /dev/sda -p 1 -l /EFI/boot/xen.efi -L "XEN"

efibootmgr -o 2,0,4

https://wiki.xenproject.org/wiki/Xen_EFI

https://wiki.archlinux.org/title/xen


https://xcp-ng.org/docs/architecture.html#api

PCI passthrough was indeed necessary for the software I'm using to pick up all network traffic properly (not bridging through the virtual switch). Doing so requires enabling IOMMU and using the legacy linux bridge backend networking (instead of the default Open vSwitch backend networking).

xl network-list opnsense
Idx BE Mac Addr. handle state evt-ch tx-/rx-ring-ref BE-path 
0 0 00:16:3e:3f:4f:61 0 5 -1 -1/-1 /local/domain/0/backend/vif/11/0

https://xenbits.xen.org/docs/4.15-testing/man/xl-network-configuration.5.html

https://wiki.xenproject.org/wiki/Device_Model_Stub_Domains

type=ioemu
vifspec
model=e1000
rate=10Gb/s
vif = ['bridge=lan,model=e1000,rate=10Gb/s']
device_model_stubdomain_override