Skip to content

Instantly share code, notes, and snippets.

@kushalvyas
Last active February 11, 2017 05:47
Show Gist options
  • Save kushalvyas/c3f71e5c16d7c0c966101b2e20c36424 to your computer and use it in GitHub Desktop.
Save kushalvyas/c3f71e5c16d7c0c966101b2e20c36424 to your computer and use it in GitHub Desktop.

Virtualization in clouds

Shortened URL : goo.gl/r249Vg

  1. What is virtualization ? There are 4 types
    • hardware virtualization : When VM is directly installed on a machine
    • operating system virtualization : When VM is directly installed on the host OS
    • server virtualization :
    • storage virtualization : Where physical storage is abstracted through another interface

Output :

Checking if the kernel supports the VM Architecture

student@student-HP-ProOne-400-G1-AiO:~$ egrep -c 'vmx' /proc/cpuinfo
4

Checking the CPU Info regarding system architecture

student@student-HP-ProOne-400-G1-AiO:~$ egrep -c 'lm' /proc/cpuinfo
4
student@student-HP-ProOne-400-G1-AiO:~$ uname -m
x86_64

Installing KVM

sudo apt-get install qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils virt-viewer
  • libvirt-bin provides libvirtd which you need to administer qemu and kvm instances using libvirt
  • qemu-kvm (kvm in Karmic and earlier) is the backend
  • ubuntu-vm-builder powerful command line tool for building virtual machines
  • bridge-utils provides a bridge from your network to the virtual machines

Installing KVM and dependencies

student@student-HP-ProOne-400-G1-AiO:~$ sudo apt-get install qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils virt-viewer
[sudo] password for student: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  at augeas-lenses build-essential cgroup-lite cpp-4.8 cpu-checker dctrl-tools
  debootstrap devscripts distro-info-data dpkg-dev dput ebtables fakeroot g++
  g++-4.8 gawk gcc-4.8 gcc-4.8-base ipxe-qemu kpartx libaio1
  libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl
  
The following NEW packages will be installed:
  at augeas-lenses bridge-utils build-essential cgroup-lite cpu-checker
  dctrl-tools debootstrap devscripts distro-info-data dpkg-dev dput ebtables
  fakeroot g++ g++-4.8 gawk ipxe-qemu kpartx libaio1 libalgorithm-diff-perl
  libalgorithm-diff-xs-perl libalgorithm-merge-perl libaugeas0
  libboost-thread1.54.0 libcommon-sense-perl libdistro-info-perl liberror-perl
  libexporter-lite-perl libfakeroot libfdt1 libgtk-vnc-2.0-0 libgvnc-1.0-0
  libio-stringy-perl libjson-perl libjson-xs-perl libnetcf1
  libparse-debcontrol-perl librados2 librbd1 libsdl1.2debian libseccomp2
  ...
  ...
  ...
    
The following packages will be upgraded:
  cpp-4.8 gcc-4.8 gcc-4.8-base libasan0 libatomic1 libdpkg-perl libgcc-4.8-dev
  libgomp1 libitm1 libquadmath0 libstdc++6 libtsan0
  ...
  ...
  ...
12 upgraded, 71 newly installed, 0 to remove and 425 not upgraded.
Need to get 45.0 MB of archives.
After this operation, 107 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
...
...
...
...
Preparing to unpack .../python-vm-builder_0.12.4+bzr489-0ubuntu2_all.deb ...
Unpacking python-vm-builder (0.12.4+bzr489-0ubuntu2) ...
Selecting previously unselected package python3-magic.
Preparing to unpack .../python3-magic_1%3a5.14-2ubuntu3.3_all.deb ...
Unpacking python3-magic (1:5.14-2ubuntu3.3) ...
Selecting previously unselected package ubuntu-vm-builder.
Preparing to unpack .../ubuntu-vm-builder_0.12.4+bzr489-0ubuntu2_all.deb ...
Unpacking ubuntu-vm-builder (0.12.4+bzr489-0ubuntu2) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Processing triggers for ureadahead (0.100.0-16) ...
ureadahead will be reprofiled on next reboot
Processing triggers for doc-base (0.10.5) ...
Processing 32 changed doc-base files, 1 added doc-base file...
Processing triggers for install-info (5.2.0.dfsg.1-2) ...
Processing triggers for hicolor-icon-theme (0.13-1) ...
...
...
...
libvirt-bin start/running, process 14404
Setting up libvirt-bin dnsmasq configuration.
Processing triggers for libc-bin (2.19-0ubuntu6.6) ...
Processing triggers for ureadahead (0.100.0-16) ...

Create Group User student@student-HP-ProOne-400-G1-AiO:$ sudo adduser 'student' libvirtd The user student' is already a member of libvirtd'. student@student-HP-ProOne-400-G1-AiO:$

student@student-HP-ProOne-400-G1-AiO:~$ groups
student adm cdrom sudo dip plugdev lpadmin sambashare
student@student-HP-ProOne-400-G1-AiO:~$ sudo adduser 'student' kvm
Adding user `student' to group `kvm' ...
Adding user student to group kvm
Done.
student@student-HP-ProOne-400-G1-AiO:~$ sudo apt-get install virtd-manager

Creation of VM

Create new virtual machine imagea1

Set name, iso settings imagea2

Browse for local ISO copies imagea3

Select Ubuntu14.04 LTS ISO imagea4

Allocate RAM and Cores imagea5

Set Harddrive memory options imagea6

Preview Configuration imagea7\

Create VM imagea8

Launch VM imagea9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment