Lab Manual 1
Lab Manual 1
M Haris Khan
BSIT(E)-19-53
1|Page
Table of Contents
Chapter 1 Page 4
Understanding Virtualization Page 4
Why Virtualization Page 4
Limitations of VMware Page 4
Installation of VMware Workstation Page 4
Installation Steps Page 5
Virtual Machine Creation Page 8
Chapter 2 Page 15
Windows installation on VM Page 15
Windows hardware config. Page 15
Installation of Windows Page 17
Chapter 3 Page 20
Linux Installation on VM Page 20
Linux hardware config. Page 20
Installation of Ubuntu Page 21
2|Page
List of Tables
3|Page
List of Figures
Chapter 1 Page 5
Figure 1.1 Page 5
Figure 1.2 Page 6
Figure 1.3 Page 6
Figure 1.4 Page 7
Figure 1.5 Page 7
Figure 1.6 Page 8
Figure 1.7 Page 9
Figure 1.8 Page 10
Figure 1.9 Page 11
Figure 1.10 Page 12
Figure 1.11 Page 13
Figure 1.12 Page 13
Figure 1.13 Page 14
Chapter 2 Page 15
Figure 2.1 Page 15
Figure 2.2 Page 16
Figure 2.3 Page 17
Figure 2.4 Page 18
Figure 2.5 Page 18
Figure 2.6 Page 19
Figure 2.7 Page 19
Chapter 3 Page 20
Figure 3.1 Page 20
Figure 3.2 Page 21
4|Page
Chapter 1
Understanding Virtualization
In computing, virtualization is the act of creating a virtual version of something at the same
abstraction level, including virtual computer hardware platforms, storage devices, and computer
network resources. Different virtual machines are created for different purposes and all the
workload of hardware is moved from physical to virtual.
Why Virtualization?
Less Costly
Much higher Scalability
Has a last longing life cycle
Centralized Security
Portable Options – Migration, Cloning
Good performance
Availability & Recovery – Replication, Disaster Management
Space Efficient
Limitations
Compromised efficiency
Expertise required
Requires Licensing of VMs
Recurring Maintenance
First download the VMware workstation Pro latest version (mine is 16) and start the
installation wizard.
Fig 1.1
Fig 1.2
After accepting the terms click next and on the next screen you can choose the path
where you want to install software and add an additional feature of enhanced keyboard
which will install on host machine (depends upon your need).
8|Page
Fig 1.3
On next screen you can click the checkboxes including information about the software
update every time VMware software starts and the other is customer experience
improvement program.
Fig 1.4
After that two checkboxes come again asking whether if you want software’s shortcut on
desktop and start menu program folder or not.
Fig 1.5
9|Page
After that installation starts and at the end of installation, there will be two options that
whether you want to finish the installation or enter the license which is in the form of
key.
After entering the key, the wizard ends and the system will ask for immediate restart or
manual restart (It’s your own choice).
After the installation open the VMware Workstation Pro. Following image shows the first
view after opening the VMware.
Fig 1.6
In this image we have different functions including creating, opening a virtual machine
and connecting to a remote server.
Also, different options regarding VMware can be seen in the figure 1.6.
For creating a new virtual machine click on the create a new virtual machine button and
a wizard will appear for the VM creation.
10 | P a g e
Fig 1.7
In this wizard we will select the typical option as we are doing a simple VM and also it is
recommended by the software.
Click next and there will be different options about selecting Guest OS. The options are
included in the picture below.
11 | P a g e
Fig 1.8
From these options we will select the third one option and click next. By doing this VM
will be created but without an OS.
Next there will be different guest OS options like Windows, Linux, VMware ESX and
other OS including the list of the versions of selected Guest Operating System.
12 | P a g e
Fig 1.9
After selecting the OS and its version click next and choose the location and name of the
VM which is being created.
Click next and there will be options about the storage and storing of virtual disk. The
recommended storage which can be given to Windows is 40 GB and the virtual disk can
be stored as a single file or split int multiple files (for moving these files easily to another
computer)
13 | P a g e
Fig 1.10
Click next and there will be a list of configurations according to which you are creating
VM. A customize hardware button is also there though which you can change the
configuration of the VM.
On clicking the customize hardware button the following screen appears and we can
change the memory, processor and other things.
14 | P a g e
Fig 1.11
In fig 1.11 we can see the memory is 512 MB ram for Guest OS this is the
default/recommended memory which can be changed to 13.3 GB (which is max
recommend memory and cannot be exceeded) and minimum recommended memory is
128 MB.
For selection of OS, click on CD/DVD option and a popup will appear where you can
select the path of the OS image which you want to install.
Fig 1.12
After customizing all the hardware (According to your VM need) close the popup and
finish the wizard.
The VM has been created and shown in the following figure.
Fig 1.13
Chapter 2
Installing Windows on a Virtual Machine
Before the installation of Windows, we will configure the hardware according to our need
and hardware configuration.
Hardware Configuration
Fig 2.1
17 | P a g e
Select the image file (ISO) and select the windows OS.
After that select the ram and core required according to the need.
Also see the additional hardware required or to be removed.
Fig 2.2
Additional hardware can be added or removed and default hardware included can be seen
in fig 2.2.
18 | P a g e
Installation of Windows
The following image will appear after starting the VM. Image can be different according
to the OS in my case I am using Windows XP.
Fig 2.3
After that screen changes and tells you about the total space (which is 40 Gb) and starts
formatting the disk for the installation of windows files.
19 | P a g e
Fig 2.4
After the installation the OS will ask some settings like region, country, date, name and
lastly product key of OS.
Fig 2.5
20 | P a g e
Since we are doing the installation for the first time, we will choose typical settings of the
OS.
Fig 2.6
After the complete installation the desktop of the VM will look like the following pic.
Fig 2.7
21 | P a g e
Optimizing Windows
When window is installed other software and drivers are also installed along it which are
sometimes not required by VM. These software and drivers keep on taking resources in
background taking the resources from guest OS. For increasing the efficiency and
performance of VM these drivers are kept disabled.
Fig 2.8
Fig 2.9
As we can see in the above pic that in device manager, we have different hardware devices
which can be disabled by clicking them.
Although we can disable any driver which is unnecessary but here, I will disable “sound driver”
and “DVD/CD-ROM drivers”
For Disabling DVD/CD-ROM Driver – First click on the “+” icon on the CD-ROM/DVD
drives and then Right Click on the option under the CD-ROM/DVD drives and click on the
disable option (you can also delete it).
Fig 2.10
From the above pic we can disable or delete the driver and after disabling the driver a “red
cross’ will appear on the driver which shows that the driver now is not available for use.
23 | P a g e
For verification you can open “my computer” and check for CD-ROM/DVD drive which will
be removed after driver disabling.
For Disabling Sound Driver – Click on the sound driver same as done with DVD driver and
a dropdown menu will appear including different drivers regarding sound and voice.
Select a device and Right click on it for disabling its driver as shown in the figure below.
Fig 2.11
Now the excessive drivers taking resources are disabled and hence these resources will be utilized according to
the guest’s need more efficiently.
24 | P a g e
Chapter 3
After creating the VM now we will install the Linux on VM. In my case I will be installing
Ubuntu (A distribution of Linux) used by programmers for code testing and other tasks.
Hardware Configuration
Fig 3.1
In the fig 3.1 we can see that the minimum storage required by Ubuntu is 20 GB while
windows demanded 40 GB it is because Windows is a GUI based OS and Ubuntu is a
CLI based OS.
In the next step we will allot the recommended memory (4 GB) and do the same setting
as we have done in Windows OS setting. Optimization or other hardware settings will be
done in coming chapters.
25 | P a g e
Installation of Ubuntu
Fig 3.2
After the disk checking the language and region setting screen will appear where we will
setup language and after that the wizard asks about the type of installation (Normal or
Minimal) and here we will select the recommended installation (Normal)
26 | P a g e
Fig 3.3
In fig 3.3 we have other options too regarding the update and different hardware related
drivers’ software which we will download according to our need.
After that we will make partitions according to the need and format the storage so that
Ubuntu can be installed on it (Here I am making only one partition but different partitions
can be made) .
Fig 3.4
27 | P a g e
Next, we will enter the credentials for login in and these are mandatory and we can’t past
them credentials.
Fig 3.5
After all the basic OS setting the installation starts
Fig 3.6
After the installation the VM will restart and looks like the following pic.
28 | P a g e
Fig 3.7
Hence Ubuntu is ready for use but it still needs some optimization which will be done
manually.
29 | P a g e
Optimizing Linux/Ubuntu
When Linux is installed many other drivers/processes are also installed and start running
along the OS. These services and processes are also called Daemon. These Daemon
consume resources and slow down the efficiency of guest OS. Also, if we don’t need
these services or processes they still keep on running until they are not turned off
manually.
Fig 3.8
In all the above service, most of the service are not required or unnecessary so we will stop those
services.
Here I will take the example of apache2 (Which is a service used for web hosting) check its status and
disable it.
30 | P a g e
First, I will check the status of apache2 service by typing “service apache2 status” and we can see the
result in the following image:
Fig 3.9
In the upper image we can see that apache2 service is enabled, running and taking resources. Here
we assume that we don’t need the web server service and now we will disable it.
For disabling apache2 service, we will use “service apache2 stop” command and we can see in the
following figure that the apache2 service is disabled.
After that we will see the status of the service stopped earlier.
Fig 3.10
In the upper figure we can see that the service is stopped and we can also disable other services by using
same command for other services as well.
31 | P a g e
Chapter 4
For adding the additional hardware first turn off the VM if it is running and click on the “Edit virtual
machine settings”.
After clicking that a popup menu will appear having hardware addition or removal options.
Fig 4.1
For adding Hard Disk select Hard Disk from left panel and click “Add” button.
After clicking add button a wizard of add hardware will appear.
Click next and here we will have 4 different types of Virtual Disk (IDE, SCSI, SATA, NVMe).
Since I am using windows XP it doesn’t have NVMe option and I will select the recommended setting
(IDE).
32 | P a g e
Fig 4.2
Click next and here you will see different options regarding the creation of Disk that whether you
want to “Create a New Disk”, “Use an existing Virtual Disk” or “Use a physical disk”.
Fig 4.3
33 | P a g e
Since I am creating a new Disk so I will click on “Create a new Virtual Disk” option and click next.
Here we will select the Disk capacity and storing of virtual disk and also, we can see that
recommended Disk size is 40GB so I am allocating 40GB and storing Virtual Disk as a single file.
Fig 4.4
Next, we will specify by the disk file path, finish the wizard and we can see in the left pane that a new
hard disk will be created with the name of “New Hard Disk”.
Fig 4.5
Now start the windows VM and we can see that the hard disk created will not be shown because it will
be unallocated until we will not allocate it manually.
Follow the arrangement for Disk allocation. Control panel < Performance < Performance and
Maintenance < Administrative Tools < Computer Management < Storage < Disk Management.
34 | P a g e
After clicking Disk management, “Initialize and Convert Disk Wizard” will appear. Click next.
Here we will initialize the unallocated disk.
In the following pic you can see that a Disk is created which has to be allocated.
Fig 4.6
Double click on the Disk1 and a new volume wizard will appear.
Click next and here you can select the size of the new volume being created.
Fig 4.7
On clicking next you can assign the drive name like G, H, I etc.
Click next and here will be the options regarding formatting and compression of the new volume being
created.
Click next and finish the wizard. After the wizard is finished the newly created volume will be created
and in “My Computer” you can see the second drive in “Hard Disk Drive” Panel.
35 | P a g e
For adding the additional hardware first turn off the VM if it is running and click on the “Edit virtual
machine settings”.
After clicking that a popup menu will appear having hardware addition or removal options.
Fig 4.8
For adding Hard Disk select Hard Disk from left panel and click “Add” button.
After clicking add button a wizard of add hardware will appear.
Click next and here we will have 4 different types of Virtual Disk (IDE, SCSI, SATA, NVMe).
36 | P a g e
Fig 4.9
Click next and here you will see different options regarding the creation of Disk that whether you
want to “Create a New Disk”, “Use an existing Virtual Disk” or “Use a physical disk”.
Fig 4.10
37 | P a g e
Since I am creating a new Disk so I will click on “Create a new Virtual Disk” option and click next.
Here we will select the Disk capacity and storing of virtual disk and also, we can see that
recommended Disk size is 20GB so I am allocating 20GB and storing Virtual Disk as a single file.\
Fig 4.11
Next, we will specify by the disk file path, finish the wizard and we can see in the left pane that a
new hard disk will be created with the name of “New Hard Disk”.
Fig 4.12
Now start the Ubuntu VM and we can see that the hard disk created will not be shown because it will be
unallocated until we will not allocate it manually.
After starting the VM we can see in the fig 4.13 that the drive available only is the “Computer Drive”
while the newly created Virtual Disk is not available.
38 | P a g e
Fig 4.13
Enter in the computer disk by double clicking and then right click to open the properties. After clicking
properties, you can see the details about the “Computer Disk” and under it there will be a button naming
“Open in Disks”, press the button as shown in the fig 4.14.
Fig 4.14
Press the “Open in Disks” button and on the next pop-up menu you can see that there will be two drives
among them there will be an unknown disk (This is our unallocated disk).
Fig 4.15
39 | P a g e
Press on the “screws” (which is the icon of setting) just above the detail of the disk and click on the
“Format Partition” button. On click a format volume menu will be shown where we will name the
volume and there are more different settings related to the volume are.
Fig 4.16
After entering the volume name click next and on the next screen the more confirmation will be
demanded as the unallocated disk will be formatted. Click on the format button and it will ask for the
admin password for further advancement.
Fig 4.17
Here you can see that the volume has been created. This is how a virtual disk is created in Ubuntu.
40 | P a g e
Chapter 5
Fig 5.1
NAT is used by guest to connect with host. Also, through this configuration guest can connect to internet but it
uses host address in this scenario. In NAT a guest can’t connect to another guest. NAT is for internal
communication only.
For checking the connection between host and guest (Windows) we will first check the IP of both host
and guest and then we will ping them. Keep it in mind that ping can be done from both sides i.e. Host &
Guest.
Fig 5.2
41 | P a g e
In the fig 5.2 I have pinged the Host from guest but it can also be done from Host.
Now we will connect to Internet to check the connectivity.
Fig 5.3
Here you can see that I’ve searched the web for VMware and the results are showing that the guest is
connected to Internet.
Bridged
As the name says through this configuration one guest can connect to another guest internally. Also, through
this a guest can have the direct access to internet through his own IP. Bridged connection is both used for
internal and external connection.
Checking Connectivity:
First change the network adapter settings of both the VMs to bridged so that they can connect easily.
The adapter settings can be changed when the machines are powered off.
Turn on both the VMs and check their Ips.
After checking the IPs of both the VMs ping each other and also do ping one of them with host for
checking whether the VM is connected to host or not.
42 | P a g e
Fig 5.3
In fig 5.3 I pinged the windows XP VM with Ubuntu VM and you can see the result that the both VMs
are connecting internally.
Now we will try to connect a VM to internet and see if we can do so or not.
Fig 5.4
In the fig 5.4 I searched for the VMware website and the result shown shows that we the Ubuntu VM
has internet access.
43 | P a g e
Chapter 6
In the first step of cloning the Windows first we create a new folder naming “VM Copy” along with the
other VMs.
After that we copy the VM configuration files (. vmdk, vms) and copy them in VM copy folder created
earlier.
Fig 6.1
Next, we change the name of the VM copied in the VM copy folder by editing the .vmx configuration
file and change the name. Also, we will rename both the configuration files
Fig 6.2
Now click on VM Copy.vmx and we will to redirected to VMware Workstation where we will see that a
new VM naming “VM Copy” will be created.
Fig 6.3
44 | P a g e
Now we will run this VM and a pop up will appear and you will select the “I Copied” option.
Fig 6.4
Now that the cloned VM has been created you can explore the VM and see that whether all the settings
are same or not.
Fig 6.5
On clicking next there will be two cloning options: Linked One and Full Done. Select the clone type
according to your need (I am choosing Full Done Type here) and click next.
Fig 6.6
45 | P a g e
On clicking next, wizard will ask for the name and the location of cloned Ubuntu VM. Fulfil the
requirements and click finish.
Fig 6.7
After the competition of cloning process an icon will be created naming “Ubuntu Clone”. Start this
VM to see if it’s working fine or not.
Fig 6.8
After running the VM, for checking that cloning was successful I check the disks and both of them
were available for use.
Hence the cloning of both the VM is carried out successfully.