Virtualization Resources for openSUSE

From openSUSE

This is a reference page for all pages that involve implementing virtualization on SUSE Linux.

Contents

Introduction

OpenVZ

Internal Links

External Links

VirtualBox

Internal Links

External Links

VMware

Internal Links


External Links

stall VMware Server 1.0 on SuSE 10.2 x64]

Xen

Internal Links

External Links

LXC

LXC is interesting in that it can be used to run a mere application as well as a full operating system.
LXC is a built-in upstream linux kernel feature since kernel 2.6.29 (openSUSE 11.2)
The userspace tools are included in openSUSE since 11.2 in the "lxc" package in the main oss repo.

There is not yet any openSUSE-specific documentation.

There is no openSUSE version of the lxc-fedora or lxc-debian scripts which automate the process of constructing or "installing" a full system as an lxc guest.

Until a nice front-end util or YaST module is written, or lxc-fedora is ported to create an lxc-opensuse, here is a short recipe to use zypper to install a base system into a subdirectory. It's almost but not fully non-interactive. There are a few prompts you have to respond to manually.

mkdir -p /v/0
zypper -R /v/0 ar -f http://download.opensuse.org/factory/repo/oss/ oss
zypper -R /v/0 in -lt pattern base

This installs a base system to a target directory (/v/0, ie, you would create further lxc guests in /v/1, /v/2 etc...).
It's messy because it includes non-applicable things like the kernel, modules, and boot loader, doesn't configure hardware and networking for an lxc guest, and installs an unnecessary redundant copy of all the base os binaries and libraries instead of read-only mapping them from the host.
But it's easy.

What we really need is to take the lxc-fedora script and port it to make a lxc-opensuse script.

Other notes:
Possible future use to make a really optimized lxc guest system that uses read-only bind mounts of the main OS bin and lib dirs:

# robind() - function to read-only bind mount a directory
# robind source dest
# robind /bin /v/0
# creates a read-only bind mount of /bin as /v/0/bin
# The ability to bind read-only requires linux kernel 2.6.26 or later,
# and must be done in two steps, first bind mount, then remount read-only as a separate following step.
robind () {
  s=$1 d=${2}$s
  mkdir -p $d
  mount -B $s $d
  mount -o remount,ro $d
}

# read-only bind mount from host
BIND_DIRS="/bin /sbin /lib /lib64 /usr"

for SRC in $BIND_DIRS ;do
  robind $SRC /v/0
done

# How should we handle these?
# /etc /root /var /home /proc /sys /dev

Another good starting point to get a pre-made "containerized" guest os is to use OpenVZ premade templates.
See external links below.

Internal Links

External Links