SlideShare a Scribd company logo
LAB MANUAL
CSE-247P: Introduction to Virtualization and Cloud Computing Lab.
LAB MANUAL
L T P 3 0 1
Course Type CORE
Semester
Offered
4th
Academic Year 2016-2017
Slot L27-L28
Class Room
Faculty Details:
Name Mr. Gautam Kumar
Website link
Designation Asst. Professor
School Schoolof Computing Science andEngineering
Cabin No C-432
Intercom -------
Open Hours Thursday(9:30 AM to 11.00 AM)
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
Table of Contents
1. Course details
1.1. Course objective (s)
1.2. Pre-requisites
1.3. Learning Outcomes
1.4. Syllabus & References
2. Experimental Setup details for the course.
3. List of Experiments
5.1. Format for continuous assessment
5.2. Format for internal end semester assessment
5.1. Format for continuous assessment
5.2. Format for internal end semester assessment
4. Experiment details
5. Guidelines for continuous assessment
5.1. Format for continuous assessment
5.2. Format for internal end semester assessment
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
1. COURSE DETAILS
1.1 Course Objective(s)
The objective of this course is to:
1. To impart fundamental concepts in the area of cloud computing
2. To impart knowledge in applications of cloud computing
3. Introduction to virtualization technologies
4. Virtual machines installation, configuration and administration
1.2 Pre-
requisite
1. Knowledge of Basic computer Science.
1.3 Course Outcomes
At the end of the course student will be able to:
1) Explain the principles of the VMware workstation and understand the installation process of
VMWare workstation.
2) Demonstrate the concept of QEMU on UBUNTU platform.
3) Demonstrate information regarding the KVM on UBUNTU .
4) Ability to learn the management of virtual machine
5) Ability to understand the concept of ESX server
6) Explain the principles of the justcloud and setup of own cloud
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
School of Computing Science & Engineering
Course Name-Introduction to Virtualization and Cloud Computing Lab.Course Code-CSE-247 P
LIST OF EXPERIMENTS
Sr.
No.
Title of Lab Experiments
1. Installation of VMWare Workstation and get acquainted with its dashboard.
2. Creation of VM image of Windows XP. Show the virtual machine migration based on the
certain condition from one node to the other.
3. Creation of VM image of base operating system. Install a C compiler in the virtual machine
and execute a sample program.
4. Installation of QEMU on Ubuntu 12.10
5. Creating and Using Virtual Machine Using QEMU
6. KVM on Ubuntu 12.10 and managing a VM on it.
7. KVM and guest operating system on CentOS6.3
8. Installing Guest OS in KVM using Command Line
9. Installation of VMware ESX Server
Value Added List of Experiments
1. Installation and Configuration of Justcloud.
2. Installation and Configuration of CloudLab?
Instructor In charge
GALGOTIAS UNIVERSITY
Plot No.2, Sector 17-A, Yamuna Expressway,
Greater Noida, GautamBuddh Nagar, U.P., India
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
Lab Manual
Lab-1 Installation of VMWare Workstation and get acquainted with its
dashboard.
Solution.
1. DownloadVMware-workstation-full-9.0.1-894247.exe filefromthe followingsite :
http://freewareupdate.com/developer-tools/download-vmware-workstation
2. Install the downloadedfile VMware-workstation-full-9.0.1-894247.exe bydouble clickingthe same.
3. You will getthe followingscreen:
4. PressNext,thanyouwill getthe followingScreen:
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
5. Clickon Typical,Youwill be gettingthe followingScreen
6. Presson Next,afteroptingtochange the defaultlocation,Youwillbe gettingthe followingscreen
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
7. AfterwardsPressNexttwice,thanwe will getthe followingscreenshot:
8. PressContinue,thaninstallationprocessstartsandyouwill be gettingthe followingfigure while
installationandthatmaytake few minutestocomplete :
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
9. NextYouwill getthe followingscreen,askingyoutoenterthe License Key,if youhave anyyoucan
use the same or pressskiptouse trail version.
10. Finallywe will getthe followingscreen,andpresshere the Finishbutton.
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
Thiscompletesthe installationof VMware Workstation.
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
Lab-2 Creation of VM image of Windows XP. Show the virtual machine
migration based on the certain condition from one node to the
other.
Creation of VM image of Windows XP
Afterinstallationof VMware Workstaion,double clickonvmware workstationiconcreatedondesktop,we
will getthe followingscreen:
1. SelectonYes,I accept the termsin the license agreement,andproceedfurtherbyclickingonOK
button.We will be gettingthe followingscreen:
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
2. Amongmanyoptionsavailable inthe above screenclickonCreate aNew Virtual Machine.Youwill be
gettingthe followingscreen:
3. Before pressingNextbuttontocontinue,make sure of the availabilityof WindowsXPCDinside the CD
Tray or you will be requiringthe isoimage of WindowsXP,once afterpressingthe Nextbuttonyou
will getthe followingscreen
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
4. PressNextButton, we will getthe followingscreen:
5. Enter the WindowsProductkey,Name andcontinue,youwillgetthe followingscreen:
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
6. PressNext,we will getthe followingscreen:
7. PressNexttocontinue,finallywe will getthe followingconfirmationscreen:
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
8. PressFinishbutton,if youfindeverythingisOK,thanwe will getthe followingscreen:
9. Presson Close Button,we will getthe followingscreen:
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
10. On the above screen,pressonPoweronthisvirtual machine,itwill asktoenterthe license keyfor
VMware workstaion,if youhave anysuch,proceedfurther.Whichinturnappears(inthe window),as
if,we are installingthe windowsXPona physical systemasshownbelow.If youdon'thave the license
than downloadthe VMplayer5.0.0, whichisfreelydownloadable,andafterinstallingthe VMPlayer
youcan use the same for furtherinstallingthe WindowsXPasa virtual machine.
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
Thiscompletesthe creationof WindowsXPvirtual machine.
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
Lab-3 Creation of VM image of base operating system. Install a C
compiler in the virtual machine and execute a sample
program.
Creationof VM image of base operatingsystem
1. In figure 10 you gota optionVirtualize aPhysical machine.Once afterclickingonthat,itwill redirect
to downloadthe VMware vCenterConverter.
We can directlydownloadVMware vCenterConverterStandalone5.0.1from the followingsite :
https://my.vmware.com/web/vmware/info/slug/infrastructure_operations_management/vmware_vc
enter_converter_standalone/5_0
Once afterdownloadingthe VMware vCenterConverterstandalone5.0.1,install the same,inturnit
createsthe icon ondesktop.Clickthe VMware vCenterConverterStandalone Clienticonyouwill get
the followingscreen:
2. Selectthe optionConnecttoa local serverandyou will getthe below screen:
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
3. Clickon Convertmachine,we will getfollowingscreen:
4. Selectsource type asPowered-onmachine,Specifythe powered-onmachine asThe Local machine,
PressNext.youwill getthe below screen:
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
5. ClickNext,afterselectingdestinationtype asVMware workstationorotherVMware virtual machine,
selectVMware productas VMware Player4.0.x,type user-definedvirtualmachine name andselect
the locationwhereinyouare desiringtostore Virtual machine.
6. Afterpressingthe Nextinthe above windowwe willgetthe below summarywindow asshownbelow
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
7. FinallypressonFinishbutton,itwillstarttocreate the Local system'sVM.
Thus VMimage of base operatingsystemgetscreated.
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
Virtual Machine UsingQEMU
Lab-4 Installation of QEMU on Ubuntu 12.10
Installation of QEMU on Ubuntu 12.10
Type sudoapt-getinstall qemu-kvm
$ sudoapt-getinstall qemu-kvm
[sudo] passwordforUserID:
Enter the passwordof the userwho hasthe rootprivileges.Thiswillstarttodownloadthe qemu-kvmfrom
internet.
Afterdownloading,itwill installqemu.Alsomake sure the gnome GUIis installed,if gnome isnotinstalled,
youcan downloadandinstall the same bytypingthe followingcommand
h$ sudo aptitude installgnome
Afterdownloadingandinstallationof gnome,we needtorebootthe system, bytypingthe commandas
follows:
$ sudoreboot
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
Lab-5 Creating and UsingVirtual Machine Using QEMU
Creating Virtual Machine on Ubuntu 12.10 platform
Type qemu-system-x86_64-hdawinxp -cdromcd.iso -m192 -bootd
Herewinxpisavirtual diskwhichisneededforthe virtual machine.A virtual diskismade bycreatingafile of a
size appropriatelylarge tocontainthe full guestOS.
You can create the virtual diskbyusingthe commandqemu-imgcreate winxp3G,which inturn createsthe
winxpvirtual diskwith3GB diskspace.
Here cd.isoisa isoimage of guestoperatingsystem, youcanuse the isoimage file if itwasalreadycreated,it
it isnot created,youcan create the iso image file byusingthe commandddif=/dev/cdromof=cd.isofor
cdrom image or ddif=/dev/dvdof=dvd.isofordvdimage.
Suppose if youhave the WindowsXPCDina CD/DVDtray and wantto create the WindowsXPvirtual machine,
youhave to proceedas below:
1. Create the WindowsXPisoimage as cd.isofile bytypingthe commandasfollows:
$ ddif=/dev/cdromof=cd.iso
2. Beinginthe same directory,create the virtual diskof size 3GB diskspace as winxp,bytypingthe
commandas follows:
$ qemu-imgcreate winxp3G
3. Beinginthe same directoryexecute the followingcommand:
$ qemu-system-x86_64-hdawinxp -cdromcd.iso -m192 -bootd
4. ThiscommandinstructsQEMU to use hdaas the emptydiskfile.Itusescd.isofile asif installingfrom
the CDROM, and setsthe amountof memoryto use inthe virtual machine tobe 192Mb. It then
instructsto bootfromthe CDROM.
As the installerbootsandgoesthroughoptions,choose the defaultsateachstep.The installershould
detectthe virtual networkproperlyandinstallwithoutdiificulties.
Thiscompletesthe CreatingVirtualMachine usingQEMU onUbuntu 12.10
Using the Virtual Machine on Ubuntu 12.10 platform
Beinginthe same directory,runthe followingcommand
$ qemu-system-x86_64–hdawinxp
[Note :If youhave Ubuntu 32 bitversionyouneedtouse qemu-system-i386]
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
Lab-6 KVM on Ubuntu 12.10 and managing a VM on it.
KVM on Ubuntu12.10
1. Make sure your hardware supportsthe necessaryvirtualizationextensionsforKVM.Enterthe
followingfromaterminal prompt:
$ kvm-ok
A message will be printed informingyouif yourCPU doesor doesnotsupporthardware virtualization.
You shouldgetthe followinginformation
INFO:Your CPU supportsKVMextensions.
INFO:/dev/kvmdoesnotexist
KVMaccelerationcannotbe used.
2. As we will be requiringrootprivileges,type the commandasbelow :
$ sudosu
3. Downloadandinstall kvm,bytypingthe followingcommand:
# apt-getinstall kvm
4. Type the followingcommandtoinstall libvirt-bin
# apt-getinstall libvirt-bin
5. To check the KVMhassuccessfullybeeninstalled, runthe followingcommand
# virsh-c qemu:///systemlist
whichinturn displaysasfollows:
ID Name State
If it displaysanerrorinstead,thansomethingwentwrong.
6. Type the command once againkvm-okona prompt,now youshouldgetthe followingdisplay:
# kvm-ok
INFO:Your CPU supportsKVMextensions
INFO:/dev/kvmexists
KVMaccelerationcanbe used
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
7. Installingvirt-install
$ sudoapt-getinstall virtinst
8. Installingvirt-managerOnYour Ubuntu12.10 Desktop
We needameansof connectingtothe graphical console of ourguests - we can use virt-viewerorvirt-
manager,forthis.I'm assumingthatyou're usingan Ubuntu 12.10 desktop(itdoesn'tmatterif itis a
remote desktoporif the desktopisinstalledonthe Ubuntu12.10 KVMserver!).
I suggestyouuse virt-managerinsteadof virt-viewerbecause virt-managerletsyoualsocreate and
delete virtual machinesanddoothertasks.virt-managercanbe installedasfollows:
$ sudoapt-getinstall virt-manager
9. Install libvirt
# apt-getinstall libvirt-bin
# adduser`id -un`libvirtd
# adduser`id -un`kvm
10. Install firefox
# apt-getinstall firefox
# apt-getinstall ubuntu-virt-serverpython-vm-builderkvm-ipxe
11. Nextwe needtosetup a networkbridge onourserverso that our virtual machinescanbe accessed
fromotherhosts as if theywere physical systemsinthe network.
<> # apt-getinstall bridge-utils
To do this,we install the package bridge-utils...
apt-getinstall bridge-utils
...and configure abridge.Open/etc/network/interfaces:
vi /etc/network/interfaces
Before the modification,myfilelooksasfollows:
# Thisfile describesthe networkinterfacesavailableonyoursystem
# andhow to activate them.Formore information,see interfaces(5).
# The loopbacknetworkinterface
auto lo
iface loinetloopback
# The primarynetworkinterface
auto eth0
iface eth0inetstatic
address192.168.0.100
netmask255.255.255.0
network192.168.0.0
broadcast 192.168.0.255
gateway192.168.0.1
dns-nameservers8.8.8.88.8.4.4
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
I change it so thatit lookslike this:
# Thisfile describesthe networkinterfacesavailableonyoursystem
# andhow to activate them.Formore information,see interfaces(5).
# The loopbacknetworkinterface
auto lo
iface loinetloopback
# The primarynetworkinterface
auto eth0
iface eth0inetmanual
auto br0
iface br0 inetstatic
address192.168.0.100
network192.168.0.0
netmask255.255.255.0
broadcast 192.168.0.255
gateway192.168.0.1
dns-nameservers8.8.8.88.8.4.4
bridge_portseth0
bridge_fd9
bridge_hello2
bridge_maxage 12
bridge_stpoff
(Make sure you use the correct settingsforyournetwork!)
Restartthe network...
/etc/init.d/networking restart
...and run
ifconfig
It shouldnowshowthe networkbridge (br0):
root@server1:~#ifconfig
br0 Linkencap:EthernetHWaddr00:1e:90:f3:f0:02
inetaddr:192.168.0.100 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr:fe80::21e:90ff:fef3:f002/64 Scope:Link
UP BROADCASTRUNNINGMULTICAST MTU:1500 Metric:1
RX packets:29 errors:0 dropped:0overruns:0frame:0
TX packets:29errors:0 dropped:0overruns:0carrier:0
collisions:0txqueuelen:0
RX bytes:1934 (1.9 KB) TX bytes:2844 (2.8 KB)
eth0 Linkencap:EthernetHWaddr00:1e:90:f3:f0:02
UP BROADCASTRUNNINGMULTICAST MTU:1500 Metric:1
RX packets:44613 errors:0 dropped:0overruns:0frame:0
TX packets:23445 errors:0 dropped:0overruns:0carrier:0
collisions:0txqueuelen:1000
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
RX bytes:63663064 (63.6 MB) TX bytes:1792940 (1.7 MB)
Interrupt:41Base address:0xa000
lo Linkencap:Local Loopback
inetaddr:127.0.0.1 Mask:255.0.0.0
inet6addr:::1/128 Scope:Host
UP LOOPBACKRUNNINGMTU:16436 Metric:1
RXpackets:0 errors:0dropped:0overruns:0frame:0
TX packets:0errors:0 dropped:0overruns:0carrier:0
collisions:0txqueuelen:0
RXbytes:0(0.0 B) TX bytes:0(0.0 B)
virbr0 Linkencap:EthernetHWaddr2a:4a:49:13:de:8f
inetaddr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0
UP BROADCASTMULTICAST MTU:1500 Metric:1
RX packets:0errors:0 dropped:0overruns:0frame:0
TX packets:0errors:0 dropped:0overruns:0carrier:0
collisions:0txqueuelen:0
RXbytes:0(0.0 B) TX bytes:0(0.0 B)
root@server1:~#
Before we startour firstvirtual machine,Irecommendtorebootthe system:
reboot
If you don't dothis,youmightget an error like open/dev/kvm:Permissiondeniedinthe virtual machinelogs
inthe /var/log/libvirt/qemu/directory.
CreatingAnImage-BasedVM
We can nowcreate our firstVM - an image-basedVM(if youexpectlotsof trafficandmanyread- and write
operationsforthatVM, use an LVM-basedVMinsteadasshowninchapter6 - image-basedVMsare heavyon
hard diskIO).
I wantto create myvirtual machinesinthe directory/var/lib/libvirt/images/(theycannotbe created inthe
/rootdirectorybecause the libvirt-qemuuserdoesn'thave readpermissionsinthatdirectory).
We will create anewdirectoryforeach VMthat we wantto create,e.g./var/lib/libvirt/images/vm1,
/var/lib/libvirt/images/vm2,/var/lib/libvirt/images/vm3,andsoon, because eachVMwill have asubdirectory
calledubuntu-kvm,andobviouslythere canbe justone suchdirectoryin/var/lib/libvirt/images/vm1,for
example.If youtryto create a secondVMin /var/lib/libvirt/images/vm1,forexample,you will getanerror
message sayingubuntu-kvmalreadyexists(unlessyourunvmbuilderwiththe --dest=DESTDIRargument):
root@server1:/var/lib/libvirt/images/vm1#vmbuilderkvmubuntu -cvm2.cfg
2009-05-07 16:32:44,185 INFO Cleaningup
ubuntu-kvmalreadyexists
root@server1:/var/lib/libvirt/images/vm1#
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
We will use the vmbuildertool tocreate VMs. (Youcan learnmore about vmbuilderhere.) vmbuilderusesa
template tocreate virtual machines - thistemplate islocatedinthe /etc/vmbuilder/libvirt/directory.Firstwe
create a copy:
mkdir-p/var/lib/libvirt/images/vm1/mytemplates/libvirt
cp /etc/vmbuilder/libvirt/*/var/lib/libvirt/images/vm1/mytemplates/libvirt/
Nowwe come to the partitioningof ourVM.We create a file calledvmbuilder.partition...
vi /var/lib/libvirt/images/vm1/vmbuilder.partition
...and define the desiredpartitionsasfollows:
root 8000
swap4000
---
/var 20000
Thisdefinesarootpartition(/) witha size of 8000MB, a swap partitionof 4000MB, anda /varpartitionof
20000MB. The --- line makesthatthe followingpartition(/varinthisexample) isonaseparate diskimage (i.e.,
thiswouldcreate twodiskimages,one forrootand swapand one for /var).Of course,you are free to define
whateverpartitionsyoulike(aslongas youalsodefine rootandswap),andof course,theycan be in justone
diskimage - thisis justan example.
I wantto install openssh-serverinthe VM.To make sure that eachVM getsa unique OpenSSHkey,we cannot
install openssh-serverwhenwe create the VM.Therefore we create ascriptcalledboot.shthatwill be
executedwhenthe VMisbootedforthe firsttime.Itwill install openssh-server(withaunique key) andalso
force the user (Iwill use the defaultusername administratorformyVMs together withthe defaultpassword
howtoforge) tochange the passwordwhenhe logsinforthe firsttime:
vi /var/lib/libvirt/images/vm1/boot.sh
# Thisscriptwill runthe firsttime the virtual machine boots
# It isran as root.
# Expire the useraccount
passwd-e administrator
# Install openssh-server
apt-getupdate
apt-getinstall -qqy --force-yesopenssh-server
Make sure youreplace the username administratorwithyourdefaultloginname.
Nowtake a lookat
$ vmbuilderkvmubuntu --help
to learnaboutthe available options.
To create our firstVM, vm1, we go to the VMdirectory...
cd /var/lib/libvirt/images/vm1/
...and run vmbuilder,e.g.asfollows:
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
vmbuilderkvmubuntu --suite=precise --flavour=virtual --arch=amd64--
mirror=http://de.archive.ubuntu.com/ubuntu -o--libvirt=qemu:///system --ip=192.168.0.101 --
gw=192.168.0.1 --part=vmbuilder.partition --templates=mytemplates --user=administrator--
name=Administrator--pass=howtoforge--addpkg=vim-nox --addpkg=unattended-upgrades --addpkg=acpid --
firstboot=/var/lib/libvirt/images/vm1/boot.sh --mem=256--hostname=vm1--bridge=br0
Most of the optionsare self-explanatory. --partspecifiesthe file withthe partitioningdetails,relative toour
workingdirectory(that'swhywe hadto go to our VMdirectorybefore runningvmbuilder), --templates
specifiesthe directorythatholdsthe templatefile(againrelativetoourworkingdirectory),and --firstboot
specifiesthe firstbootscript. --libvirt=qemu:///systemtellsKVMtoadd thisVMto the listof available virtual
machines. --addpkgallowsyoutospecifyUbuntupackagesthatyouwantto have installedduringthe VM
creation(see above whyyoushouldn'taddopenssh-servertothat listanduse the firstbootscriptinstead). --
bridge setsupa bridgednetwork;aswe have createdthe bridge br0in chapter2, we specifythatbridge here.
In the --mirrorline,youcanspecifyanofficial Ubunturepositoryin --mirror,e.g.
http://de.archive.ubuntu.com/ubuntu.If youleave out --mirror,thenthe defaultUbunturepository
(http://archive.ubuntu.com/ubuntu) will be used.
If you specifyanIPaddressinthe --ipswitch,make sure thatyoualsospecifythe correctgatewayIPusingthe
--gwswitch(otherwise vmbuilderwill assumethatitisthe firstvalidaddressinthe networkwhichmightnot
be correct).Usuallythe gatewayIPis the same that you use in/etc/network/interfaces(see chapter2).
The buildprocesscan take a fewminutes.
Afterwards,youcanfindan XML configurationfileforthe VMin/etc/libvirt/qemu/(=>
/etc/libvirt/qemu/vm1.xml):
ls-l /etc/libvirt/qemu/
root@server1:/var/lib/libvirt/images/vm1#ls -l /etc/libvirt/qemu/total 8
drwxr-xr-x 3rootroot 4096 May 21 13:00 networks
-rw------- 1rootroot 2082 May 21 13:15 vm1.xml
root@server1:/var/lib/libvirt/images/vm1#
The diskimagesare locatedinthe ubuntu-kvm/subdirectoryof ourVMdirectory:
ls-l /var/lib/libvirt/images/vm1/ubuntu-kvm/
root@server1:/var/lib/libvirt/images/vm1#ls -l /var/lib/libvirt/images/vm1/ubuntu-kvm/
total 604312
-rw-r--r-- 1root root 324337664 May 21 13:14 tmpE4IiRv.qcow2
-rw-r--r-- 1root root 294715392 May 21 13:15 tmpxvSVOT.qcow2
root@server1:/var/lib/libvirt/images/vm1#
If you wantto create a secondVM(vm2),here'sa shortsummaryof the commands:
mkdir-p/var/lib/libvirt/images/vm2/mytemplates/libvirt
cp /etc/vmbuilder/libvirt/*/var/lib/libvirt/images/vm2/mytemplates/libvirt/
vi /var/lib/libvirt/images/vm2/vmbuilder.partition
vi /var/lib/libvirt/images/vm2/boot.sh
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
cd /var/lib/libvirt/images/vm2/
vmbuilderkvmubuntu--suite=precise --flavour=virtual --arch=amd64--
mirror=http://de.archive.ubuntu.com/ubuntu -o--libvirt=qemu:///system --ip=192.168.0.102 --
gw=192.168.0.1 --part=vmbuilder.partition --templates=mytemplates --user=administrator--
name=Administrator--pass=howtoforge--addpkg=vim-nox --addpkg=unattended-upgrades --addpkg=acpid --
firstboot=/var/lib/libvirt/images/vm2/boot.sh --mem=256--hostname=vm2--bridge=br0
(Please note thatyoudon'thave to create a new directoryforthe VM(/var/lib/libvirt/images/vm2) if youpass
the -d DESTDIR argumentto the vmbuildercommand - itallowsyouto create a VMin a directorywhere
you've alreadycreatedanotherVM.Inthat case youdon't have to create new vmbuilder.partitionandboot.sh
filesanddon'thave to modifythe template,butcansimplyuse the existingfiles:
cd /var/lib/libvirt/images/vm1/
vmbuilderkvmubuntu --suite=precise --flavour=virtual --arch=amd64--
mirror=http://de.archive.ubuntu.com/ubuntu -o--libvirt=qemu:///system --ip=192.168.0.102 --
gw=192.168.0.1 --part=vmbuilder.partition --templates=mytemplates --user=administrator--
name=Administrator--pass=howtoforge--addpkg=vim-nox --addpkg=unattended-upgrades --addpkg=acpid --
firstboot=/var/lib/libvirt/images/vm1/boot.sh --mem=256--hostname=vm2--bridge=br0-dvm2-kvm)
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
Lab-7 KVM and guest operating system on CentOS 6.3
KVM and guest operatingsystemon CentOS6.3
The KVM(Kernel Virtual Machine) isaVirtualizationenvironmentforthe Linux Kernel.We will see here how
to install KVMVirtualization.
Pre-requisites
You will needfollowingSystemSpecifications:
1. VirtualizationenabledinBIOS..
2. A processorwhichsupportsVirtualization.
3. A 64-bitversionof the Operating-System(CentOS6.3).
4. 64-bit hardware architecture
Firstyou needtoenable the VirtualizationinyourBIOS.
Secondlycheckthe processorcompatibilityforVirtualizationbythe helpof /proc/cpuinfo fileasmentioned
earlier.
Finallycheckforthe 64-bit versionor32-bitof operatingsystemandhardware architecture byrunningthe
followingcommand
# uname -a
The 32 bitsystemwill showi686and i386 afterthe install date andtime.
The 64 bitserverwill showx86_64 numeroustimesafterthe install date andtime.
or justtype # uname-m
Nowcheckfor the SELinux disabledornot,youneedtodisable the SELinux,fordisablingthe SELinux,follow
the belowsteps:
# vi /etc/selinux/config
setSELINUX=disabledinthe file andsave.Afterwardsrebootthe server.
In orderto effectivelyinstall KVMvirtualizationandconfigure GuestOS,youneedtoinstall multiple packages.
All suchpackagesare providedundercertainpackage groupsinRHEL 6 standardinstallationDVD.The groups
are Virtualization,VirtualizationPlatform,VirtualizationClients.VirtualizationTools
VirtualizationProvidesanenvironmentforhostingvirtualizedguests.
Packages :qemu-kvm,qemu-kvm-tools
VirtualizationPlatform Provides aninterface foraccessingandcontrollingvirtualizedguestsandcontainers.
Mandatory Packages:libvirt,libvirt-client
Optional Packages: fence-virtd-libvirt,fence-virtd-multicast,fence-virtd-serial,libvirt-cim, libvirt-java,libvirt-
qpid,perl-Sys-Virt
VirtualizationClientClientsforinstallingandmanagingvirtualizationinstances.
Mandatory Packages: python-virtinst,virt-manager,virt-viewer
DefaultPackages:virt-top
VirtualizationToolsToolsforoffline virtual image management
DefaultPackages:libguestfs,
Optional Packages:libguestfs-java,libguestfs-mount,libguestfs-tools,virt-v2v
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
We can install all these packagesbyusingyumasfollows.
# yumgroupinstall Virtualization
# yumgroupinstall “VirtualizationPlatform”
# yumgroupinstall “VirtualizationClient”
# yumgroupinstall “VirtualizationTools”
You can verifythe successful KVMinstallationbythe followingcommand
# lsmod|grepkvm
kvm_intel 45674 0
kvm291811 1 kvm_intel
Nowthat youhave verifiedsuccessfully,youmaycheck/startthe libvirtddaemonprocessasfollows
# service libvirtdstatus
libvirtd(pid6914) isrunning...
Do not forgetto runthe followingcommandif youwanttorun the libvirtddaemonatboottime onrunlevels
3 and 5.
# chkconfig--level35libvirtdon
Afteryouhave installedthe packageswe will findanew menuoptiontolaunchthe VMManager under
Application-> System Tools-> Virtual Machine Manager
InstallingguestoperatingsystemusingKVM: We needtoclickon the monitoriconjust below the “File”menu
of Virtual Machine Managerwindowsasa firststepof VMCreation.Here will take the exampleof Windows
XP GuestOS.We will see howtoinstall WindowsXPonKVMusingVMManager.It is assumedthatwe have
createdthe isofile fromthe WindowsXPcd before proceedingtoinstall.If we haven’tcreatedthe isofileyet
thenhere isa quickdescriptiononhowto dothis.
Create isoimage fromWindowsXPCD
Justinsertthe CD and type the followingcommandatthe RHEL/CentOSconsole
# ddif=/dev/cdromof=Wxp_sp2.iso
Aftersome time itwill create anisoimage (named“Wxp_sp2.iso”) of the insertedCD/DVDinyourcurrent
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
workingdirectory.
Note:You can alsocreate a Virtual Machine directlybythe CDROM/DVDwithoutcreatingthe isoimage.
Howeverinpractice we usuallymake andkeepiso’sof manyoperatingsystemsforreadyusage andto avoid
physical accessto serversooften.
Step1:
We will getascreenlike belowtochoose the methodof installation.We see clearlythatthe virt-manager
supportsbothISO andCDROM installation,italsosupportscomplex procedureslikeNetworkInstallandeven
PXE boot.
Choose a name of the Virtual Machine of the Virtual Machine.Inourcase we have chosen“Win_Xp”.
Step2:
Nowbrowse tothe locationwhere we have createdthe ISOfile andpointtoitas shownbelow.
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
Step3:
Nowwe have to assignthe amountof memoryandCPU whichwill be availabletothe Virtual Machine.Thisis
the maximumRAMthat the Virtual Machine will be able touse foritsownpurpose.A typical 512 MB memory
and 1 CPU will be okay.Tryto keepenoughamountof memoryforour base operating-system.
Step4:
We have allocated8GB for WindowsXPMachine.Butas we can see inthe image below itsays“4.6 Gb
available inthe defaultlocation”.Inthiscase the image cannotbe keptinthe defaultlocation.
So we have twooptioneitherwe decrease the allocatedsize orselectadifferentlocationinourexistingdisk
by clickingon“Selectmanagedorotherexistingstorage”.
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
Step5:
In the laststepwe will be verifyingthe parametersandproceedtofinal installationbyclickingonFinish
button.
Havingdone all these steps,we have nowsuccessfullycreateda WindowsMachine.Rememberthatthe
above stepsare similarforinstallinganyotheroperating-systemslike Ubuntu/Centos/Debian/Fedora/RHEL
etc.
You will be nowpresentedwiththe traditional WindowsSetup.
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
Lab-8 Installing Guest OS in KVM using Command Line
InstallingGuestOSin KVM usingCommandLine
Previouslywe’veinstalledguestOSinKVMusingthe graphical mode,i.e.usingthe virt-manager.Inmanyof
the cases probablywe’llnotalwaysbe havingthe graphical mode.Insuchsituationwe have toinstall using
the commandline tool.
We’ll use thevirt-installto install guestOSinKVMusingcommandline
virt-installsupportsrich setof optionstoinstall andalsoconfigure pre-installationoptionsof anewguestOS.
In the previousexample we installedwindowsoperating-systemusingthe graphical virt-managertool.Here
we will lookintoinstallingthe same WindowsXPhavingthe same configurationbutnow usingthe command
line.
# virt-install --name cmdWinxp --ram512 --diskpath=/home/gun/cmdWinxp.img,size=5--os-variantwinxp --
cdrom /home/gun/Wxp_sp2.iso
Startinginstall...
Creatingstorage file cmdWinxp.img|5.0 GB 00:00
Creatingdomain...|0 B 00:00
Domaininstallationstill inprogress.Waitingforinstallationtocomplete.
The above commandwill install aVirtual instance of the WindowsXPoperatingsystemwithname cmdWinxp
having512 MB available RAM.Withthe –diskoptionyoucan specifythe destinationpathof the OSImage file
and the size to allocate it.Since we are installingWindowsXPwe specifiedthe –os-variantwinxp.Andfinally
the source of the installationISO/CDROM.Inourcase itis an isoimage of WindowsXPlocatedat /home/gun.
For gettingvirt-installinformationwe canconsultthe manpage as follows.
# manvirt-install
There isone interestingoptiontoconsiderandthatis to install anyGuestoperatingsystem, inaninteractive
mannerwiththe –promptoptiontothe virt-install command.To illustrate this,We willinstallUbuntu11.10
GuestOS inKVMusingthe interactive feature of the virt-installcommand.
# virt-install --prompt
What isthe name of your virtual machine? ubuntu
How muchRAM shouldbe allocated(inmegabytes)? 512
What wouldyoulike touse as the disk(file path)?/home/gun/ubuntu.img
How large wouldyoulike the disk(/home/gun/ubuntu.img) tobe (ingigabytes)? 6
What isthe install CD-ROM/ISOorURL? /home/gun/ubuntu-11.10-desktop-i386.iso
Startinginstall...
Creatingstorage file ubuntu.img|6.0 GB 00:00
Creatingdomain...|0 B 00:00
So withthe helpof “virt-install–prompt”oncommandline we caninstall interactivelyanyguestoperating
systemeasily.
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
Starting/ StoppingGuestOperatingSystemsWithvirshCommand:The virshcommandcan be usedtomange
local or remote guestoperatingsystems.Thiscommandcanbe usedto create,pause,andshutdowndomains.
It can alsobe usedtolistcurrent domains.
To listRunningVMS
Type the followingcommand:
# virshlist
Sample outputs:
Id Name State
----------------------------------
1 cmdWinxprunning
2 ubunturunning
3 Winxprunning
ShutDown A Guest
# virshlist
# virshshutdowndominName
# virshshutdowncmdWinxp
# virshshutdown1
RebootingA Guest
# virshlist
# virshrebootdomaiName
# virshreboot2
# virshrebootubuntu
ForcefullyStopA Guest
Force a guestto stopwiththe virshcommandif it iscrashedor notresponding
# virshlist
# virshdestroydomainName
# virshdestroyWinxp
Get InformationAboutGuest
# virshlist
# virshdominfodominName
# virshdominfo2
# virshdominfoubuntu
Sample outputs:
Id: 2
Name:ubuntu
UUID: .........
OS Type:.........
State:running
CPU(s):1
CPU time:24.3s
Max memory:524288 kB
Usedmemory:524288 kB
Autostart:disable
Get InformationAboutNode
# virshnodeinfo
Sample Outputs:
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
CPU model:x86_64
CPU(s):4
CPU frequency:2394 MHz
CPU socket(s):1
Core(s) persocket:4
Thread(s) percore:1
NUMA cell(s):1
Memorysize:8181332 kB
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
Lab-9 Installation of VMware ESX Server
Installationof VMware ESX Server
Assumingthatwe didnotreceive ESX3i embeddedinourserver.
To downloadESXServer3i,we needthe installable 200MB ESX Server3i ISOimage(approx.).Togetthe same
fromvmware website we needtofilloutall the necessaryinformationandwillbe inapositiontodownload
the isoimage
. Once we have vmware ESX 3i isoimage,we can install itonany serverthatissupportedinthe VMware ESX
Server3i hardware compatible list.
1. Burn the VMware ESX server3i isoimage file ontoabootable CD.
2. Poweronthe serverafterinsertingthe burntCD intoCDDrive.(Make sure fromBIOSsetupthat the
firstbootoptionisset onto CDDrive)
3. We will getthe followingscreen:
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
We got “blackloading”screen,itswitchedto“yellowloading”screenafter some time whichisdepictedas
below:
At lastwe got the “Welcome toVMware ESXServer3i 3.5.0
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
PressentertoInstall andfurtherpressF11 to accept the license agreement.
Next,confirmthe installationbypressingF11aftergettingthe followingscreen.
The installationwill take few minuteshardly1or 2 minutes.Thanpressenterkeyforrebootingthe system.
Afterrebootingwe willgetthe followingscreen:
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
Nowwe have to pressF2 and access the slimmanagementinterface.There,we cansetthe root passwordand
configure astatic IP(andother networksettings) onthe server.
InstallingGuestOperatingSysteminVMware ESXServer
1. Openthe VMware Infrastructure Client(VIClient).Right-clickonESXServerandselectNewVirtual
Machine or pressCtrl+N.
2. Opt to create a Typical virtual machine inordertoreduce the numberof queriesthatare neededto
be answeredlaterandclicknextto continue further.
3. Next,name the newVirtual Machine andthanclickNext.
4. Selectthe Datastore thatthe newVirtual Machine will be storedinto.We canuse the local storage on
our ESX Server,andclickNext.
5. Choose the operatingsystemthatwe will be installing.Inourcase windowsXPandclickNext.
6. Choose the numberof Virtual Processors.Inourcase,optwiththe defaultof 1, and clickNext.
7. On nextscreenselectthe amountof RAMthat thisnew GuestVM will have.Inourcase,256MB of
RAMfor the newWindowsXPVM. clickNext.
8. Choose the numberof virtual NICsandthe virtual networksthatthe vNICswill be attachedto.Opt
here defaults.ClickNext.
9. Next,choose amountof diskspace thatwill be allocatedtothe guestvirtual disk.We can allocate the
defaultof 8GB. ClickNext.
10. Reviewthe settingsconfiguredforthe new guestVM,If everythingisasexpected,clickFinish.
11. Before startingorbootingthe new virtual machine,we needtoattachthe WindowsXPinstallation
media(CDROM) to the newvirtual machine.Todothis,selectthe new guestVM,thenclickEdit
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
Virtual Machine Settings(whichfallsunderthe Basictasksandlocatedjustbelow Poweronthe virtual
machine.)
12. In virtual machine propertieswindow,clickonthe Virtual CD/DVDDrive.Inourcase,we have the
WindowsXPinstallationmediainanISO file formatandstoredon the ESX server’slocal datastore.
Clickon Datastore ISOfile,andbrowse tothe WindowsXPISOfile.Andfinally,selectConnectat
poweron,thenpressOK.
13. Nowthat we are readyto install the operatingsystem, PowerOnthe new Virtual machine andmove
to the Console sothat we can go throughthe installationprocess.
14. Because the installationmediawasconnectedatpoweron,the WindowsCDshouldboot
automatically,inspectsthe hardware andstartsto loadfilesforWindowsSetup.We needtopress
here F6 functionkey,whenwe see the message “pressF6toloada SCSIdriver”,thisisbecause ESX
will use aBuslogicSCSIdriverbydefaultandwe needtodirectthe installertothe Buslogicdriver.
15. On the nextblue screen,atbottomside,we getmessage S=SpecifyAdditional Device,herepress“S”
to specifyaSCSIdriver.
16. Proceedingfurtherwe needtodownloadthe VMware SCSIDriversandhave thisfile availableonour
system.
17. Now,clickon to ConnectFloppybuttononVIClientToolbarandselectthe VMware SCSIDriversFLP
file thatwe have downloaded.Furtheronthe WindowsXPscreento"INSERTFLOPPYAND PRESS
ENTER" we needto PressEnter.
18. Hereafterwe shouldsee normal WindowXPSetup/Install screen.PressEntertobeingthe setup.
Now,followthe typical WindowsXPinstallationprocedure.
19. Once the file copygetscompleted,WindowsXPwill restart.Andatthatpoint,make sure we
disconnectthe virtual floppydisk.AfterthatWindowsXPrestarts,andwe will be answeringthe
typical WindowsXPsetupquestionsandournew WindowsXPVMware ESXServerGuestwill be ready
for use.
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
A. Appendix
Guest
A guest operating system that runs within a domain in Oracle VM Server. A guest may be
paravirtualized or hardware virtualized. Multiple guests can run on the same Oracle VM Server.
Hardware virtualized machine
A virtual machine with an unmodified guest operating system. It is not recompiled for the virtual
environment. There may be substantial performance penalties running as a hardware virtualized
guest. Enables Microsoft Windows™ operating system to be run, as well as legacy operating
systems. Hardware virtualization is only available on Intel VT or AMD SVM CPUs.
Host computer
The physical computer on which Oracle VM Server is installed.
Hypervisor
The hypervisor, monitor, or Virtual Machine Manager (VMM). It is the only fully privileged entity in
the system. It controls only the most basic resources of the system, including CPU and memory
usage, privilege checks, and hardware interrupts.
Master Oracle VM Server
A component of Oracle VM Agent. An application that acts as the contact point to Oracle VM
Manager, and to other Oracle VM Agents. Provides virtual machine host load-balancing, and local
persistence for Oracle VM Server.
There is only one master Oracle VM Server in a server pool. A physical server can perform as the
master Oracle VM Server, Utility Server and Virtual Machine Server simultaneously.
Oracle VM Agent
An application installed with Oracle VM Server. It communicates with Oracle VM Manager for
management of virtual machines. Oracle VM Manager manages the virtual machines running on
Oracle VM Server by communicating with Oracle VM Agent. It contains three components: master
Oracle VM Server, Utility Server, and Virtual Machine Server.
Oracle VM Server
A self-contained virtualization environment designed to provide a lightweight, secure, server-based
platform for running virtual machines. Oracle VM Server is based upon an updated version of the
Xen hypervisor technology. Includes Oracle VM Agent to enable communication with Oracle VM
Manager.
Oracle VM Manager
Provides the user interface, which is an Application Development Framework (ADF) web
application, to manage Oracle VM Server pools. Manages virtual machine life cycle, including
creating virtual machines from templates or from installation media, deleting, powering off,
uploading, deployment and live migration of virtual machines. Manages resources including ISO
files, templates and shared virtual disks.
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
QEMU
Also referred to as qemu-dm, which is the process name. The virtualization process which allows
full virtualization of a PC system within another PC system.
Server Pool
Logically an autonomous region that contains one or more physical Oracle VM Servers. Presents
a unified view of the storage where the virtual machines reside, and groups the users of these
virtual machines into a single community called a group, in which each user is a server pool
member.
Sparse Copy
A clone of the type "sparse copy" is a disk image file of a physical disk, taking up only the amount
of space actually in use; not the full specified disk size.
Thin Clone
A thin clone is a clone of a physical disk that takes up only the amount of disk space actually in
use; not the full specified disk size.
Utility Server
A component of Oracle VM Agent. An application that handles I/O intensive operations for virtual
machines, server pools and servers, for example, copying, moving and renaming files.
There can be more than one Utility Server in a server pool. A physical server can perform as the
master Oracle VM Server, Utility Server and Virtual Machine Server simultaneously.
V
vif
A virtual network interface for bridging network interfaces between domUs and dom0. When a
domU is started it is assigned a number. This number is used to bridge the network interface from
ethn to vifn.0.
Virtual disk
A file or set of files, usually on the host file system although it may also be a remote file system,
that appears as a physical disk drive to the guest operating system.
Virtual Machine
A guest operating system and the associated application software that runs within Oracle VM
Server. May be paravirtualized or hardware virtualized machines. Multiple virtual machines can run
on the same Oracle VM Server.
Virtual Machine Manager (VMM)
See Hypervisor.
Virtual Machine Server
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
A component of Oracle VM Agent. An application which runs Oracle VM Server virtual machines. It
can start and stop virtual machines, and collect performance data for the host and guest operating
systems. Enables communication between the master Oracle VM Server, Utility Server and Virtual
Machine Servers.
There can be more than one Virtual Machine Server in a server pool. A physical server can
perform as the master Oracle VM Server, Utility Server and Virtual Machine Server
simultaneously.
Virtual Machine Template
A template of a virtual machine. Contains basic configuration information such as the number of
CPUs, memory size, hard disk size, and network interface card (NIC). Create virtual machines
based on a virtual machine template using Oracle VM Manager.
----------------------------------*****-----------------------------------
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
Mode of Evaluation: Quiz/Program Execution/Written Examination
Mid Term Internal Evaluation { Internal – 50 Marks }
Continuous Assessment [30 Marks]
Lab Experiment and Demonstration [10 Marks]
Viva Voce [10 Marks]
Lab Experiment and Demonstration marks details
Status
Completed
and
Executed
accurately
Completed
but partially
Executed
Partially
written with
errors/no
execution
Logically
incorrect
program
Unacceptable
effort
Marks 9 - 10 7 - 8 5 - 6 3 - 4 1 - 2
Viva – Voce marks details
Status
Excellent
All answers
are
satisfactory
Very Good
Most of the
answers are
satisfactory
Good
Majority of
the answers
are
satisfactory
Average
Few answers
are
satisfactory
Below
Average
Rarely any
answer is
satisfactory
Marks 9 - 10 7 - 8 5 - 6 3 - 4 1 - 2
Final Term Internal Evaluation { Internal – 50 Marks }
Continuous Assessment [30 Marks]
Lab Experiment and Demonstration [10 Marks]
Viva Voce [10 Marks]
Lab Experiment and Demonstration marks details
Status
Completed
and
Executed
accurately
Completed
but partially
Executed
Partially
written with
errors/no
execution
Logically
incorrect
program
Unacceptable
effort
Marks 9 - 10 7 - 8 5 - 6 3 - 4 1 - 2
Viva – Voce marks details
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
Status
Excellent
All answers
are
satisfactory
Very Good
Most of the
answers are
satisfactory
Good
Majority of
the answers
are
satisfactory
Average
Few answers
are
satisfactory
Below
Average
Rarely any
answer is
satisfactory
Marks 9 - 10 7 - 8 5 - 6 3 - 4 1 - 2
Continuous assessment for each experiment
 Experiment [5 Marks] File and Viva – Voce [5 Marks]
Experiment Marks details
Status
Completed
and
Executed
perfectly
Completed
but partially
Executing
Partially
Written and
Errors
Logically
Incorrect
Program
Unacceptable
efforts
Marks 5 4 3 2 1
File and Viva-Voce Marks details
Status
File Checked
Timely and
Good Viva
File partially
checked and
Good Viva
File Checked
Timely and
Average
Viva
File Checked
Timely and
Bad Viva
File not
Checked
Timely and
Bad Viva
Marks 5 4 3 2 1
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
2. EXPERIMENTALSETUP DETAILS FOR THE COURSE
Software Requirements
Turbo C 2.0/Turbo C++3.0+, Lex or Flex and YACC tools (Unix/Linux utilities)
Hardware Requirements
No specific requirements.Any computer Hardwarecapableof running DOS can be
Used for this course.
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
School of Computing Science & Engineering
Course Name- Compiler Design Lab
Course Code- CSE-353
S. N. Title of Lab Experiments
1 Write a C program to simulate a DFA.
2 Write a program to minimize the number of states of a DFA
3 Write a program using Lex to count the number of characters, words,
spaces and lines in a given input file
4 Write a C program for dividing the given input program into lexemes.
and also simulate lexical analyzer for validating operators.
5 Write a C program to recognize strings under 'a', 'a*b+', 'abb'.
6 Study the structural and implementation process of lex and YACC tools
and prepare a detail analysis report.
7 Write a YACC program using lex to evaluate an arithmetic expression
involving operators +,-,* and /.
8 Write a lex program for separating integers, floating point numbers and
reserve words from a file.
9 Write YACC program using lex to recognize a valid variable, which
starts with a letter, followed by any number of letters or digits
10 Write a YACC program for desktop calculator.
11 Write a YACC Program to recognize nested IF control statements and
display the number of levels of nesting.
12 Write a program to implement 3 address code.
13 Write a program to create and print a symbol table that contains the
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
name, type and size of the identifier from a C file.
VALUE ADDED EXPERIMENT:
1 Design a compile for programming language C. The compiler is
consider only for some specific fragment of language like Declaration,
flow control etc. The compiler consists of three steps: Lexical analysis,
Parsing and Code Generation. The compiler should be written in C
using the lex and yacc Unix utility tools.
2 Design the lexical analysis and syntax analysis phase of a Text
encrypter using lex and YACC tools
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
5. GUIDELINES FOR CONTINUOUS ASSESSMENT
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
Internal Lab Assessment (End Semester)
S.
No.
Enrol.
No.
Name of the
Student
Continuou
s
assessmen
t (30)
Lab
Experimen
t & Demo
(10)
Viva
-
Voce
(10)
Tota
l
(50)
Marks
(in
words
)
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
Mid Term Internal Evaluation { Internal – 50 Marks }
Continuous Assessment [30 Marks]
Lab Experiment and Demonstration [10 Marks]
Viva Voce [10 Marks]
Lab Experiment and Demonstration marks details
Status
Completed
and
Executed
accurately
Completed
but partially
Executed
Partially
written with
errors/no
execution
Logically
incorrect
program
Unacceptable
effort
Marks 9 - 10 7 - 8 5 - 6 3 - 4 1 - 2
Viva – Voce marks details
Status
Excellent
All answers
are
satisfactory
Very Good
Most of the
answers are
satisfactory
Good
Majority of
the answers
are
satisfactory
Average
Few answers
are
satisfactory
Below
Average
Rarely any
answer is
satisfactory
Marks 9 - 10 7 - 8 5 - 6 3 - 4 1 - 2
Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
Final Term Internal Evaluation { Internal – 50 Marks }
Continuous Assessment [30 Marks]
Lab Experiment and Demonstration [10 Marks]
Viva Voce [10 Marks]
Lab Experiment and Demonstration marks details
Status
Completed
and
Executed
accurately
Completed
but partially
Executed
Partially
written with
errors/no
execution
Logically
incorrect
program
Unacceptable
effort
Marks 9 - 10 7 - 8 5 - 6 3 - 4 1 - 2
Viva – Voce marks details
Status
Excellent
All answers
are
satisfactory
Very Good
Most of the
answers are
satisfactory
Good
Majority of
the answers
are
satisfactory
Average
Few answers
are
satisfactory
Below
Average
Rarely any
answer is
satisfactory
Marks 9 - 10 7 - 8 5 - 6 3 - 4 1 - 2
Continuous assessment for each experiment
 Experiment [5 Marks] File and Viva – Voce [5 Marks]
Experiment Marks details
Status
Completed
and
Executed
perfectly
Completed
but partially
Executing
Partially
Written and
Errors
Logically
Incorrect
Program
Unacceptable
efforts
Marks 5 4 3 2 1
File and Viva-Voce Marks details
Status
File Checked
Timely and
Good Viva
File partially
checked and
Good Viva
File Checked
Timely and
Average
Viva
File Checked
Timely and
Bad Viva
File not
Checked
Timely and
Bad Viva
Marks 5 4 3 2 1

More Related Content

PPTX
Computer Lab Management System
PPT
5- Requirement.ppt
PDF
Software Engineering - Ch1
PDF
2- THE CHANGING NATURE OF SOFTWARE.pdf
DOCX
Library management system
PPT
Formal Specification in Software Engineering SE9
PPT
The Ideal Salesforce Development Lifecycle
PPTX
Ch17 distributed software engineering
Computer Lab Management System
5- Requirement.ppt
Software Engineering - Ch1
2- THE CHANGING NATURE OF SOFTWARE.pdf
Library management system
Formal Specification in Software Engineering SE9
The Ideal Salesforce Development Lifecycle
Ch17 distributed software engineering

What's hot (20)

PPT
SE CHAPTER 2 PROCESS MODELS
PPTX
database design of online food delivery.pptx
PPT
Requirements Engineering Processes in Software Engineering SE6
DOCX
Hospital Management Record System Proposal
PDF
MuleSoft Surat Meetup#54 - MuleSoft Automation
DOC
Software Design Description (SDD) sample
PPTX
Chapter 5 Agile Software development
PDF
04.project billing system
PPT
Chapter 01 software engineering pressman
PDF
Salesforce.com overview (1)
PPTX
Ch3-Software Engineering 9
PDF
Unit 5- Architectural Design in software engineering
PDF
How Atlassian Manages Risk and Compliance with JIRA Software and Confluence
PDF
Library management system project report II..pdf
PPTX
Effort Estimation: Meaning, Problems with Estimation, Basis, Estimation Techn...
PDF
10-Software Project Management (Object Oriented Software Engineering - BNU Sp...
PDF
Engineering Software Products: 2. agile software engineering
PPT
Software Quality Challenge
PPTX
Salesforce intro session_for_students_v2
PPTX
Structured Vs, Object Oriented Analysis and Design
SE CHAPTER 2 PROCESS MODELS
database design of online food delivery.pptx
Requirements Engineering Processes in Software Engineering SE6
Hospital Management Record System Proposal
MuleSoft Surat Meetup#54 - MuleSoft Automation
Software Design Description (SDD) sample
Chapter 5 Agile Software development
04.project billing system
Chapter 01 software engineering pressman
Salesforce.com overview (1)
Ch3-Software Engineering 9
Unit 5- Architectural Design in software engineering
How Atlassian Manages Risk and Compliance with JIRA Software and Confluence
Library management system project report II..pdf
Effort Estimation: Meaning, Problems with Estimation, Basis, Estimation Techn...
10-Software Project Management (Object Oriented Software Engineering - BNU Sp...
Engineering Software Products: 2. agile software engineering
Software Quality Challenge
Salesforce intro session_for_students_v2
Structured Vs, Object Oriented Analysis and Design
Ad

Viewers also liked (17)

PDF
DOCX
project 3 full report
PDF
Arduino Labs
PPT
The Internet of Things
PPTX
solar tracker
PDF
Dual axis tracker_final_report
PPTX
Solar tracker
PPT
Business plan yang menarik
PDF
(Contoh) Bisnis Plan
DOC
Contoh business plan
PPT
4 stroke petrol engine working principal
DOCX
anuj updated resume
DOCX
CV [Othman AlHashash]
PPTX
Sangiovese & Blends Wine
PPTX
№1 koshovyi grtb-3-9a
DOC
Reconfiguring ERICSSON RBS 884 Microcells for 3G Implementation (2)
PPTX
Compiler first set_followset_brief
project 3 full report
Arduino Labs
The Internet of Things
solar tracker
Dual axis tracker_final_report
Solar tracker
Business plan yang menarik
(Contoh) Bisnis Plan
Contoh business plan
4 stroke petrol engine working principal
anuj updated resume
CV [Othman AlHashash]
Sangiovese & Blends Wine
№1 koshovyi grtb-3-9a
Reconfiguring ERICSSON RBS 884 Microcells for 3G Implementation (2)
Compiler first set_followset_brief
Ad

Similar to lab manual (pata ni) (20)

PDF
Building your own Desktop Cloud Environment
DOC
SOP - 2013 Server Build
DOC
Manual 70-410 _Yves
PDF
12849144 how-to-install-a-cccam-server-on-windows
DOCX
software Documentation Certificate in department of computer
PPTX
Virtualization technology "comparison vmware 9 vs virtualbox 4.2"
DOC
Taishaun_OwnensCNS-533_Lab
PPTX
Managing enterprise with PowerShell remoting
PDF
Build a private cloud – prototype and test with open nebula
PDF
Akmal Khaleeq Waheed - Challenge 3
PDF
DevOpsDays Amsterdam Cosmic workshop
PPT
TechMentor Fall, 2011 - WDS Tricks You Didn't Know
DOCX
Vmware inter
DOCX
BLCN532 Lab 1Set up your development environmentV2.0.docx
PDF
Deployment serviceswd sinwindowsserver2008
 
DOCX
MDT Step public
PPT
Pro watch max pro class ppt5
DOCX
Managing Web Infrastructure Systems with Windows PowerShell 2.0 Demo Script
PDF
Quick-Start Guide: Deploying Your Cloudian HyperStore Hybrid Storage Service
Building your own Desktop Cloud Environment
SOP - 2013 Server Build
Manual 70-410 _Yves
12849144 how-to-install-a-cccam-server-on-windows
software Documentation Certificate in department of computer
Virtualization technology "comparison vmware 9 vs virtualbox 4.2"
Taishaun_OwnensCNS-533_Lab
Managing enterprise with PowerShell remoting
Build a private cloud – prototype and test with open nebula
Akmal Khaleeq Waheed - Challenge 3
DevOpsDays Amsterdam Cosmic workshop
TechMentor Fall, 2011 - WDS Tricks You Didn't Know
Vmware inter
BLCN532 Lab 1Set up your development environmentV2.0.docx
Deployment serviceswd sinwindowsserver2008
 
MDT Step public
Pro watch max pro class ppt5
Managing Web Infrastructure Systems with Windows PowerShell 2.0 Demo Script
Quick-Start Guide: Deploying Your Cloudian HyperStore Hybrid Storage Service

Recently uploaded (20)

PPTX
701301-Happy Birthday Slideshow Template.pptx
PDF
CityofHorror_v1.1.pdf manual en español i
PPTX
continuous_steps_relay.pptx. Another activity
PDF
What is Rotoscoping Best Software for Rotoscoping in 2025.pdf
PDF
WKA #29: "FALLING FOR CUPID" TRANSCRIPT.pdf
PPTX
Introduction to NGO’s098765789709876.pptx
DOCX
Talking Owls and Time Travel: Lessons in Curiosity
PDF
Best IPTV Service Providers in the UK (2025) – Honest Reviews & Top Picks
PDF
Hip Hop Culture – More Than Just Music & Style
PDF
WKA #29: "FALLING FOR CUPID" TRANSCRIPT.pdf
PDF
Lucky_MangA chapter 2. Story and Art by Enaji Studio
PDF
Download GTA 5 Free Full PC Game+Latest Version 2025
PPTX
Social Awareness on Municipal Solid Waste.pptx
PPTX
Picture Perception - a constructive narrative
PPTX
understanding the Human DNA components database design
PPTX
Health_System_in_India_Oasrganization_BSc_Nursing.pptx
DOC
UNG毕业证学历认证,阿莱恩特国际大学毕业证文凭证书
PPTX
Goal - its setting ,tracking and relevance
DOCX
Elisabeth de Pot, the Witch of Flanders .
PPTX
Kulipari: Army of Frogs Movie - OVFX Story Internship 2023
701301-Happy Birthday Slideshow Template.pptx
CityofHorror_v1.1.pdf manual en español i
continuous_steps_relay.pptx. Another activity
What is Rotoscoping Best Software for Rotoscoping in 2025.pdf
WKA #29: "FALLING FOR CUPID" TRANSCRIPT.pdf
Introduction to NGO’s098765789709876.pptx
Talking Owls and Time Travel: Lessons in Curiosity
Best IPTV Service Providers in the UK (2025) – Honest Reviews & Top Picks
Hip Hop Culture – More Than Just Music & Style
WKA #29: "FALLING FOR CUPID" TRANSCRIPT.pdf
Lucky_MangA chapter 2. Story and Art by Enaji Studio
Download GTA 5 Free Full PC Game+Latest Version 2025
Social Awareness on Municipal Solid Waste.pptx
Picture Perception - a constructive narrative
understanding the Human DNA components database design
Health_System_in_India_Oasrganization_BSc_Nursing.pptx
UNG毕业证学历认证,阿莱恩特国际大学毕业证文凭证书
Goal - its setting ,tracking and relevance
Elisabeth de Pot, the Witch of Flanders .
Kulipari: Army of Frogs Movie - OVFX Story Internship 2023

lab manual (pata ni)

  • 1. LAB MANUAL CSE-247P: Introduction to Virtualization and Cloud Computing Lab. LAB MANUAL L T P 3 0 1 Course Type CORE Semester Offered 4th Academic Year 2016-2017 Slot L27-L28 Class Room Faculty Details: Name Mr. Gautam Kumar Website link Designation Asst. Professor School Schoolof Computing Science andEngineering Cabin No C-432 Intercom ------- Open Hours Thursday(9:30 AM to 11.00 AM) Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
  • 2. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar Table of Contents 1. Course details 1.1. Course objective (s) 1.2. Pre-requisites 1.3. Learning Outcomes 1.4. Syllabus & References 2. Experimental Setup details for the course. 3. List of Experiments 5.1. Format for continuous assessment 5.2. Format for internal end semester assessment 5.1. Format for continuous assessment 5.2. Format for internal end semester assessment 4. Experiment details 5. Guidelines for continuous assessment 5.1. Format for continuous assessment 5.2. Format for internal end semester assessment
  • 3. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar 1. COURSE DETAILS 1.1 Course Objective(s) The objective of this course is to: 1. To impart fundamental concepts in the area of cloud computing 2. To impart knowledge in applications of cloud computing 3. Introduction to virtualization technologies 4. Virtual machines installation, configuration and administration 1.2 Pre- requisite 1. Knowledge of Basic computer Science. 1.3 Course Outcomes At the end of the course student will be able to: 1) Explain the principles of the VMware workstation and understand the installation process of VMWare workstation. 2) Demonstrate the concept of QEMU on UBUNTU platform. 3) Demonstrate information regarding the KVM on UBUNTU . 4) Ability to learn the management of virtual machine 5) Ability to understand the concept of ESX server 6) Explain the principles of the justcloud and setup of own cloud
  • 4. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar School of Computing Science & Engineering Course Name-Introduction to Virtualization and Cloud Computing Lab.Course Code-CSE-247 P LIST OF EXPERIMENTS Sr. No. Title of Lab Experiments 1. Installation of VMWare Workstation and get acquainted with its dashboard. 2. Creation of VM image of Windows XP. Show the virtual machine migration based on the certain condition from one node to the other. 3. Creation of VM image of base operating system. Install a C compiler in the virtual machine and execute a sample program. 4. Installation of QEMU on Ubuntu 12.10 5. Creating and Using Virtual Machine Using QEMU 6. KVM on Ubuntu 12.10 and managing a VM on it. 7. KVM and guest operating system on CentOS6.3 8. Installing Guest OS in KVM using Command Line 9. Installation of VMware ESX Server Value Added List of Experiments 1. Installation and Configuration of Justcloud. 2. Installation and Configuration of CloudLab? Instructor In charge GALGOTIAS UNIVERSITY Plot No.2, Sector 17-A, Yamuna Expressway, Greater Noida, GautamBuddh Nagar, U.P., India
  • 5. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar Lab Manual Lab-1 Installation of VMWare Workstation and get acquainted with its dashboard. Solution. 1. DownloadVMware-workstation-full-9.0.1-894247.exe filefromthe followingsite : http://freewareupdate.com/developer-tools/download-vmware-workstation 2. Install the downloadedfile VMware-workstation-full-9.0.1-894247.exe bydouble clickingthe same. 3. You will getthe followingscreen: 4. PressNext,thanyouwill getthe followingScreen:
  • 6. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar 5. Clickon Typical,Youwill be gettingthe followingScreen 6. Presson Next,afteroptingtochange the defaultlocation,Youwillbe gettingthe followingscreen
  • 7. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar 7. AfterwardsPressNexttwice,thanwe will getthe followingscreenshot: 8. PressContinue,thaninstallationprocessstartsandyouwill be gettingthe followingfigure while installationandthatmaytake few minutestocomplete :
  • 8. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar 9. NextYouwill getthe followingscreen,askingyoutoenterthe License Key,if youhave anyyoucan use the same or pressskiptouse trail version. 10. Finallywe will getthe followingscreen,andpresshere the Finishbutton.
  • 9. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar Thiscompletesthe installationof VMware Workstation.
  • 10. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar Lab-2 Creation of VM image of Windows XP. Show the virtual machine migration based on the certain condition from one node to the other. Creation of VM image of Windows XP Afterinstallationof VMware Workstaion,double clickonvmware workstationiconcreatedondesktop,we will getthe followingscreen: 1. SelectonYes,I accept the termsin the license agreement,andproceedfurtherbyclickingonOK button.We will be gettingthe followingscreen:
  • 11. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar 2. Amongmanyoptionsavailable inthe above screenclickonCreate aNew Virtual Machine.Youwill be gettingthe followingscreen: 3. Before pressingNextbuttontocontinue,make sure of the availabilityof WindowsXPCDinside the CD Tray or you will be requiringthe isoimage of WindowsXP,once afterpressingthe Nextbuttonyou will getthe followingscreen
  • 12. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar 4. PressNextButton, we will getthe followingscreen: 5. Enter the WindowsProductkey,Name andcontinue,youwillgetthe followingscreen:
  • 13. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar 6. PressNext,we will getthe followingscreen: 7. PressNexttocontinue,finallywe will getthe followingconfirmationscreen:
  • 14. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar 8. PressFinishbutton,if youfindeverythingisOK,thanwe will getthe followingscreen: 9. Presson Close Button,we will getthe followingscreen:
  • 15. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar 10. On the above screen,pressonPoweronthisvirtual machine,itwill asktoenterthe license keyfor VMware workstaion,if youhave anysuch,proceedfurther.Whichinturnappears(inthe window),as if,we are installingthe windowsXPona physical systemasshownbelow.If youdon'thave the license than downloadthe VMplayer5.0.0, whichisfreelydownloadable,andafterinstallingthe VMPlayer youcan use the same for furtherinstallingthe WindowsXPasa virtual machine.
  • 16. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar Thiscompletesthe creationof WindowsXPvirtual machine.
  • 17. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar Lab-3 Creation of VM image of base operating system. Install a C compiler in the virtual machine and execute a sample program. Creationof VM image of base operatingsystem 1. In figure 10 you gota optionVirtualize aPhysical machine.Once afterclickingonthat,itwill redirect to downloadthe VMware vCenterConverter. We can directlydownloadVMware vCenterConverterStandalone5.0.1from the followingsite : https://my.vmware.com/web/vmware/info/slug/infrastructure_operations_management/vmware_vc enter_converter_standalone/5_0 Once afterdownloadingthe VMware vCenterConverterstandalone5.0.1,install the same,inturnit createsthe icon ondesktop.Clickthe VMware vCenterConverterStandalone Clienticonyouwill get the followingscreen: 2. Selectthe optionConnecttoa local serverandyou will getthe below screen:
  • 18. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar 3. Clickon Convertmachine,we will getfollowingscreen: 4. Selectsource type asPowered-onmachine,Specifythe powered-onmachine asThe Local machine, PressNext.youwill getthe below screen:
  • 19. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar 5. ClickNext,afterselectingdestinationtype asVMware workstationorotherVMware virtual machine, selectVMware productas VMware Player4.0.x,type user-definedvirtualmachine name andselect the locationwhereinyouare desiringtostore Virtual machine. 6. Afterpressingthe Nextinthe above windowwe willgetthe below summarywindow asshownbelow
  • 20. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar 7. FinallypressonFinishbutton,itwillstarttocreate the Local system'sVM. Thus VMimage of base operatingsystemgetscreated.
  • 21. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
  • 22. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar Virtual Machine UsingQEMU Lab-4 Installation of QEMU on Ubuntu 12.10 Installation of QEMU on Ubuntu 12.10 Type sudoapt-getinstall qemu-kvm $ sudoapt-getinstall qemu-kvm [sudo] passwordforUserID: Enter the passwordof the userwho hasthe rootprivileges.Thiswillstarttodownloadthe qemu-kvmfrom internet. Afterdownloading,itwill installqemu.Alsomake sure the gnome GUIis installed,if gnome isnotinstalled, youcan downloadandinstall the same bytypingthe followingcommand h$ sudo aptitude installgnome Afterdownloadingandinstallationof gnome,we needtorebootthe system, bytypingthe commandas follows: $ sudoreboot
  • 23. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar Lab-5 Creating and UsingVirtual Machine Using QEMU Creating Virtual Machine on Ubuntu 12.10 platform Type qemu-system-x86_64-hdawinxp -cdromcd.iso -m192 -bootd Herewinxpisavirtual diskwhichisneededforthe virtual machine.A virtual diskismade bycreatingafile of a size appropriatelylarge tocontainthe full guestOS. You can create the virtual diskbyusingthe commandqemu-imgcreate winxp3G,which inturn createsthe winxpvirtual diskwith3GB diskspace. Here cd.isoisa isoimage of guestoperatingsystem, youcanuse the isoimage file if itwasalreadycreated,it it isnot created,youcan create the iso image file byusingthe commandddif=/dev/cdromof=cd.isofor cdrom image or ddif=/dev/dvdof=dvd.isofordvdimage. Suppose if youhave the WindowsXPCDina CD/DVDtray and wantto create the WindowsXPvirtual machine, youhave to proceedas below: 1. Create the WindowsXPisoimage as cd.isofile bytypingthe commandasfollows: $ ddif=/dev/cdromof=cd.iso 2. Beinginthe same directory,create the virtual diskof size 3GB diskspace as winxp,bytypingthe commandas follows: $ qemu-imgcreate winxp3G 3. Beinginthe same directoryexecute the followingcommand: $ qemu-system-x86_64-hdawinxp -cdromcd.iso -m192 -bootd 4. ThiscommandinstructsQEMU to use hdaas the emptydiskfile.Itusescd.isofile asif installingfrom the CDROM, and setsthe amountof memoryto use inthe virtual machine tobe 192Mb. It then instructsto bootfromthe CDROM. As the installerbootsandgoesthroughoptions,choose the defaultsateachstep.The installershould detectthe virtual networkproperlyandinstallwithoutdiificulties. Thiscompletesthe CreatingVirtualMachine usingQEMU onUbuntu 12.10 Using the Virtual Machine on Ubuntu 12.10 platform Beinginthe same directory,runthe followingcommand $ qemu-system-x86_64–hdawinxp [Note :If youhave Ubuntu 32 bitversionyouneedtouse qemu-system-i386]
  • 24. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar Lab-6 KVM on Ubuntu 12.10 and managing a VM on it. KVM on Ubuntu12.10 1. Make sure your hardware supportsthe necessaryvirtualizationextensionsforKVM.Enterthe followingfromaterminal prompt: $ kvm-ok A message will be printed informingyouif yourCPU doesor doesnotsupporthardware virtualization. You shouldgetthe followinginformation INFO:Your CPU supportsKVMextensions. INFO:/dev/kvmdoesnotexist KVMaccelerationcannotbe used. 2. As we will be requiringrootprivileges,type the commandasbelow : $ sudosu 3. Downloadandinstall kvm,bytypingthe followingcommand: # apt-getinstall kvm 4. Type the followingcommandtoinstall libvirt-bin # apt-getinstall libvirt-bin 5. To check the KVMhassuccessfullybeeninstalled, runthe followingcommand # virsh-c qemu:///systemlist whichinturn displaysasfollows: ID Name State If it displaysanerrorinstead,thansomethingwentwrong. 6. Type the command once againkvm-okona prompt,now youshouldgetthe followingdisplay: # kvm-ok INFO:Your CPU supportsKVMextensions INFO:/dev/kvmexists KVMaccelerationcanbe used
  • 25. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar 7. Installingvirt-install $ sudoapt-getinstall virtinst 8. Installingvirt-managerOnYour Ubuntu12.10 Desktop We needameansof connectingtothe graphical console of ourguests - we can use virt-viewerorvirt- manager,forthis.I'm assumingthatyou're usingan Ubuntu 12.10 desktop(itdoesn'tmatterif itis a remote desktoporif the desktopisinstalledonthe Ubuntu12.10 KVMserver!). I suggestyouuse virt-managerinsteadof virt-viewerbecause virt-managerletsyoualsocreate and delete virtual machinesanddoothertasks.virt-managercanbe installedasfollows: $ sudoapt-getinstall virt-manager 9. Install libvirt # apt-getinstall libvirt-bin # adduser`id -un`libvirtd # adduser`id -un`kvm 10. Install firefox # apt-getinstall firefox # apt-getinstall ubuntu-virt-serverpython-vm-builderkvm-ipxe 11. Nextwe needtosetup a networkbridge onourserverso that our virtual machinescanbe accessed fromotherhosts as if theywere physical systemsinthe network. <> # apt-getinstall bridge-utils To do this,we install the package bridge-utils... apt-getinstall bridge-utils ...and configure abridge.Open/etc/network/interfaces: vi /etc/network/interfaces Before the modification,myfilelooksasfollows: # Thisfile describesthe networkinterfacesavailableonyoursystem # andhow to activate them.Formore information,see interfaces(5). # The loopbacknetworkinterface auto lo iface loinetloopback # The primarynetworkinterface auto eth0 iface eth0inetstatic address192.168.0.100 netmask255.255.255.0 network192.168.0.0 broadcast 192.168.0.255 gateway192.168.0.1 dns-nameservers8.8.8.88.8.4.4
  • 26. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar I change it so thatit lookslike this: # Thisfile describesthe networkinterfacesavailableonyoursystem # andhow to activate them.Formore information,see interfaces(5). # The loopbacknetworkinterface auto lo iface loinetloopback # The primarynetworkinterface auto eth0 iface eth0inetmanual auto br0 iface br0 inetstatic address192.168.0.100 network192.168.0.0 netmask255.255.255.0 broadcast 192.168.0.255 gateway192.168.0.1 dns-nameservers8.8.8.88.8.4.4 bridge_portseth0 bridge_fd9 bridge_hello2 bridge_maxage 12 bridge_stpoff (Make sure you use the correct settingsforyournetwork!) Restartthe network... /etc/init.d/networking restart ...and run ifconfig It shouldnowshowthe networkbridge (br0): root@server1:~#ifconfig br0 Linkencap:EthernetHWaddr00:1e:90:f3:f0:02 inetaddr:192.168.0.100 Bcast:192.168.0.255 Mask:255.255.255.0 inet6 addr:fe80::21e:90ff:fef3:f002/64 Scope:Link UP BROADCASTRUNNINGMULTICAST MTU:1500 Metric:1 RX packets:29 errors:0 dropped:0overruns:0frame:0 TX packets:29errors:0 dropped:0overruns:0carrier:0 collisions:0txqueuelen:0 RX bytes:1934 (1.9 KB) TX bytes:2844 (2.8 KB) eth0 Linkencap:EthernetHWaddr00:1e:90:f3:f0:02 UP BROADCASTRUNNINGMULTICAST MTU:1500 Metric:1 RX packets:44613 errors:0 dropped:0overruns:0frame:0 TX packets:23445 errors:0 dropped:0overruns:0carrier:0 collisions:0txqueuelen:1000
  • 27. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar RX bytes:63663064 (63.6 MB) TX bytes:1792940 (1.7 MB) Interrupt:41Base address:0xa000 lo Linkencap:Local Loopback inetaddr:127.0.0.1 Mask:255.0.0.0 inet6addr:::1/128 Scope:Host UP LOOPBACKRUNNINGMTU:16436 Metric:1 RXpackets:0 errors:0dropped:0overruns:0frame:0 TX packets:0errors:0 dropped:0overruns:0carrier:0 collisions:0txqueuelen:0 RXbytes:0(0.0 B) TX bytes:0(0.0 B) virbr0 Linkencap:EthernetHWaddr2a:4a:49:13:de:8f inetaddr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0 UP BROADCASTMULTICAST MTU:1500 Metric:1 RX packets:0errors:0 dropped:0overruns:0frame:0 TX packets:0errors:0 dropped:0overruns:0carrier:0 collisions:0txqueuelen:0 RXbytes:0(0.0 B) TX bytes:0(0.0 B) root@server1:~# Before we startour firstvirtual machine,Irecommendtorebootthe system: reboot If you don't dothis,youmightget an error like open/dev/kvm:Permissiondeniedinthe virtual machinelogs inthe /var/log/libvirt/qemu/directory. CreatingAnImage-BasedVM We can nowcreate our firstVM - an image-basedVM(if youexpectlotsof trafficandmanyread- and write operationsforthatVM, use an LVM-basedVMinsteadasshowninchapter6 - image-basedVMsare heavyon hard diskIO). I wantto create myvirtual machinesinthe directory/var/lib/libvirt/images/(theycannotbe created inthe /rootdirectorybecause the libvirt-qemuuserdoesn'thave readpermissionsinthatdirectory). We will create anewdirectoryforeach VMthat we wantto create,e.g./var/lib/libvirt/images/vm1, /var/lib/libvirt/images/vm2,/var/lib/libvirt/images/vm3,andsoon, because eachVMwill have asubdirectory calledubuntu-kvm,andobviouslythere canbe justone suchdirectoryin/var/lib/libvirt/images/vm1,for example.If youtryto create a secondVMin /var/lib/libvirt/images/vm1,forexample,you will getanerror message sayingubuntu-kvmalreadyexists(unlessyourunvmbuilderwiththe --dest=DESTDIRargument): root@server1:/var/lib/libvirt/images/vm1#vmbuilderkvmubuntu -cvm2.cfg 2009-05-07 16:32:44,185 INFO Cleaningup ubuntu-kvmalreadyexists root@server1:/var/lib/libvirt/images/vm1#
  • 28. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar We will use the vmbuildertool tocreate VMs. (Youcan learnmore about vmbuilderhere.) vmbuilderusesa template tocreate virtual machines - thistemplate islocatedinthe /etc/vmbuilder/libvirt/directory.Firstwe create a copy: mkdir-p/var/lib/libvirt/images/vm1/mytemplates/libvirt cp /etc/vmbuilder/libvirt/*/var/lib/libvirt/images/vm1/mytemplates/libvirt/ Nowwe come to the partitioningof ourVM.We create a file calledvmbuilder.partition... vi /var/lib/libvirt/images/vm1/vmbuilder.partition ...and define the desiredpartitionsasfollows: root 8000 swap4000 --- /var 20000 Thisdefinesarootpartition(/) witha size of 8000MB, a swap partitionof 4000MB, anda /varpartitionof 20000MB. The --- line makesthatthe followingpartition(/varinthisexample) isonaseparate diskimage (i.e., thiswouldcreate twodiskimages,one forrootand swapand one for /var).Of course,you are free to define whateverpartitionsyoulike(aslongas youalsodefine rootandswap),andof course,theycan be in justone diskimage - thisis justan example. I wantto install openssh-serverinthe VM.To make sure that eachVM getsa unique OpenSSHkey,we cannot install openssh-serverwhenwe create the VM.Therefore we create ascriptcalledboot.shthatwill be executedwhenthe VMisbootedforthe firsttime.Itwill install openssh-server(withaunique key) andalso force the user (Iwill use the defaultusername administratorformyVMs together withthe defaultpassword howtoforge) tochange the passwordwhenhe logsinforthe firsttime: vi /var/lib/libvirt/images/vm1/boot.sh # Thisscriptwill runthe firsttime the virtual machine boots # It isran as root. # Expire the useraccount passwd-e administrator # Install openssh-server apt-getupdate apt-getinstall -qqy --force-yesopenssh-server Make sure youreplace the username administratorwithyourdefaultloginname. Nowtake a lookat $ vmbuilderkvmubuntu --help to learnaboutthe available options. To create our firstVM, vm1, we go to the VMdirectory... cd /var/lib/libvirt/images/vm1/ ...and run vmbuilder,e.g.asfollows:
  • 29. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar vmbuilderkvmubuntu --suite=precise --flavour=virtual --arch=amd64-- mirror=http://de.archive.ubuntu.com/ubuntu -o--libvirt=qemu:///system --ip=192.168.0.101 -- gw=192.168.0.1 --part=vmbuilder.partition --templates=mytemplates --user=administrator-- name=Administrator--pass=howtoforge--addpkg=vim-nox --addpkg=unattended-upgrades --addpkg=acpid -- firstboot=/var/lib/libvirt/images/vm1/boot.sh --mem=256--hostname=vm1--bridge=br0 Most of the optionsare self-explanatory. --partspecifiesthe file withthe partitioningdetails,relative toour workingdirectory(that'swhywe hadto go to our VMdirectorybefore runningvmbuilder), --templates specifiesthe directorythatholdsthe templatefile(againrelativetoourworkingdirectory),and --firstboot specifiesthe firstbootscript. --libvirt=qemu:///systemtellsKVMtoadd thisVMto the listof available virtual machines. --addpkgallowsyoutospecifyUbuntupackagesthatyouwantto have installedduringthe VM creation(see above whyyoushouldn'taddopenssh-servertothat listanduse the firstbootscriptinstead). -- bridge setsupa bridgednetwork;aswe have createdthe bridge br0in chapter2, we specifythatbridge here. In the --mirrorline,youcanspecifyanofficial Ubunturepositoryin --mirror,e.g. http://de.archive.ubuntu.com/ubuntu.If youleave out --mirror,thenthe defaultUbunturepository (http://archive.ubuntu.com/ubuntu) will be used. If you specifyanIPaddressinthe --ipswitch,make sure thatyoualsospecifythe correctgatewayIPusingthe --gwswitch(otherwise vmbuilderwill assumethatitisthe firstvalidaddressinthe networkwhichmightnot be correct).Usuallythe gatewayIPis the same that you use in/etc/network/interfaces(see chapter2). The buildprocesscan take a fewminutes. Afterwards,youcanfindan XML configurationfileforthe VMin/etc/libvirt/qemu/(=> /etc/libvirt/qemu/vm1.xml): ls-l /etc/libvirt/qemu/ root@server1:/var/lib/libvirt/images/vm1#ls -l /etc/libvirt/qemu/total 8 drwxr-xr-x 3rootroot 4096 May 21 13:00 networks -rw------- 1rootroot 2082 May 21 13:15 vm1.xml root@server1:/var/lib/libvirt/images/vm1# The diskimagesare locatedinthe ubuntu-kvm/subdirectoryof ourVMdirectory: ls-l /var/lib/libvirt/images/vm1/ubuntu-kvm/ root@server1:/var/lib/libvirt/images/vm1#ls -l /var/lib/libvirt/images/vm1/ubuntu-kvm/ total 604312 -rw-r--r-- 1root root 324337664 May 21 13:14 tmpE4IiRv.qcow2 -rw-r--r-- 1root root 294715392 May 21 13:15 tmpxvSVOT.qcow2 root@server1:/var/lib/libvirt/images/vm1# If you wantto create a secondVM(vm2),here'sa shortsummaryof the commands: mkdir-p/var/lib/libvirt/images/vm2/mytemplates/libvirt cp /etc/vmbuilder/libvirt/*/var/lib/libvirt/images/vm2/mytemplates/libvirt/ vi /var/lib/libvirt/images/vm2/vmbuilder.partition vi /var/lib/libvirt/images/vm2/boot.sh
  • 30. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar cd /var/lib/libvirt/images/vm2/ vmbuilderkvmubuntu--suite=precise --flavour=virtual --arch=amd64-- mirror=http://de.archive.ubuntu.com/ubuntu -o--libvirt=qemu:///system --ip=192.168.0.102 -- gw=192.168.0.1 --part=vmbuilder.partition --templates=mytemplates --user=administrator-- name=Administrator--pass=howtoforge--addpkg=vim-nox --addpkg=unattended-upgrades --addpkg=acpid -- firstboot=/var/lib/libvirt/images/vm2/boot.sh --mem=256--hostname=vm2--bridge=br0 (Please note thatyoudon'thave to create a new directoryforthe VM(/var/lib/libvirt/images/vm2) if youpass the -d DESTDIR argumentto the vmbuildercommand - itallowsyouto create a VMin a directorywhere you've alreadycreatedanotherVM.Inthat case youdon't have to create new vmbuilder.partitionandboot.sh filesanddon'thave to modifythe template,butcansimplyuse the existingfiles: cd /var/lib/libvirt/images/vm1/ vmbuilderkvmubuntu --suite=precise --flavour=virtual --arch=amd64-- mirror=http://de.archive.ubuntu.com/ubuntu -o--libvirt=qemu:///system --ip=192.168.0.102 -- gw=192.168.0.1 --part=vmbuilder.partition --templates=mytemplates --user=administrator-- name=Administrator--pass=howtoforge--addpkg=vim-nox --addpkg=unattended-upgrades --addpkg=acpid -- firstboot=/var/lib/libvirt/images/vm1/boot.sh --mem=256--hostname=vm2--bridge=br0-dvm2-kvm)
  • 31. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar Lab-7 KVM and guest operating system on CentOS 6.3 KVM and guest operatingsystemon CentOS6.3 The KVM(Kernel Virtual Machine) isaVirtualizationenvironmentforthe Linux Kernel.We will see here how to install KVMVirtualization. Pre-requisites You will needfollowingSystemSpecifications: 1. VirtualizationenabledinBIOS.. 2. A processorwhichsupportsVirtualization. 3. A 64-bitversionof the Operating-System(CentOS6.3). 4. 64-bit hardware architecture Firstyou needtoenable the VirtualizationinyourBIOS. Secondlycheckthe processorcompatibilityforVirtualizationbythe helpof /proc/cpuinfo fileasmentioned earlier. Finallycheckforthe 64-bit versionor32-bitof operatingsystemandhardware architecture byrunningthe followingcommand # uname -a The 32 bitsystemwill showi686and i386 afterthe install date andtime. The 64 bitserverwill showx86_64 numeroustimesafterthe install date andtime. or justtype # uname-m Nowcheckfor the SELinux disabledornot,youneedtodisable the SELinux,fordisablingthe SELinux,follow the belowsteps: # vi /etc/selinux/config setSELINUX=disabledinthe file andsave.Afterwardsrebootthe server. In orderto effectivelyinstall KVMvirtualizationandconfigure GuestOS,youneedtoinstall multiple packages. All suchpackagesare providedundercertainpackage groupsinRHEL 6 standardinstallationDVD.The groups are Virtualization,VirtualizationPlatform,VirtualizationClients.VirtualizationTools VirtualizationProvidesanenvironmentforhostingvirtualizedguests. Packages :qemu-kvm,qemu-kvm-tools VirtualizationPlatform Provides aninterface foraccessingandcontrollingvirtualizedguestsandcontainers. Mandatory Packages:libvirt,libvirt-client Optional Packages: fence-virtd-libvirt,fence-virtd-multicast,fence-virtd-serial,libvirt-cim, libvirt-java,libvirt- qpid,perl-Sys-Virt VirtualizationClientClientsforinstallingandmanagingvirtualizationinstances. Mandatory Packages: python-virtinst,virt-manager,virt-viewer DefaultPackages:virt-top VirtualizationToolsToolsforoffline virtual image management DefaultPackages:libguestfs, Optional Packages:libguestfs-java,libguestfs-mount,libguestfs-tools,virt-v2v
  • 32. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar We can install all these packagesbyusingyumasfollows. # yumgroupinstall Virtualization # yumgroupinstall “VirtualizationPlatform” # yumgroupinstall “VirtualizationClient” # yumgroupinstall “VirtualizationTools” You can verifythe successful KVMinstallationbythe followingcommand # lsmod|grepkvm kvm_intel 45674 0 kvm291811 1 kvm_intel Nowthat youhave verifiedsuccessfully,youmaycheck/startthe libvirtddaemonprocessasfollows # service libvirtdstatus libvirtd(pid6914) isrunning... Do not forgetto runthe followingcommandif youwanttorun the libvirtddaemonatboottime onrunlevels 3 and 5. # chkconfig--level35libvirtdon Afteryouhave installedthe packageswe will findanew menuoptiontolaunchthe VMManager under Application-> System Tools-> Virtual Machine Manager InstallingguestoperatingsystemusingKVM: We needtoclickon the monitoriconjust below the “File”menu of Virtual Machine Managerwindowsasa firststepof VMCreation.Here will take the exampleof Windows XP GuestOS.We will see howtoinstall WindowsXPonKVMusingVMManager.It is assumedthatwe have createdthe isofile fromthe WindowsXPcd before proceedingtoinstall.If we haven’tcreatedthe isofileyet thenhere isa quickdescriptiononhowto dothis. Create isoimage fromWindowsXPCD Justinsertthe CD and type the followingcommandatthe RHEL/CentOSconsole # ddif=/dev/cdromof=Wxp_sp2.iso Aftersome time itwill create anisoimage (named“Wxp_sp2.iso”) of the insertedCD/DVDinyourcurrent
  • 33. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar workingdirectory. Note:You can alsocreate a Virtual Machine directlybythe CDROM/DVDwithoutcreatingthe isoimage. Howeverinpractice we usuallymake andkeepiso’sof manyoperatingsystemsforreadyusage andto avoid physical accessto serversooften. Step1: We will getascreenlike belowtochoose the methodof installation.We see clearlythatthe virt-manager supportsbothISO andCDROM installation,italsosupportscomplex procedureslikeNetworkInstallandeven PXE boot. Choose a name of the Virtual Machine of the Virtual Machine.Inourcase we have chosen“Win_Xp”. Step2: Nowbrowse tothe locationwhere we have createdthe ISOfile andpointtoitas shownbelow.
  • 34. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar Step3: Nowwe have to assignthe amountof memoryandCPU whichwill be availabletothe Virtual Machine.Thisis the maximumRAMthat the Virtual Machine will be able touse foritsownpurpose.A typical 512 MB memory and 1 CPU will be okay.Tryto keepenoughamountof memoryforour base operating-system. Step4: We have allocated8GB for WindowsXPMachine.Butas we can see inthe image below itsays“4.6 Gb available inthe defaultlocation”.Inthiscase the image cannotbe keptinthe defaultlocation. So we have twooptioneitherwe decrease the allocatedsize orselectadifferentlocationinourexistingdisk by clickingon“Selectmanagedorotherexistingstorage”.
  • 35. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar Step5: In the laststepwe will be verifyingthe parametersandproceedtofinal installationbyclickingonFinish button. Havingdone all these steps,we have nowsuccessfullycreateda WindowsMachine.Rememberthatthe above stepsare similarforinstallinganyotheroperating-systemslike Ubuntu/Centos/Debian/Fedora/RHEL etc. You will be nowpresentedwiththe traditional WindowsSetup.
  • 36. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar
  • 37. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar Lab-8 Installing Guest OS in KVM using Command Line InstallingGuestOSin KVM usingCommandLine Previouslywe’veinstalledguestOSinKVMusingthe graphical mode,i.e.usingthe virt-manager.Inmanyof the cases probablywe’llnotalwaysbe havingthe graphical mode.Insuchsituationwe have toinstall using the commandline tool. We’ll use thevirt-installto install guestOSinKVMusingcommandline virt-installsupportsrich setof optionstoinstall andalsoconfigure pre-installationoptionsof anewguestOS. In the previousexample we installedwindowsoperating-systemusingthe graphical virt-managertool.Here we will lookintoinstallingthe same WindowsXPhavingthe same configurationbutnow usingthe command line. # virt-install --name cmdWinxp --ram512 --diskpath=/home/gun/cmdWinxp.img,size=5--os-variantwinxp -- cdrom /home/gun/Wxp_sp2.iso Startinginstall... Creatingstorage file cmdWinxp.img|5.0 GB 00:00 Creatingdomain...|0 B 00:00 Domaininstallationstill inprogress.Waitingforinstallationtocomplete. The above commandwill install aVirtual instance of the WindowsXPoperatingsystemwithname cmdWinxp having512 MB available RAM.Withthe –diskoptionyoucan specifythe destinationpathof the OSImage file and the size to allocate it.Since we are installingWindowsXPwe specifiedthe –os-variantwinxp.Andfinally the source of the installationISO/CDROM.Inourcase itis an isoimage of WindowsXPlocatedat /home/gun. For gettingvirt-installinformationwe canconsultthe manpage as follows. # manvirt-install There isone interestingoptiontoconsiderandthatis to install anyGuestoperatingsystem, inaninteractive mannerwiththe –promptoptiontothe virt-install command.To illustrate this,We willinstallUbuntu11.10 GuestOS inKVMusingthe interactive feature of the virt-installcommand. # virt-install --prompt What isthe name of your virtual machine? ubuntu How muchRAM shouldbe allocated(inmegabytes)? 512 What wouldyoulike touse as the disk(file path)?/home/gun/ubuntu.img How large wouldyoulike the disk(/home/gun/ubuntu.img) tobe (ingigabytes)? 6 What isthe install CD-ROM/ISOorURL? /home/gun/ubuntu-11.10-desktop-i386.iso Startinginstall... Creatingstorage file ubuntu.img|6.0 GB 00:00 Creatingdomain...|0 B 00:00 So withthe helpof “virt-install–prompt”oncommandline we caninstall interactivelyanyguestoperating systemeasily.
  • 38. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar Starting/ StoppingGuestOperatingSystemsWithvirshCommand:The virshcommandcan be usedtomange local or remote guestoperatingsystems.Thiscommandcanbe usedto create,pause,andshutdowndomains. It can alsobe usedtolistcurrent domains. To listRunningVMS Type the followingcommand: # virshlist Sample outputs: Id Name State ---------------------------------- 1 cmdWinxprunning 2 ubunturunning 3 Winxprunning ShutDown A Guest # virshlist # virshshutdowndominName # virshshutdowncmdWinxp # virshshutdown1 RebootingA Guest # virshlist # virshrebootdomaiName # virshreboot2 # virshrebootubuntu ForcefullyStopA Guest Force a guestto stopwiththe virshcommandif it iscrashedor notresponding # virshlist # virshdestroydomainName # virshdestroyWinxp Get InformationAboutGuest # virshlist # virshdominfodominName # virshdominfo2 # virshdominfoubuntu Sample outputs: Id: 2 Name:ubuntu UUID: ......... OS Type:......... State:running CPU(s):1 CPU time:24.3s Max memory:524288 kB Usedmemory:524288 kB Autostart:disable Get InformationAboutNode # virshnodeinfo Sample Outputs:
  • 39. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar CPU model:x86_64 CPU(s):4 CPU frequency:2394 MHz CPU socket(s):1 Core(s) persocket:4 Thread(s) percore:1 NUMA cell(s):1 Memorysize:8181332 kB
  • 40. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar Lab-9 Installation of VMware ESX Server Installationof VMware ESX Server Assumingthatwe didnotreceive ESX3i embeddedinourserver. To downloadESXServer3i,we needthe installable 200MB ESX Server3i ISOimage(approx.).Togetthe same fromvmware website we needtofilloutall the necessaryinformationandwillbe inapositiontodownload the isoimage . Once we have vmware ESX 3i isoimage,we can install itonany serverthatissupportedinthe VMware ESX Server3i hardware compatible list. 1. Burn the VMware ESX server3i isoimage file ontoabootable CD. 2. Poweronthe serverafterinsertingthe burntCD intoCDDrive.(Make sure fromBIOSsetupthat the firstbootoptionisset onto CDDrive) 3. We will getthe followingscreen:
  • 41. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar We got “blackloading”screen,itswitchedto“yellowloading”screenafter some time whichisdepictedas below: At lastwe got the “Welcome toVMware ESXServer3i 3.5.0
  • 42. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar PressentertoInstall andfurtherpressF11 to accept the license agreement. Next,confirmthe installationbypressingF11aftergettingthe followingscreen. The installationwill take few minuteshardly1or 2 minutes.Thanpressenterkeyforrebootingthe system. Afterrebootingwe willgetthe followingscreen:
  • 43. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar Nowwe have to pressF2 and access the slimmanagementinterface.There,we cansetthe root passwordand configure astatic IP(andother networksettings) onthe server. InstallingGuestOperatingSysteminVMware ESXServer 1. Openthe VMware Infrastructure Client(VIClient).Right-clickonESXServerandselectNewVirtual Machine or pressCtrl+N. 2. Opt to create a Typical virtual machine inordertoreduce the numberof queriesthatare neededto be answeredlaterandclicknextto continue further. 3. Next,name the newVirtual Machine andthanclickNext. 4. Selectthe Datastore thatthe newVirtual Machine will be storedinto.We canuse the local storage on our ESX Server,andclickNext. 5. Choose the operatingsystemthatwe will be installing.Inourcase windowsXPandclickNext. 6. Choose the numberof Virtual Processors.Inourcase,optwiththe defaultof 1, and clickNext. 7. On nextscreenselectthe amountof RAMthat thisnew GuestVM will have.Inourcase,256MB of RAMfor the newWindowsXPVM. clickNext. 8. Choose the numberof virtual NICsandthe virtual networksthatthe vNICswill be attachedto.Opt here defaults.ClickNext. 9. Next,choose amountof diskspace thatwill be allocatedtothe guestvirtual disk.We can allocate the defaultof 8GB. ClickNext. 10. Reviewthe settingsconfiguredforthe new guestVM,If everythingisasexpected,clickFinish. 11. Before startingorbootingthe new virtual machine,we needtoattachthe WindowsXPinstallation media(CDROM) to the newvirtual machine.Todothis,selectthe new guestVM,thenclickEdit
  • 44. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar Virtual Machine Settings(whichfallsunderthe Basictasksandlocatedjustbelow Poweronthe virtual machine.) 12. In virtual machine propertieswindow,clickonthe Virtual CD/DVDDrive.Inourcase,we have the WindowsXPinstallationmediainanISO file formatandstoredon the ESX server’slocal datastore. Clickon Datastore ISOfile,andbrowse tothe WindowsXPISOfile.Andfinally,selectConnectat poweron,thenpressOK. 13. Nowthat we are readyto install the operatingsystem, PowerOnthe new Virtual machine andmove to the Console sothat we can go throughthe installationprocess. 14. Because the installationmediawasconnectedatpoweron,the WindowsCDshouldboot automatically,inspectsthe hardware andstartsto loadfilesforWindowsSetup.We needtopress here F6 functionkey,whenwe see the message “pressF6toloada SCSIdriver”,thisisbecause ESX will use aBuslogicSCSIdriverbydefaultandwe needtodirectthe installertothe Buslogicdriver. 15. On the nextblue screen,atbottomside,we getmessage S=SpecifyAdditional Device,herepress“S” to specifyaSCSIdriver. 16. Proceedingfurtherwe needtodownloadthe VMware SCSIDriversandhave thisfile availableonour system. 17. Now,clickon to ConnectFloppybuttononVIClientToolbarandselectthe VMware SCSIDriversFLP file thatwe have downloaded.Furtheronthe WindowsXPscreento"INSERTFLOPPYAND PRESS ENTER" we needto PressEnter. 18. Hereafterwe shouldsee normal WindowXPSetup/Install screen.PressEntertobeingthe setup. Now,followthe typical WindowsXPinstallationprocedure. 19. Once the file copygetscompleted,WindowsXPwill restart.Andatthatpoint,make sure we disconnectthe virtual floppydisk.AfterthatWindowsXPrestarts,andwe will be answeringthe typical WindowsXPsetupquestionsandournew WindowsXPVMware ESXServerGuestwill be ready for use.
  • 45. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar A. Appendix Guest A guest operating system that runs within a domain in Oracle VM Server. A guest may be paravirtualized or hardware virtualized. Multiple guests can run on the same Oracle VM Server. Hardware virtualized machine A virtual machine with an unmodified guest operating system. It is not recompiled for the virtual environment. There may be substantial performance penalties running as a hardware virtualized guest. Enables Microsoft Windows™ operating system to be run, as well as legacy operating systems. Hardware virtualization is only available on Intel VT or AMD SVM CPUs. Host computer The physical computer on which Oracle VM Server is installed. Hypervisor The hypervisor, monitor, or Virtual Machine Manager (VMM). It is the only fully privileged entity in the system. It controls only the most basic resources of the system, including CPU and memory usage, privilege checks, and hardware interrupts. Master Oracle VM Server A component of Oracle VM Agent. An application that acts as the contact point to Oracle VM Manager, and to other Oracle VM Agents. Provides virtual machine host load-balancing, and local persistence for Oracle VM Server. There is only one master Oracle VM Server in a server pool. A physical server can perform as the master Oracle VM Server, Utility Server and Virtual Machine Server simultaneously. Oracle VM Agent An application installed with Oracle VM Server. It communicates with Oracle VM Manager for management of virtual machines. Oracle VM Manager manages the virtual machines running on Oracle VM Server by communicating with Oracle VM Agent. It contains three components: master Oracle VM Server, Utility Server, and Virtual Machine Server. Oracle VM Server A self-contained virtualization environment designed to provide a lightweight, secure, server-based platform for running virtual machines. Oracle VM Server is based upon an updated version of the Xen hypervisor technology. Includes Oracle VM Agent to enable communication with Oracle VM Manager. Oracle VM Manager Provides the user interface, which is an Application Development Framework (ADF) web application, to manage Oracle VM Server pools. Manages virtual machine life cycle, including creating virtual machines from templates or from installation media, deleting, powering off, uploading, deployment and live migration of virtual machines. Manages resources including ISO files, templates and shared virtual disks.
  • 46. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar QEMU Also referred to as qemu-dm, which is the process name. The virtualization process which allows full virtualization of a PC system within another PC system. Server Pool Logically an autonomous region that contains one or more physical Oracle VM Servers. Presents a unified view of the storage where the virtual machines reside, and groups the users of these virtual machines into a single community called a group, in which each user is a server pool member. Sparse Copy A clone of the type "sparse copy" is a disk image file of a physical disk, taking up only the amount of space actually in use; not the full specified disk size. Thin Clone A thin clone is a clone of a physical disk that takes up only the amount of disk space actually in use; not the full specified disk size. Utility Server A component of Oracle VM Agent. An application that handles I/O intensive operations for virtual machines, server pools and servers, for example, copying, moving and renaming files. There can be more than one Utility Server in a server pool. A physical server can perform as the master Oracle VM Server, Utility Server and Virtual Machine Server simultaneously. V vif A virtual network interface for bridging network interfaces between domUs and dom0. When a domU is started it is assigned a number. This number is used to bridge the network interface from ethn to vifn.0. Virtual disk A file or set of files, usually on the host file system although it may also be a remote file system, that appears as a physical disk drive to the guest operating system. Virtual Machine A guest operating system and the associated application software that runs within Oracle VM Server. May be paravirtualized or hardware virtualized machines. Multiple virtual machines can run on the same Oracle VM Server. Virtual Machine Manager (VMM) See Hypervisor. Virtual Machine Server
  • 47. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar A component of Oracle VM Agent. An application which runs Oracle VM Server virtual machines. It can start and stop virtual machines, and collect performance data for the host and guest operating systems. Enables communication between the master Oracle VM Server, Utility Server and Virtual Machine Servers. There can be more than one Virtual Machine Server in a server pool. A physical server can perform as the master Oracle VM Server, Utility Server and Virtual Machine Server simultaneously. Virtual Machine Template A template of a virtual machine. Contains basic configuration information such as the number of CPUs, memory size, hard disk size, and network interface card (NIC). Create virtual machines based on a virtual machine template using Oracle VM Manager. ----------------------------------*****-----------------------------------
  • 48. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar Mode of Evaluation: Quiz/Program Execution/Written Examination Mid Term Internal Evaluation { Internal – 50 Marks } Continuous Assessment [30 Marks] Lab Experiment and Demonstration [10 Marks] Viva Voce [10 Marks] Lab Experiment and Demonstration marks details Status Completed and Executed accurately Completed but partially Executed Partially written with errors/no execution Logically incorrect program Unacceptable effort Marks 9 - 10 7 - 8 5 - 6 3 - 4 1 - 2 Viva – Voce marks details Status Excellent All answers are satisfactory Very Good Most of the answers are satisfactory Good Majority of the answers are satisfactory Average Few answers are satisfactory Below Average Rarely any answer is satisfactory Marks 9 - 10 7 - 8 5 - 6 3 - 4 1 - 2 Final Term Internal Evaluation { Internal – 50 Marks } Continuous Assessment [30 Marks] Lab Experiment and Demonstration [10 Marks] Viva Voce [10 Marks] Lab Experiment and Demonstration marks details Status Completed and Executed accurately Completed but partially Executed Partially written with errors/no execution Logically incorrect program Unacceptable effort Marks 9 - 10 7 - 8 5 - 6 3 - 4 1 - 2 Viva – Voce marks details
  • 49. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar Status Excellent All answers are satisfactory Very Good Most of the answers are satisfactory Good Majority of the answers are satisfactory Average Few answers are satisfactory Below Average Rarely any answer is satisfactory Marks 9 - 10 7 - 8 5 - 6 3 - 4 1 - 2 Continuous assessment for each experiment  Experiment [5 Marks] File and Viva – Voce [5 Marks] Experiment Marks details Status Completed and Executed perfectly Completed but partially Executing Partially Written and Errors Logically Incorrect Program Unacceptable efforts Marks 5 4 3 2 1 File and Viva-Voce Marks details Status File Checked Timely and Good Viva File partially checked and Good Viva File Checked Timely and Average Viva File Checked Timely and Bad Viva File not Checked Timely and Bad Viva Marks 5 4 3 2 1
  • 50. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar 2. EXPERIMENTALSETUP DETAILS FOR THE COURSE Software Requirements Turbo C 2.0/Turbo C++3.0+, Lex or Flex and YACC tools (Unix/Linux utilities) Hardware Requirements No specific requirements.Any computer Hardwarecapableof running DOS can be Used for this course.
  • 51. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar School of Computing Science & Engineering Course Name- Compiler Design Lab Course Code- CSE-353 S. N. Title of Lab Experiments 1 Write a C program to simulate a DFA. 2 Write a program to minimize the number of states of a DFA 3 Write a program using Lex to count the number of characters, words, spaces and lines in a given input file 4 Write a C program for dividing the given input program into lexemes. and also simulate lexical analyzer for validating operators. 5 Write a C program to recognize strings under 'a', 'a*b+', 'abb'. 6 Study the structural and implementation process of lex and YACC tools and prepare a detail analysis report. 7 Write a YACC program using lex to evaluate an arithmetic expression involving operators +,-,* and /. 8 Write a lex program for separating integers, floating point numbers and reserve words from a file. 9 Write YACC program using lex to recognize a valid variable, which starts with a letter, followed by any number of letters or digits 10 Write a YACC program for desktop calculator. 11 Write a YACC Program to recognize nested IF control statements and display the number of levels of nesting. 12 Write a program to implement 3 address code. 13 Write a program to create and print a symbol table that contains the
  • 52. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar name, type and size of the identifier from a C file. VALUE ADDED EXPERIMENT: 1 Design a compile for programming language C. The compiler is consider only for some specific fragment of language like Declaration, flow control etc. The compiler consists of three steps: Lexical analysis, Parsing and Code Generation. The compiler should be written in C using the lex and yacc Unix utility tools. 2 Design the lexical analysis and syntax analysis phase of a Text encrypter using lex and YACC tools
  • 53. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar 5. GUIDELINES FOR CONTINUOUS ASSESSMENT
  • 54. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar Internal Lab Assessment (End Semester) S. No. Enrol. No. Name of the Student Continuou s assessmen t (30) Lab Experimen t & Demo (10) Viva - Voce (10) Tota l (50) Marks (in words )
  • 55. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar Mid Term Internal Evaluation { Internal – 50 Marks } Continuous Assessment [30 Marks] Lab Experiment and Demonstration [10 Marks] Viva Voce [10 Marks] Lab Experiment and Demonstration marks details Status Completed and Executed accurately Completed but partially Executed Partially written with errors/no execution Logically incorrect program Unacceptable effort Marks 9 - 10 7 - 8 5 - 6 3 - 4 1 - 2 Viva – Voce marks details Status Excellent All answers are satisfactory Very Good Most of the answers are satisfactory Good Majority of the answers are satisfactory Average Few answers are satisfactory Below Average Rarely any answer is satisfactory Marks 9 - 10 7 - 8 5 - 6 3 - 4 1 - 2
  • 56. Version 1.1 Date:13/12/2016 Prepared By: Mr. Gautamkumar Final Term Internal Evaluation { Internal – 50 Marks } Continuous Assessment [30 Marks] Lab Experiment and Demonstration [10 Marks] Viva Voce [10 Marks] Lab Experiment and Demonstration marks details Status Completed and Executed accurately Completed but partially Executed Partially written with errors/no execution Logically incorrect program Unacceptable effort Marks 9 - 10 7 - 8 5 - 6 3 - 4 1 - 2 Viva – Voce marks details Status Excellent All answers are satisfactory Very Good Most of the answers are satisfactory Good Majority of the answers are satisfactory Average Few answers are satisfactory Below Average Rarely any answer is satisfactory Marks 9 - 10 7 - 8 5 - 6 3 - 4 1 - 2 Continuous assessment for each experiment  Experiment [5 Marks] File and Viva – Voce [5 Marks] Experiment Marks details Status Completed and Executed perfectly Completed but partially Executing Partially Written and Errors Logically Incorrect Program Unacceptable efforts Marks 5 4 3 2 1 File and Viva-Voce Marks details Status File Checked Timely and Good Viva File partially checked and Good Viva File Checked Timely and Average Viva File Checked Timely and Bad Viva File not Checked Timely and Bad Viva Marks 5 4 3 2 1