Difference between revisions of "Talk:Xen"

From ArchWiki
Jump to: navigation, search
(necessary modules on Dom0)
m (Remove closed discussion.)
(15 intermediate revisions by 9 users not shown)
Line 1: Line 1:
'''<big>For maximum benefit I suggest using the discussion page for page editing collaboration.</big>'''
 
  
----
+
== some things on the current page aren't really clear ==
 
+
'''Firstly''', some things on the current page aren't really clear, imho:
+
  
 
* "The standard arch kernel can be use to boot the domUs."<br/>
 
* "The standard arch kernel can be use to boot the domUs."<br/>
Line 14: Line 11:
 
BUT one can also use a standard archlinux kernel? Maybe there is an inconsistency.
 
BUT one can also use a standard archlinux kernel? Maybe there is an inconsistency.
  
'''Secondly''':
+
== Secondly ==
 
* Maybe someone more experienced can explain how to use encrypted (LUKS) filesystems with xen;
 
* 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&reg; Windows&trade.
 
* Maybe someone more experienced can add a section on how to use other OSs like Microsoft&reg; Windows&trade.
Line 21: Line 18:
 
-- [[User:Voidzero|Voidzero]] 16:54, 7 May 2010 (EDT)
 
-- [[User:Voidzero|Voidzero]] 16:54, 7 May 2010 (EDT)
  
'''Thirdly''':
+
== 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 incorrect - was stated before to be a frontend for Xen - it is NOT - it is a frontend for xenserver by citrix
* [http://aur.archlinux.org/packages.php?ID=34398 openxencenter] or [http://aur.archlinux.org/packages.php?ID=36074 openxencenter-svn] is GUI similar to citrix xen console.
+
* [https://aur.archlinux.org/packages.php?ID=34398 openxencenter] or [https://aur.archlinux.org/packages.php?ID=36074 openxencenter-svn] is GUI similar to citrix xen console.
  
 
this is also not for xen directly - it is for [http://www.xen.org/products/cloudxen.html xen cloud platform] which is something different afaik
 
this is also not for xen directly - it is for [http://www.xen.org/products/cloudxen.html xen cloud platform] which is something different afaik
* [http://aur.archlinux.org/packages.php?ID=36458 xvp] is web interface and vnc proxy.
+
* [https://aur.archlinux.org/packages.php?ID=36458 xvp] 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/.
 
After installing xvp, you need to generate /etc/xvp.conf with xvpdiscover tool and adjust your web server for using /srv/http/xvpweb/.
  
 
-- [[User:Friesoft|Friesoft]] 19:01, 23 May 2010 (EDT)
 
-- [[User:Friesoft|Friesoft]] 19:01, 23 May 2010 (EDT)
  
'''Old section about build failures with dom0 kernel 2.6.31''':
+
== GRUB menu entry outdated ==
  
Please note: At the time of this writing (23.5.2010) the current version uses a patched kernel version 2.6.31, which won't compile using gcc 4.5.
+
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 problem can be worked around by temporarily downgrading gcc and gcc-libs to version 4.4.3. It may also be needed to build the gmp4 package.
+
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?
You can possibly find gcc-4.4.3 and gcc-libs-4.4.3 on ARM (see [http://wiki.archlinux.org/index.php/Downgrading_Packages#Finding_Your_Older_Version Downgrading Packages])
+
[[User:Zootboy|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?
 +
[[User:Gnailuy|Gnailuy]] ([[User talk:Gnailuy|talk]]) 05:53, 27 May 2012 (UTC)
 +
 
 +
: 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.) [[User:Zootboy|Zootboy]] ([[User talk:Zootboy|talk]]) 00:05, 28 May 2012 (UTC)
 +
 
 +
== 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.
 +
 
 +
[[User:Luceo|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.
 +
 
 +
[[User:Timm|Timm]] ([[User talk:Timm|talk]]) 12:50, 29 August 2012 (UTC)
 +
 
 +
:Yes, bridge-utils are necessary for networking to work properly in Xen. [[User:Zootboy|Zootboy]] ([[User talk:Zootboy|talk]]) 17:08, 4 September 2012 (UTC)
 +
 
 +
== 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:
 +
 
 +
<code>
 +
  # 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</code>
 +
 
 +
== 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.
 +
[[User:Zootboy|Zootboy]] ([[User talk:Zootboy|talk]]) 18:55, 1 March 2013 (UTC)
 +
 
 +
 
 +
== 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:
 
<pre>
 
<pre>
pacman -Ud gcc-*
+
...
yaourt -S gmp4      # not sure if this is really needed
+
extra = "archisobasedir=arch archisolabel=ARCH_201301"
 +
...
 
</pre>
 
</pre>
Note: this didn't work for me (friesoft, 23.5.2010)
 
  
== necessary modules on Dom0 ==
+
should be
  
You need to load xen-blkback in Dom0 for /dev/xvda* devices. If you didn't load it, the DomUs won't find the device for the root file systems.
+
<pre>
 +
...
 +
extra = "archisobasedir=arch archisodevice=/dev/sdb"
 +
...
 +
</pre>
 +
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:
 +
<pre>
 +
...
 +
extra = "archisobasedir=arch archisodevice=/dev/xvdb
 +
disk = [ .....  "phy:/dev/loop1,xvdb:cdrom,r" ...]
 +
...
 +
</pre>
  
Similarly, you need to load xen_netback for the network connections, else xm create will pause for quite a while and then abort with a message that it could not configure vif.
+
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:
 +
 
 +
<pre>
 +
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' ]
 +
</pre>
  
(kernel 3.0)
+
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!

Revision as of 13:19, 26 March 2013

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

  • xvp 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)

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)

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)

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

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)


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!