NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: xen-bootable DomU images for linux



Brook Milligan <brook%nmsu.edu@localhost> writes:

> Does anyone know of a source of Linux images that can be booted as DomU with Xen?  Or how to make one using NetBSD?
>
> Thanks.
>
> Brook


It will depend on how you ultimately want to run the DOMU, but the
simplest way is to get pretty much ANY iso or other bootable image from
any distro and boot it as a DOMU full HVM guest.  If you are using one
of the Linux distros that have a GUI or text installer then you can just
proceed with that as you might on bare metal.  If you are doing one of
the more manual distros like ArchLinux then just follow the instructions
they provide on their web site.

If this is good enough for the use case, you can stop there (i.e. HVM
guests hit the DOM0 harder and probably will have higher latency in a
number of places).  However, Linux will run as a full PVH guest too.  To
convert a HVM guest to a PVH guest you copy the vmlinuz and initramfs
image files from (usually) /boot in the HVM guest into the DOM0.  You
then modify the config file for the guest to be a lot like a PV guest,
point the kernel= to the vmlinuz and ramdisk= to the initramfs file. You
then say 'type="pvh"' instead of 'builder="hvm"' and you should be
pretty much good.  (Maybe remove any ioemu stuff from the vif).

This is a ArchLinux config using HVM:
kernel = "/usr/pkg/lib/xen/boot/hvmloader"
builder='hvm'
device_model_version="qemu-xen-traditional"
memory = 2048
cpu_weight = 64
name = "archlinux"
vif = [ 'bridge=bridge4, type=ioemu' ]
disk = [ 'phy:/dev/mapper/rustvg0-archlinuxlv0,ioemu:hda,w' ]
boot='c'
vfb = [ 'type=vnc,vnclisten=10.1.2.1' ]

This is the same guest in PVH mode:
kernel = "/lhome/xen/kernels/ArchLinux/6.1.1.arch1-1/vmlinuz-linux"
ramdisk = "/lhome/xen/kernels/ArchLinux/6.1.1.arch1-1/initramfs-linux.img"
type="pvh"
memory = 2048
cpu_weight = 64
name = "archlinux"
vif = [ 'bridge=bridge4' ]
disk = [ 'phy:/dev/mapper/rustvg0-archlinuxlv0,xvda,w' ]
root = "/dev/xvda1"
extra = "mitigations=off console=hvc0 rdshell"

(Please note that this uses exactly the same disk images... it was
installed as a HVM and converted to a PVH guest.  A traditional PV guest
may also be possible depending on what Linux kernel version you have if
you drop the "type" directive.  I believe support for those was
removed, however.....)

At the very least, I have done this with ArchLinux, CentOS, Ubuntu and
Slackware (a long time ago).  I always look for the isos and just boot
that to start with...  Any live image will also likely work as a full
HVM guest if that suites the purpose.






-- 
Brad Spencer - brad%anduin.eldar.org@localhost - KC8VKS - http://anduin.eldar.org


Home | Main Index | Thread Index | Old Index