Anda di halaman 1dari 4

Experiment No.

7
Aim : Virtualization on Linux
Theory:

Introduction
1Linux virtualization refers to running one or more virtual machines on a physical computer that's
operated by the Linux open source operating system. Linux virtualization can be used for isolating
specific apps, programming code or even an operating system itself, as well as for security and
performance testing purposes.
2Today's more powerful computers and hardware have made virtualization more practical and feasible
for both desktop and server environments, helping to save power by consolidating several workspaces
on one system as well as maximizing the workload that the compute can handle. Popular Linux
virtualization solutions include Xen, KVM, QEMU, VirtualBox and VMware.
By default, Linux Operating system provides within the kernel virtualization capabilities i.e. Kernel
Virtual Machine (kvm). Before enabling the kvm feature, you will first need to ensure that you meet
the hardware and software requirements.

Verifying that CPU support virtualization


Before installing any virtualization software, you might want to ensure that you have a cpu with
hardware assisted virtualization. Intel-VT cpu and AMD-V are cpu type that support hardware
virtualization. In this quite old post, we were already describing the way to check for virtualization
support.
To check that your computer support virtualization, you can issuse one of the following commands :
egrep -c (vmx |svm) /proc/cpuinfo

Checking the CPU architecture (32-bit or 64-bit)


We would recommend to run a 64-bit version of Ubuntu 12.04 simply because you will be able to host
32-bit and 64-bit virtual machines. Knowing that the new Microsoft Operating system only support 64bit, this would make sense. To check this, you can simply try to install ubuntu 64-bit on your system, if
the 64-bit architecture is not supported, you will get an error message and the installation process will
be stopped.
Another way (if you have already installed Ubuntu) would be to issue the following command
egrep -c lm /proc/cpuinfo

Verifying that Operating system version


Using the system monitor interface, you can easily check that the operating system you are running is
32-bit or 64-bit. Whatever the desktop interface you are running, type in the dash/activities, system
and select system monitor. In the sytem tab, you can see the version of the operating system.

Installating KVM packages


If you reach this section, we assume that you meet the basic requirements in order to have KVM
software running. Its time to download and install the kvm packages. With Ubuntu, this is quite easy.
You can use the Ubuntu software GUI based interface or you can use the command line
If you prefer to use the GUI,
Launch the Ubuntu Software Center, and in the search box type qemu-kvm. Click on the
package.The package is highlighted and you will see two buttons : more and Install. Click on
more button.
Scroll down and select the 2 additional Add-ons
You are ready to install the package. Press the Install button (scroll up to see it)
Check that the Bridge-utils package has been installed as well. From the ubuntu Software
Center, type in the search box bridge-utils and you should see it already installed. If not, install
it
sudo apt-get install qemu-kvm libvirt-bin bridge-utils

Installating Management Interface


There are different management tools available with KVM virtualization solution. For this post, we
will simply install the de facto standard virtual Machine Manager (VMM). To perform the
installation, you can use the Ubuntu software Center. In the search box, type virt and you should see in
the list the VMM package. click on it and press the install button
You can perform the same installation operation using the command line by issuing the following
command
sudo apt-get install virt-manager
After the installation complete, you can try to connect to the management interface (by typing in the
Dash/activities search box virtual. the application icons will be displayed
To add your user account (for example griffon) into the group libvirtd, you would type
sudo adduser griffon libvirtd
You will need to logoff and login again in order to have the changes applied. Try to launch the virtmanager application again, and you should be able to have it started. You are now ready to create your
first virtual machine using KVM as Hypervisor.

Creating your First virtual machine


Its time to create you first virtual machine on Ubuntu when using KVM as your preferred Hypervisor.
At this stage, you have launched the Virtual Machine Manager and you should see a dialog box similar

to this one
click on the highlighted computer icon and the New virtual machine wizard starts.
Provide the information and Press Forward.
In the following screen, select the installation source and the type of virtual machine that you want to
install. Press Forward
In the next screen, simply specify CPU and Memory information. Press Forward
In the next screen, provide the information about the virtual disk to created and Press Forward
In the final screen, provide the information about the Virtual networking and Press Finish

Click on picture for Better resolution


At this stage, you will need to perform the installation of your operating system.

Conclusion: Thus we have studied how virtual machine is created in Ubuntu.

Anda mungkin juga menyukai