[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
howtos:misc:xen_domu_guest [2020/07/03 18:17 (UTC)] – created bifferos | howtos:misc:xen_domu_guest [2020/07/03 23:35 (UTC)] (current) – [Test the kernel] bifferos | ||
---|---|---|---|
Line 1: | Line 1: | ||
<!-- Add your text below. We strongly advise to start with a Headline (see button bar above). --> | <!-- Add your text below. We strongly advise to start with a Headline (see button bar above). --> | ||
- | ====== | + | ====== |
+ | ===== Introduction ===== | ||
+ | This document explains how to create a guest virtual machine for a Xen environment using HVM (with PV drivers) virtualisation mode. Such a VM could be used on AWS (Amazon Web Services) or with an on-premise Xen setup but has the added advantage that it will still boot into Desktop virtualisation software like VirtualBox, KVM, VMWare as it uses a conventional MBR. There is no requirement to use Grub and we can stick with the familiar LILO. | ||
+ | ===== Installation ===== | ||
+ | |||
+ | First, we must prepare a Slackware install in a virtual machine. | ||
+ | |||
+ | Select at a minimum disk sets A, AP, D, K, L and N sets. Install everything. | ||
+ | |||
+ | ===== Make an Initrd ===== | ||
+ | |||
+ | Now we must create an initrd. | ||
+ | |||
+ | < | ||
+ | # cd /boot | ||
+ | # mkinitrd -c | ||
+ | </ | ||
+ | |||
+ | And of course, add it to LILO | ||
+ | |||
+ | < | ||
+ | image = / | ||
+ | root = /dev/sda1 | ||
+ | label = Linux | ||
+ | read-only | ||
+ | initrd = / | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== UUID Root device ===== | ||
+ | |||
+ | Next, we must setup lilo to boot using the UUID of the root partition instead of the device name (/dev/sda1 etc...) | ||
+ | |||
+ | Run the blkid program to list the UUIDs of the partitions, copy the one that matches the above partition, e.g | ||
+ | < | ||
+ | # blkid | ||
+ | /dev/sda1: UUID=" | ||
+ | </ | ||
+ | |||
+ | Add that UUID into your lilo.conf taking care to quote it correctly (the quotes go around the whole thing!) | ||
+ | |||
+ | < | ||
+ | image = / | ||
+ | root = " | ||
+ | label = Linux | ||
+ | read-only | ||
+ | initrd = / | ||
+ | </ | ||
+ | |||
+ | In /etc/fstab, change /dev/sda1 (or whatever your root partition was) in similar way, but you don't need any quotes this time: | ||
+ | |||
+ | < | ||
+ | UUID=43b8f058-1f75-4944-af9a-ee33ecc297aa | ||
+ | #/ | ||
+ | ... | ||
+ | </ | ||
+ | |||
+ | After this you may wish to run lilo, check that your system still boots. | ||
+ | |||
+ | |||
+ | ===== Configure the kernel ===== | ||
+ | |||
+ | Get ready to recompile the kernel using the current config as a starting point. | ||
+ | |||
+ | < | ||
+ | # cd / | ||
+ | # zcat / | ||
+ | # make menuconfig | ||
+ | </ | ||
+ | |||
+ | Then select the following kernel options | ||
+ | |||
+ | < | ||
+ | Processor type | ||
+ | | ||
+ | [*] Linux guest support | ||
+ | [*] Xen guest support | ||
+ | |||
+ | Device Drivers | ||
+ | [*] PCI support | ||
+ | < | ||
+ | [*] Block devices | ||
+ | < | ||
+ | SCSI device support | ||
+ | [*] SCSI low-level drivers | ||
+ | < | ||
+ | |||
+ | -*- Network device support | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | Those selections should give you the following extra kernel options. | ||
+ | |||
+ | < | ||
+ | # cat .config | grep XEN | grep =y | ||
+ | CONFIG_XEN=y | ||
+ | CONFIG_XEN_PV=y | ||
+ | CONFIG_XEN_PV_SMP=y | ||
+ | CONFIG_XEN_DOM0=y | ||
+ | CONFIG_XEN_PVHVM=y | ||
+ | CONFIG_XEN_PVHVM_SMP=y | ||
+ | CONFIG_XEN_512GB=y | ||
+ | CONFIG_XEN_SAVE_RESTORE=y | ||
+ | CONFIG_PCI_XEN=y | ||
+ | CONFIG_XEN_PCIDEV_FRONTEND=y | ||
+ | CONFIG_XEN_BLKDEV_FRONTEND=y | ||
+ | CONFIG_XEN_SCSI_FRONTEND=y | ||
+ | CONFIG_XEN_NETDEV_FRONTEND=y | ||
+ | CONFIG_INPUT_XEN_KBDDEV_FRONTEND=y | ||
+ | CONFIG_HVC_XEN=y | ||
+ | CONFIG_HVC_XEN_FRONTEND=y | ||
+ | CONFIG_XEN_FBDEV_FRONTEND=y | ||
+ | CONFIG_XEN_BALLOON=y | ||
+ | CONFIG_XEN_SCRUB_PAGES_DEFAULT=y | ||
+ | CONFIG_XEN_DEV_EVTCHN=y | ||
+ | CONFIG_XEN_BACKEND=y | ||
+ | CONFIG_XENFS=y | ||
+ | CONFIG_XEN_COMPAT_XENFS=y | ||
+ | CONFIG_XEN_SYS_HYPERVISOR=y | ||
+ | CONFIG_XEN_XENBUS_FRONTEND=y | ||
+ | CONFIG_SWIOTLB_XEN=y | ||
+ | CONFIG_XEN_PRIVCMD=y | ||
+ | CONFIG_XEN_HAVE_PVMMU=y | ||
+ | CONFIG_XEN_EFI=y | ||
+ | CONFIG_XEN_AUTO_XLATE=y | ||
+ | CONFIG_XEN_ACPI=y | ||
+ | CONFIG_XEN_SYMS=y | ||
+ | CONFIG_XEN_HAVE_VPMU=y | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== Recompile the kernel ===== | ||
+ | |||
+ | Compile the kernel with | ||
+ | < | ||
+ | make bzImage | ||
+ | </ | ||
+ | |||
+ | Note we don't need the modules unless you formatted rootfs with some obscure filesystem :). | ||
+ | |||
+ | ===== Test the kernel ===== | ||
+ | |||
+ | Copy the new kernel to /boot, e.g. | ||
+ | |||
+ | < | ||
+ | cp arch/ | ||
+ | </ | ||
+ | |||
+ | |||
+ | Now create an extra / | ||
+ | |||
+ | < | ||
+ | image = /boot/xen | ||
+ | root = " | ||
+ | label = Xen | ||
+ | read-only | ||
+ | initrd = / | ||
+ | </ | ||
+ | |||
+ | run lilo | ||
+ | |||
+ | < | ||
+ | # lilo | ||
+ | Warning: LBA32 addressing assumed | ||
+ | Added Linux + * | ||
+ | Added Xen + | ||
+ | One warning was issued. | ||
+ | </ | ||
+ | |||
+ | Now test that your system still boots when using the Xen kernel. | ||
====== Sources ====== | ====== Sources ====== | ||
<!-- Authors are allowed to give credit to themselves! --> | <!-- Authors are allowed to give credit to themselves! --> | ||
- | < | + | * Originally written by [[wiki: |
<!-- Please do not modify anything below, except adding new tags.--> | <!-- Please do not modify anything below, except adding new tags.--> | ||
<!-- You must remove the tag-word " | <!-- You must remove the tag-word " | ||
{{tag> | {{tag> |