Skip to content
Xen/LFS Apache Postgres PHP
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
NOUSE
kernel-configs
lapp
src
xen
xlapp-bootscripts
xml-handling
.gitignore
5.04-binutils
5.05-gcc
5.06-linux
5.07-glibc
5.08-VERIFY
5.09-binutils
5.10-gcc
5.11-tcl
5.12-expect
5.13-dejagnu
5.14-check
5.15-ncurses
5.16-bash
5.17-bzip2
5.18-coreutils
5.19-diffutils
5.20-file
5.21-findutils
5.22-gawk
5.23-gettext
5.24-grep
5.25-gzip
5.26-m4
5.27-make
5.28-patch
5.29-perl
5.30-sed
5.31-tar
5.32-texinfo
5.33-xz
5.34-STRIP
6.02-PREP_VIRT_KERNEL_FS
6.05-CREATE_DIRS
6.06-FILES_SYMLINKS
6.07-linux
6.08-man-pages
6.09-glibc
6.10-READJUST
6.11-zlib
6.12-file
6.13-binutils
6.14-gmp
6.15-mpfr
6.16-mpc
6.17-gcc
6.18-sed
6.19-bzip2
6.20-ncurses
6.21-util-linux
6.22-e2fsprogs
6.23-coreutils
6.24-iana-etc
6.25-m4
6.26-bison
6.27-procps
6.28-grep
6.29-readline
6.30-bash
6.31-libtool
6.32-gdbm
6.33-inetutils
6.34-perl
6.35-autoconf
6.36-automake
6.37-diffutils
6.38-gawk
6.39-findutils
6.40-flex
6.41-gettext
6.42-groff
6.43-grub
6.44-gzip
6.45-iproute2
6.46-kbd
6.47-less
6.48-libpipeline
6.49-make
6.50-xz
6.51-man-db
6.52-module-init-tools
6.53-patch
6.54-psmisc
6.55-shadow
6.56-sysklogd
6.57-sysvinit
6.58-tar
6.59-texinfo
6.60-udev-173
6.61-vim
7.01-SYSCTL_CONFIG
7.02-NETWORK_CONFIG
7.03-ETC_HOSTS
7.06-lfs-bootscripts
7.07-INITTAB
7.08-SYSTEM_HOSTNAME
7.09-SYSTEM_CLOCK
7.10-CONFIG_CONSOLE
7.12-RC_SITE
7.13-ETC_PROFILE
7.14-ETC_INPUTRC
7.20-ETC_RESOLV_CONF
7.30-XLAPP_NETWORK_UPDOWN
8.02-ETC_FSTAB
8.03-linux
9.01-LFS_RELEASE
Makefile
README.md
README_GUESTS.md
README_INSTALL.md
README_KERNEL.md
b0.00-sudo
b0.01-ETC_SHELLS
b0.02-RNG
b0.03-BLFS_USERS
b1.01-bc
b1.02-openssl
b1.03-wget
b1.04-CA_CERTS
b1.05-tcp_wrappers
b1.07-openssh
b1.08-START_SYSSTAT_SSHD
b1.09-INSTALL_SSH_AUTH_KEYS
b1.10-INSTALL_DENY_SSH
b1.20-attr
b1.21-libcap
b1.30-WHICH_SCRIPT
b1.31-ntp
b1.32-cpio
b1.33-hdparm
b1.35-sysstat
b1.37-net-tools
b1.40-libpcap
b1.41-tcpdump
b1.43-bind
b1.45-bonnie
b1.52-unzip
b1.53-rsync
b1.55-popt
b1.70-START_NTP
b1.90-XLAPP_BOOT_WATCHDOG
b1.94-SNAPSHOT
b2.05-Python
b2.09-bridge-utils
b2.10-dev86
b2.11-acpica-unix2-20150717
b2.12-pkg-config
b2.13-libffi
b2.14-glib
b2.15-cmake
b2.16-ruby
b2.17-yajl
b2.25-xen
b2.30-XLAPP_BOOTSCRIPTS
b2.35-BRIDGE_NETWORKING
b2.40-LVM2
b2.42-parted
b2.45-gptfdisk
b2.50-ethtool
b2.51-lm_sensors
b2.52-smartmontools
b2.80-linux
b2.90-linux
b3.05-PERL_NET_TOOLS
b3.10-bind
b3.11-START_BIND
b3.12-libbsd
b3.13-sendmail
b3.15-tcl
b3.16-expect
b3.17-db
b3.18-pcre
b3.20-dovecot
b3.25-postfix
b3.26-re-alpine
b3.27-opendkim
b3.30-START_POSTFIX
b3.31-START_DOVECOT
b3.35-apr
b3.36-apr-util
b3.37-sqlite
b3.38-postgresql
b3.40-subversion
b3.45-expat
b3.46-stunnel
b3.47-curl
b3.50-git
b9.01-mdadm
b9.02-lsvpd
build
build-all
build-domu
clean
distclean
dot.alias-root.in
dot.bash_profile-lfs
dot.bashrc-lfs.in
etc-profile
install-xen-kernels
lfs-05-build-as-lfs.in
lfs-06.05-build
lfs-06.31-restart-bash
lfs-07.01-notools-jail3
lfs-actual
lfs-b0-prep-blfs
lfs-b1-build-as-blfs
lfs-b2-post-boot
lfs-bootscripts-1.patch
machine.config-SAMPLE
menu.lst-SAMPLE
modify-grub-lfs-p1
modify-grub-xlapp-p2
passhash.c
scan
scan-once
scan-time
scan2
t
tmpl-blfs
tmpl-lfs
tmpl-pre-chroot
udev-3ware
verify-p1
xlfs
xlfs-conf
xlfs2

README.md

What is XLFS?

XLFS stands for "Xen & Linux from Scratch". It's a collection of shell scripts which builds an entire virtualization-capable OS from scratch, including the virtualization stack (hypervisor, host OS, host tools, and VMs) and a few application stacks.

Yep, the whole OS is built entirely from source code.

It produces a Xen Project Hypervisor 4.2.5 running on bare metal with Linux systems used as the virtualization Host OS and also the Guest VM OSes. The Linux systems are based primarily on LFS and BLFS, and use a 3.1 kernel with a typical GNU/Linux userspace. XLFS source is hosted on GitHub:

http://github.com/qrux/xlfs

"LFS" stands for "Linux from Scratch". It's a good base on which to build Xen, because the system isn't large. It's also fully comprehensible, because it's relatively small and comes with a fantastically good blueprint.

You know how your iPhone doesn't come with a manual?
Yeah. This is the polar opposite of that.

That's because LFS itself is a project intended to teach people how Linux works, and takes the form of a book which provides an incredibly detailed guide for a person wishing to compile an entire GNU/Linux operating from source. BLFS is similar, giving directions to build and install packages not in the base LFS system (which can be considered somewhat "minimal"). Find LFS here:

http://www.linuxfromscratch.org/

The Xen Project Hypervisor is the leading open source virtualization platform powering some of the largest clouds in production today. Amazon Web Services, Rackspace Public Cloud and Verizon Cloud and many hosting services use Xen Project software.

Xen is a virtualization platform, and offers a powerful, efficient, and secure feature set for virtualization of x86, x86_64, IA64, ARM, and other CPU architectures. It supports a wide range of guest operating systems including Windows®, Linux®, Solaris®, and various versions of the BSD operating systems. The Xen hypervisor is a Type-1 hypervisor that can support Linux as a host operating system. Find the Xen Project here:

http://xenproject.org/

Finally, the XLFS project homepage (if you're coming from a search engine or GitHub):

http://xenfromscratch.org/

Goals

The goal is to minimize Linux- and Xen-related bloat in a virtualization platform. In the guests, my goal is to run various templatized installs, for instance, a LAPP server or a SMTP/IMAP server, which are also kept somehwat minimal. An important part of this goal is to be able to run headless with, at most, a text console (80x25), a colo-friendly capability.

A secondary goal is to create a system which has a relatively small security footprint. Eliminating bloat helps accomplish this. Installing packages by hand--in the LFS/BLFS style--also makes packages easier to upgrade. On the downside, there is no simple packaging system or package manager (e.g., RPM, apt). On the upside, CMMI works tremendously well, especially when coupled with BLFS. Many of the XLFS scripts are based directly from the LFS/BLFS builds.

Motivation

For years, I've run RedHat, SuSE, and Ubuntu systems in production. Commercial distros have the benefit of sophisticated packaging and configuration systems. RPM, Yast, and apt are a higher level of use and abstraction from CMMI and vi. However, while configuration systems can be learned, the packaging systems are hard to work around when they bundle unwanted dependencies.

The last straw was working with Xen on SuSE. SuSE requires Python for Xen, which I suppose is not totally unreasonable. But, the fact that SuSE's Python requires X11, and that's a huge amount of bloat to accommodate a baremetal hypervisor.

It seems quite plausible that most installation of Xen are 1) deployed on headless servers, and 2) running headless guests. Consider that Netflix, the generator of the most traffic on the Internet, uses AWS, which uses Xen as its virtualization infrastructure. In those cases, tainted graphics drivers, X11, desktop libraries (ALSA, etc) are unnecessary. And, it's quite possible that enterprise features like Kerberos and LDAP should be unnecessary in the host.

Running a Xen cluster should place as few dependencies on Domain 0 (the priviledged Host OS in Xen) as possible; that way, the machine runs leaner, uses less disk space, and has a smaller attackable footprint. It's unreasonable to install dozens of userland packages that never get used in the virtualization Host OS.

Overview

XLFS is an entire OS compiled from source system. It needs to be bootstrapped from a system that has a working compiler and set of tools that are used to build XLFS. Refer to the requirements here:

http://www.linuxfromscratch.org/lfs/view/7.0/prologue/hostreqs.html

I chose LFS as the base system for XLFS (the name came after the choice, in case you thought that was rhetorical), because it meets the criteria for the "smallest usable" toolchain for Xen and Linux.

While the project itself makes it quite clear that it doesn't consider itself to be a "minimal system", for my purposes it meets the criteria for the "smallest usable" toolchain. Additionally, its editors and contributors are knowledgeable, and support for the core project is strong. This makes it possible to further minimize the LFS core.

LFS itself requires a "host" system (this is NOT the same as a virtualization "host") from which to be bootstrapped. The obvious choice seemed to be an easy-to-install commercial distro. Finally, a good use for those SuSE images! I chose OpenSuSE-11.4, because 1) I'm familiar with it, and 2) it meets the host requirements, allowing XLFS to compile "out-of-the-box".

Newer versions of SuSE don't compile LFS-7.0 out-of-the-box. See here:

http://osdir.com/ml/bug-m4-gnu/2011-07/msg00002.html

After installing the host build system according to the guide (with accommodations for building XLFS), the XLFS scripts should be put into a directory in root's home directory. From there, the build can be started, which should compile an entire LFS build. This is referred to as Phase 1.

After Phase 1, the system can be booted into the freshly-compiled bare metal LFS system. From there, the scripts (which can be found again in root's home directory) can be run to compile and install the Xen Project hypervisor. This is referred to as Phase 2.

After Phase 2, you can create VMs.

Next

Go on to Build.

You can’t perform that action at this time.