Virtualization (a.k.a. para-virtualization) is a technique used for (among other things) isolating sets of processes (services) running on the same hardware from each other. Each service (a set of processes) may run in a separate instance of the operating system or otherwise isolated from other services. Each instance is called a virtual machine (or VM).
All computers support virtualization to some level, for example virtual
memory has been in use for at least 20 years.
image file makes it appear as a disk.
Virtual NICs are common too.
Until recently only a few of a host's resources were virtualized;
today virtualization generally implies everything is virtualized,
giving us a
virtual host commonly called a virtual
machine (or VM).
Some virtualization systems allow different operating systems per VM, while other require (or will work much better if) the same type and version OS is used for all VMs. Some support 32-bit systems only, while others can support 64 bit hardware.
Usually you set up these VMs with virtual disks,
virtual NICs, and other virtual hardware.
No two VMs directly share anything.
sees it's own disks, memory, and NICs.
So no matter what sad fate befalls one service in one
VM, the remaining services in other VMs
Some virtualization technologies emulate the hardware
using software (called machine emulators).
Examples include QEMU (if not
Virtual PC, Bochs, and the Hercules emulator.
Application level virtualization is also common, including
Microsoft's CLI (used with .net) and
Sun/Oracle's JVM (used with Java).
Others only emulate a few critical components and allow the
guest OS instance to access the rest of the
hardware directly, saving and restoring the machine state when
switching between instances.
Examples of this type include KQEMU
KVM (the Kernel-based Virtual Machine, backed by
Red Hat), Win4Lin, and VMware (both client and server versions;
see also the free
Some types of virtualization run as an application on some
operating system that manages the hardware.
In this common case, the OS running the virtualization
software is known as the
All other OS instances are
booted by the
virtualization software (when it
powers on a virtual machine).
These are known as
Other types of virtualization are possible.
OS virtualization is the name sometimes
used when a single OS manages isolation for
sets of processes.
Solaris zones and BSD jails fall into this
Virtualization is sometimes used to permit running applications
designed for a different OS or even different hardware
Application level virtualization is also common, including
Microsoft's CLI (
mono) and Sun's JVM.
The virtualization or emulator software that does all that is variously known as hypervisor, (virtual machine) monitor, system emulator, and other terms. (Xen refers to the virtual machines as domains.) Some technologies require applications or OS drivers (or whole operating systems) to be made compatible. Examples include Denali and Xen. Other technologies can run unmodified applications or guest operating systems. To simplify PC and workstation support (with their many devices) some technologies both virtualize some things and emulate others.
VMware Client does this, requiring a hosted or underlying
OS on top of which runs VMware.
VMware Server enables one host to appear as a pool of secure (i.e.,
isolated) virtual servers which can run several different operating
Unlike the client version, VMware Server does not need a host
operating system (except to boot the server).
(Xen refers to the (initially booted) host OS,
used to create and manage other virtual machines,
domain 0 or
Virtualization software generally is designed for a specific
The i386 family of CPUs was not originally designed
for this purpose and many emulators have difficulty with
at least some applications.
However today's (post-2006) CPUs do provide some
features to support virtualization, increasing both performance
And some virtualization technologies require these newer
CPU features to run.
Intel calls their virtualization technology
and CPUs with this enabled show the flag
AMD calls theirs
and CPUs with this enabled show the flag
You can check with
grep -E '^flags.*(vmx|svm)' /proc/cpuinfo
Virtualization may require kernel support in the host OS. The hypervisor usually runs as a daemon, and each virtual machine as a separate process. Additionally there is a set of utilities that allow one to create virtual machine instances (and virtual disk image files) and to manage and monitor the hypervisor and the virtual machine instances.
There are commonly two types of virtual hard disk: a fixed disk has a predetermined size and is created at once; the guest OS sees this as one large unformatted disk. A dynamic disk starts of taking almost no disk space at all, and will grow as needed; however the guest OS still sees it the same way, but as writes will need to grow the file holding the virtual hard disk's data, it can be much slower than for fixed.
Network support has three different modes (not counting non-networked mode). For each mode there is a separate virtual hub which the virtual NICs (vNICs) connect to.
In local (or host-only) mode
each guest VM and the host OS have vNICs connected to the
They can communicate with each other but not with the physical NIC and in this mode there
is no Internet access.
The SysAdmin will need to assign each vNIC an IP address
in the same network.
In bridged mode the Virtual NICs as well as the physical NIC are connected
In addition the Host OS gets a vNIC connected to this hub too,
and this becomes the default NIC for the host OS.
The vNICs need IP addresses in the same network as the physical NIC.
Bridged mode VMs can directly communicate with each other and the
Internet (and any other reachable networks).
Bridged mode causes heavy LAN traffic and problems due to delays when
switching between VMs.
With shared mode, each vNIC connects to the
This is exactly the same as local mode, except a virtual router with
NAT connects the shared hub to the physical NIC.
External hosts only see the host OS's IP address,
not the guest VM IP addresses.
Most virtualization products include a DHCP server with the virtual
router to configure the vNICs automatically.
It is possible for some VMs to use one mode and others to use a different mode. But since each mode uses a separate hub, only VMs using the same mode can directly communicate. Note some products refer to the hubs as switches or bridges.
Virtualization can be a great way to practice system administration for various operating systems, networking (when you don't have many hosts and network hardware available), and system security.
Many virtualization packages are available, but the best are often
VMware Server would provide excellent security but
would be complex to set up without disturbing your existing
VMware Player is easy to setup but can't use Fedora
as the host OS.
So we will the popular
VirtualBox product by Oracle,
which is free, works well, and has a simple user interface.
VirtualBox is sometimes called
vbox or even
We will install a guest OS which you will configure
to run the Apache web server as the only service.
Answer the following questions and perform the following tasks:
(Use a table, or a few sentences of description of each.) Since of the free and open solutions, only VirtualBox will support Fedora as a host OS, we will use that in this project.
/var. If created in your home directory you won't need to be root to create the virtual machine instance, but beware of disk quotas!
file, which can be downloaded to any place with enough free space. What version of this guest OS are you using? Verify the downloaded file isn't corrupted. How did you validate the file?
yumrepositories; you will install with
yumfrom a different repository.) You should update all installed packages, make sure the dependent software has been installed, and possibly reboot (if the kernel or critical DLLs have been updated.
The following software should be installed:
(it depends which kernel you have),
(Most of this is needed to update the VirtualBox loadable kernel
module (LKM)when the host OS's kernel
You may also need these on the guest OSes to support
the Guest Addons.)
What software did you need to install?
Investigate the packages
to see what they are for.
What part of VirtualBox do you think will
require these packages?
PAE kernels support the
This is used on otherwise 32-bit kernels to support memory above
To see what kernel your host OS is running you can
(Guest OSes will also need a PAE kernel if
you give them more than 2 GB of memory, and they are 32-bit kernels.)
yumrepository config file for virtualbox.org:
Exactly what did you do to install the config file and enable this repo?
yum, install the
package. (Use a more recent, stable version if available.)
vboxdrvdaemon that runs at boot time. You should run that manually now, with an argument of
. What was the exact command you ran, and what was the output?
. Only root or members of this group can run VirtualBox. Add your (non-root) username to this group.
VirtualBox includes several tools and utilities:
VBoxManage is a command line utility that
allows you to control every aspect of VirtualBox.
VirtualBox is the standard GUI
tool that allows you to create, start, stop, and manage
most aspects of your VMs.
VBoxSDL is an alternative utility with a very
simple and limited GUI.
VBoxHeadless that provides no user interface at all,
and merely acts as a VRDP (VirtualBox Remote Desktop
Protocol) server that allows tools to manage VMs
Vboxwebsrv is a web server that also allows remote
For this project only the
VirtualBox GUI tool
ssh. What is the IP address of the virtual NIC? What trouble-shooting steps did you need to perform (if any) to get this to work? (Be specific!)
sshfrom your host OS to the guest system?
Containers are an alternative to full virtual machines. The main difference is all containers share a single OS, which is responsible for enforcing the isolation between containers. So a service may be composed of one or more containers (guests) running on a single server (host). (In some cases, containers run on top of virtual machines.) To support management and other services, often a daemon is needed.
Docker is a popular (2015) container technology based on Linux support
for containers (LXC).
Each running container is created from an image (which can be exported
tar archive), just like a virtual machine.
Each image is fully described in a simple text file,
By fully specifying the versions of everything in the image, new containers
can be launched identical to some older one, which is important for
(Or, simply make a repo of container images to reuse as needed.)
In this part of the project, you will install Docker and create a web server as a container.
Show all commands you ran for this part (use
Background goes here...
If you find that you're getting SELinux errors or denials,
it may be the install didn't correctly label the VirtualBox DLL
You can relabel
VirtualBox.so with this command:
su -c 'chcon -t textrel_shlib_t /usr/lib/virtualbox/VirtualBox.so'
Use what you have learned to locate documentation. Apply the trouble-shooting techniques discussed in previous classes.
The host OS may need some kernel parameters adjusted.
The Linux kernel is not setup for virtualization and running
VMware or other virtualization that
OSes can easily cause out of memory errors
even when there might be enough.
Two (poorly documented) kernel parameters can be adjusted to help:
vm.lowmem_zone_ratio = "100 32 32"
(the first value is the one to change, defaults to 256) and
vm.dirty_ratio = 5
(defaults to 10%.) The first change more aggressively protects the memory used by the hypervisor to prevent crashes. The second change causes unused memory to be reclaimed more frequently by the kernel's background memory thread.
If you get stuck remember you can ask your instructor for help.
A copy of your journal pages (both journals!), describing each task you performed and the answers to the questions asked above. You can send as email to (preferred). If email is a problem for some reason, you may turn in a hard-copy. In this case the pages should be readable, dated, and stapled together. Your name should appear on the first page.
Don't turn in your whole journal, just a copy of the relevant sections. It is common in fact to keep the journal as a text file on the system (with a paper backup of course).
Please see your syllabus for more information about submitting projects.