Running VMs w/ KVM + virt-manager

Beginning Linux Virtualization

JD P

JDPfu Systems

Abstract

Hands-On Setup, Installation and Deployment of KVM and virt-manager

Run egrep '^flags.*(vmx|svm)' /proc/cpuinfo

to validate CPU + BIOS capability

Do NOT have either VMware or VirtualBox installed. Having multiple hypervisors on the same machine is problematic. It is fine to have them in a different OS install on a dual-boot machine.

About Me

JDPfu Systems


We can help ensure a great design that can be implemented and lead the deployment team through to user acceptance success.

(marketing dept should be happy now.)

About You


What is your background?

Which VM tools do you use?

Why?

Using KVM and/or libvirt?

100 Ways


There must be 100 different ways to accomplish the same goal. We will see 1-way tonight based on years of experience.

I make no claim that this is the single, best, only, way to setup KVM on a system.

YMMV!

KVM

Kernel-based Virtual Machine

Libvirt

Goals for Tonight

Tonight, we will

This will be live - expect surprises.

Virtualization Overview






Common to have 10 VMs or more per physical system.

The Setup



Requirements


Before we install ...

Performance Considerations

Install a few packages


$ sudo aptitude install \
openssh-server virt-manager \
   kvm qemu-system \
   bridge-utils \ fail2ban

or

sudo yum install bridge-utils \
   fail2ban kvm virt-manager \
   openssh-server 

Verify

$ lsmod |grep kvm
kvm_intel 137928  0
kvm       452238  1 kvm_intel


That's it!

reboot or newgrp might be needed

Linux Bridging Prep



Can dynamically create a bridge using brctl or with static files.

NetworkManager must be disabled prior to enabling bridges (Desktops)

Linux Bridging

# #######################
# /etc/network/interfaces file
auto br0
iface br0 inet static
 address 192.168.0.90
 gateway 192.168.0.200
 netmask 255.255.255.0
 dns-nameservers 8.8.8.8
 metric 1
 bridge_ports eth0
 bridge_fd 9
 bridge_hello 2
 bridge_maxage 12
 bridge_stp off



Redhat: bridge creation in rpm-land can be dynamic with brctl or static with files. The files go in /etc/sysconfig/network-scripts and are called ifcfg-br0 ifcfg-br1, etc.


Built-in bridging might work, but if problems, this method is always stable.

No Guest Additions!

Integrations should use nominal methods supported by the OS.

Live Demo / VM Setup


Going Live.



Launch virt-manager from any Linux machine running X/Windows

Remember the assumptions - VT-x enabled, install few progs, verify grp membership, kvm module loaded, ssh-server if remote control/access is desired.

My KVM Links


Private Cloud for You


Requirements for a Cloud


Goodnight!


Questions?


BTW, KVM SPEC-virt results

are almost always faster than ESXi.

Next Month ALE-NW



Surprise Meeting Topic
Questions from the floor, work on a project
Help with installs, setups, etc.

Why Virtualize?


More Reasons for Virtualization


More Reasons for Virtualization


More Reasons for Virtualization


Questions?


Questions?


Please send feedback!
Thank you.
[any material that should appear in print but not on the slide]