Talk:Xen

From ArchWiki

Information about compiling Xen with EFI support.

[1]

The information in the first post of the link is very useful and should be implemented here.

AlgoJerViA (talk) 21:50, 6 August 2014 (UTC)Reply[reply]

Good find! Just go ahead and edit the article :)
axper (talk) 15:43, 7 August 2014 (UTC)Reply[reply]
TaaDaa!!! :)
AlgoJerViA (talk) 13:10, 12 August 2014 (UTC)Reply[reply]
Nice, AlgoJerViA. Just to confirm: Do you run the setup as described? I am asking because I don't and some comments in above bbs-thread you link indicate problems that might be necessary to address in the wiki (if they are of a general nature): [2]
--Indigo (talk) 18:16, 14 August 2014 (UTC)Reply[reply]
Well, I actually don't because I can't get my Nvidia GTX 750 Ti to work with Xorg. But I have booted the setup described though I have not explored it in detail yet. Also I think that the problem mentioned in the last post that "... Xen in UEFI because Xen couldn't pass Dom0 the EFI variables" might be true but I didn't see this as a fatal error. It was not possible to mount the EFI partition or run efivars but as far as I understand this is only important if I wish to make changes to the UEFI boot. And since I allways can both the arch directly without Xen anyway I did ignore it. Maybe I have missed something important and EFI comes into effect at runtime too, I guess it likely could affect power management or so. Also thanks for the cleanup, I'm not native to english so I know it was needed. The only thing I thought about was this sentence "It is located in /usr/lib/efi/xen-?.?.?.efi where "?" represent the version digits.", should it not be at instead of in or a rewrite that it is in the folder. Now I read it sort of as it would be located in itself. :)
AlgoJerViA (talk) 19:44, 14 August 2014 (UTC)Reply[reply]
True, at now. For the other point: I reckon it is fine then, since you set it up like that (X or not; that would be another section anyhow). I asked because I saw the bbs OP pointed to changes in recent kernels. But for efivars there appear to be so many problematic bios implementions, could be many things that caused the problem in the thread. If it is a general issue, someone will add here. --Indigo (talk) 20:40, 14 August 2014 (UTC)Reply[reply]
The part with the need of an older version of binutils is outdated. it works with the actual version (2.26-3). simply delete that part of the uefi section or how should I edit this? --Jazzlyn (talk) 08:46, 6 May 2016 (UTC)Reply[reply]
Just delete the out of date info should be enough here. --Fengchao (talk) 06:56, 29 August 2016 (UTC) Reply[reply]

some things on the current page aren't really clear

  • "The standard arch kernel can be use to boot the domUs."

So, domUs can use the standard kernel?

  • "In order for this to work one must add 'xen-blkfront' to the modules array in /etc/mkinitcpio.conf"

On the domUs?

  • "The basic idea behind adding a domU is as follows. We must get the domU kernels (...)"

BUT one can also use a standard archlinux kernel? Maybe there is an inconsistency.

Secondly

  • Maybe someone more experienced can explain how to use encrypted (LUKS) filesystems with xen;
  • Maybe someone more experienced can add a section on how to use other OSs like Microsoft® Windows&trade.
  • I opt to delete the alternative installation method because experienced users can figure this stuff out for themselves and it might be horribly outdated;

-- Voidzero 16:54, 7 May 2010 (EDT)

Thirdly

This is incorrect - was stated before to be a frontend for Xen - it is NOT - it is a frontend for xenserver by citrix

this is also not for xen directly - it is for xen cloud platform which is something different afaik

  • xvpAUR is web interface and vnc proxy.

After installing xvp, you need to generate /etc/xvp.conf with xvpdiscover tool and adjust your web server for using /srv/http/xvpweb/.

-- Friesoft 19:01, 23 May 2010 (EDT)

GRUB menu entry outdated

After struggling with the apparently outdated install info, I finally managed to dredge up this tidbit: https://bbs.archlinux.org/viewtopic.php?id=133220

The current instructions make it seem as though the AUR xen package will put a new kernel & img in /boot with Dom0 in the name. This is apparently not the case, as it seems to just re-use the existing kernel files (at least in x64 installs). Any chance someone more familiar with the subject could update the install instructions? Zootboy 23:39, 11 January 2012 (EST)

The standard i686 kernel cannot be used as Dom0 kernel

At least in my recently (May 2012) installed system. So I added a kernel verification subsection. Is that OK? Gnailuy (talk) 05:53, 27 May 2012 (UTC)Reply[reply]

This is true. The regular x86 (i686) Arch Kernel does not have Xen Dom0 support compiled in. I know that the x64 Kernel does have Dom0 support compiled in by default, and users are strongly encouraged to run Xen on a 64-bit host machine. It's good to have this section, but it should probably be reworked to explain better which Kernels have Xen Dom0 support and why. (I believe the LTS Kernel may have Dom0 compiled in the i686 version, but I'm not sure and I'm having trouble finding where I read that.) Zootboy (talk) 00:05, 28 May 2012 (UTC)Reply[reply]

Suggestions to make this easier to read

I think we should add guidance to add xencommons & xend to rc.d to run xend on startup.

Mentioning pv-grub (far superior to pygrub, security wise) is also probably a good plan.

Luceo 23.49, 21st July 2012 (UTC)

Need to install bridge-utils to avoid an error on boot

At least I think that's the correct method, worked for me. Unless someone says otherwise, I will stop back and add that at some point.

Timm (talk) 12:50, 29 August 2012 (UTC)Reply[reply]

Yes, bridge-utils are necessary for networking to work properly in Xen. Zootboy (talk) 17:08, 4 September 2012 (UTC)Reply[reply]

Article HORRIBLY Outdated!

It is NOT possible, to get a workign Xen running with this article! As with many other wiki-articles, since the recent changes in arch linux none of them is an appropiate walkthrough anymore.

Is the following correct for syslinux? Dom0 boots with this here at least

Syslinux

(You need to have mboot.c32 copied into /boot/syslinux/ for these examples.)

Add the following to your /boot/syslinux/syslinux.cfg

LABEL xen
    MENU LABEL Arch Xen
    KERNEL mboot.c32
    APPEND ../xen-X.Y.Z.gz --- ../vmlinuz-linux console=tty0 root=/dev/sdaX ro -- ../initramfs-linux.img

An example to run Xen on a LUKS encrypted LVM host

LABEL xen
    MENU LABEL Arch Xen
    KERNEL mboot.c32
    APPEND ../xen-X.Y.Z.gz --- ../vmlinuz-linux console=tty0 cryptdevice=/dev/sdaX:main root=/dev/mapper/main-root ro -- ../initramfs-linux.img

Disable IP Tables to not interfere with bridge interfaces

By default the bridge interfaces created will be filtered using the kernel netfilter code preventing certain packets (like broadcasts) from reaching the DomUs during operation. This makes things like a DomU running DHCPd impossible.

This resolves the problem:

 # cat >> /etc/sysctl.conf <<EOF
 net.bridge.bridge-nf-call-ip6tables = 0
 net.bridge.bridge-nf-call-iptables = 0
 net.bridge.bridge-nf-call-arptables = 0
 EOF
 # sysctl -p /etc/sysctl.conf

Massive re-write

Just finished a huge re-write of this whole article in my attempt to bring it up to date. For those who are curious: I stripped out the Debian guest instructions because this is the Archwiki. There are links on the Xen wiki for installing Debian. In its place, I put in my own instructions for creating an Arch guest. I also stripped out the instructions for building from source as there are several AUR packages that basically do all the same things anyway. Seeing as you have to build from source when you install Xen from the AUR, it seemed redundant. There are Xen AUR packages for current stable (4.2 atm) and bleeding edge unstable (4.3-unstable atm). That should be sufficient for most cases, so I saw no need for manual compilation instructions.

As an aside, I also seem to recall having to create the /var/lib/xen directory manually. I didn't put it in the article as I couldn't verify that it was still necessary. Zootboy (talk) 18:55, 1 March 2013 (UTC)Reply[reply]


Some update suggestions

I am installing arch in xen DomU at the moment, and I have a few suggestion. My dom0 is Gentoo, so the problems I found are partly based on this (I am not sure)

Installing from iso

xl config file:

...
extra = "archisobasedir=arch archisolabel=ARCH_201301"
...

should be

...
extra = "archisobasedir=arch archisodevice=/dev/sdb"
...

because the label changes on every release. But I didn't succeed to install like this (because the cdrom device didn't appear at all) But these changes worked:

  • losetup /dev/loop1 /..../arch.iso

and changed the xl config file:

...
extra = "archisobasedir=arch archisodevice=/dev/xvdb
disk = [ .....  "phy:/dev/loop1,xvdb:cdrom,r" ...]
...

This way it booted fine, and I could proceed.

Boot changes

I suggest not using pygrub. Instead, the installed root copy the kernel and initramfs files to dom0, then use a config to boot the final system like this:

kernel = "/mnt/xen/arch-3.8.4/vmlinuz-linux"
root = "/dev/xvda1 ro"
ramdisk = "/mnt/xen/arch-3.8.4/initramfs-linux.img"
memory = 512
name = "arch"
disk = [
    "/mnt/xen/arch.btrfs,raw,xvda1,rw",
    "/mnt/xen/arch.swap,raw,xvda2,rw"
]
vif = [ 'mac=00:16:3e:XX:XX:XX,bridge=xenbr0' ]

The arch.btrfs and arch.swap are local files on Dom0 (btrfs can be mounted loopback if needed to copy the kernel files out for example) The other parts (mkinitcpio MODULES etc) works fine!

Grub2 entry is broken and PyGrub won't boot

A more simpler Grub2 entry can be created in DomU's /boot/grub/grub.cfg:

menuentry 'Arch Linux' --class gnu-linux --class gnu --class os {
    insmod gzio
    insmod ext2
    insmod part_msdos
    set root='(hd0)' 
    linux   /boot/vmlinuz-linux root=UUID=04968465-e3b9-4ad3-9526-b8bab72779d1 ro console=hvc0 splash quiet
    initrd  /boot/initramfs-linux.img
}

todo: UEFI/LVM/RAID solutions

There needs to be a more detailed explanation of what's going on here.

A successful Xen boot process:

Power on > rEFInd > GRUB > Xen > current Arch kernel > profit


After some fiddling around I've been able to keep UEFI with Xen. A (rough) chain load walk-through:

install and configure (base base-devel refind-efi)

+should be able to boot rEFInd to the base system at this point
+rEFInd will detect GRUB config from below

install (yaourt xen efibootmgr dosfstools grub)

+/boot should contain Xen kernel (xen-4.3.1.gz)
+GRUB install and setup scripts
 -directory structure example
 -linkto:grub-install which should detect Xen kernel
  -grub.cfg example
+efibootmgr to clean up NVRAM if necessary
 -troubleshooting (bootorder (resetting, deleting entries)) examples
  -fallback: "uefi shell v2" bcfg command to delete entries

More needed examples:

Arch kernel mkinitcpio.conf
MODULES="xen-blkfront xen-fbfront xen-netfront xen-kbdfront"

Xen errors:

I'm getting ATAx errors that hang the system for 10-15 seconds during the Arch kernel boot. After though, everything works?_? A quick search showed that it could be a BIOS/firmware issue. My BIOS is up to date, so I changed my SATA settings from AHCI to IDE/disable to see what happens. IDE = doesn't boot at all. Disable = wiped my NVRAM (fuuuuu...).


Jdad (talk) 23:22, 11 December 2013 (UTC)Reply[reply]

Update to v4.4.0+

Service files

As for v4.4.0 the rc.d script removed and added systemd service files. One can start the Xen services by executing

systemctl start xenstored xenconsoled xendomains

but both xenstored.service and xenconsoled.service are templates and might missing some arguments (for example I believe there's no default console defined in xenconsoled.service). I haven't got around yet to read the Xen manual to figure out sane default arguments to reccomend on the wiki so I prefer not to change the page myself.

Grub issue

The Grub generator is creating a menu item for xen-syms-4.4.0.gz which wrong. The packaged maintainer didn't fixed this issue yet so the a remark should be added about changing the default os in grub.cfg to 1. Dhead (talk) 15:51, 24 March 2014 (UTC)Reply[reply]


Boot partition DomU

The text "install Arch Linux as described in the Installation guide, but with the following deviations..." led me to believe that for DomU's a boot partition is also required and if I wanted to use a raw partition, I would need to partition xvda.

—This unsigned comment is by Folatt (talk) 19:35, 20 November 2015‎. Please sign your posts with ~~~~!

Can there be a section on how to install from the upstream git repository?

As an AUR package, it depends on the attention and time of the maintainer, and if the current version cannot be compiled and the maintainer decides to postpone updating the package, you are kinda stuck.

It would be nice to have clear instructions on how to fall back on the original repo in a case like this.

Brunofranco (talk) 20:06, 6 July 2018 (UTC)Reply[reply]

The first person who finds that out should create a xen-git package. I don't think there is need for a section like this. -- Lahwaacz (talk) 18:52, 7 August 2018 (UTC)Reply[reply]

dom0 and/or domU boot fails with: elf-init: not an ELF binary

Caused by Arch's kernel package (at 5.9.1) compressing using zstd (CONFIG_KERNEL_ZSTD=1), and the ELF-reading code in Xen not having zstd decompression. You can work around this by switching to the LTS kernel, or if supported by your various domain configs use a pacman hook to place the uncompressed kernel into /boot. This is not the complete kernel, so is only supported where xen is explicitly reading and running the kernel (eg: dom0 and PV domU). Remember to update your boot loader to point at the new kernel file.

Alaricljs (talk) 16:50, 9 November 2020 (UTC)Reply[reply]