Virtualization Lab Exercises
Virtualization Lab Exercises
Ex No: 1 Date:
AIM:
To install Virtual box /VMware Workstation with different flavours of Linux OS.
DEFINITION:
PROCEDURE:
1. Download and Install VirtualBox. Using the link-
https://www.virtualbox.org/wiki/Downloads
2.Download and Install Ubuntu. Using the link-
https://ubuntu.com/download/desktop/thank-you?version=20.04.1&architecture=amd64
.
2. Provide the name and operating system information for virtual machine.
3.Select the path for the virtual hard disk and Click on “create”button.
4. Select the virtual machine from the Virtual box manager and click on
“settings “ button.
5. Select “System” and navigate to “processor” tab to adjust number of processor
virtual machine for better performance.
Enable “Shared Folder” between host OS (i.e. Windows OS) and guest OS
(i.e.Ubuntu).
NOTE: Before continuing, shutdown the virtual machine.
1. Create a folder on host OS (i.e. on Windows) with any name “Share” on any
drive having sufficient available space.
2. Select the virtual machine in “Oracle VM VirtualBox Manager” and click on
“settings”.
3. Select “Shared Folders” and click on “+” to add a shared folder to virtual
machine.
4. Enter the “Folder path, Folder Name” and select “Auto-mount” and click
on”OK” button.
RESULT:
AIM:
To Shrink and extend virtual disk in Windows OS.
PROCEDURE:
Step 1: Open Disk Management by typing DiskMangement in Start menu search box and
hitting enter or Click the Start Button and Go to MyComputer and then Right click MyComputer
> Click Manage.
Step 2: Now right-click on the volume that you want to shrink and select Shrink
Volume option.
Step 1: Again, open disk management by typing either disk management or diskmgmt.msc in
start menu search box and hitting enter.
Step 2: Right-click on the volume that you want to extend and select Extend Volume option to
open extend volume wizard. Click next to continue.
Step 3: Enter the amount of disk space that you want to add the current partition from available
free space.
RESULT:
Thus, the disk management was successfully partioned and the output was
verified.
2b. Create, Manage, Configure and schedule snapshots
AIM:
DEFINITION:
PROCEDURE:
Step: 2 Select the virtual machine for snapshot and then click on ‘Snapshots‘ option. In
this case we are going to create a snapshot of CentOS 7 VM.
Step: 3 Specify the Snapshot Name and Description and then Click on ‘OK‘
Note : When we try to take snapshot of running VM then Virtualbox manager will put
that VM in Paused state , so once the snapshot task is completed then we can move the
VM’s state from Paused to Running.
Restore VirtualBox VM from Snapshot
Step:1 Power off the Virtual Machine.
Step:2 Select the VM and Go to ‘Snapshots‘ option and then click on “Restore
Snapshot option”
When we click on “Restore Snapshot” option , it will give us an option to create
snapshot of current state of the VM and if we don’t want the current state snapshot then
untick the option ( Current state will be deleted permanently ).
Thus, the scheduled snapshots was created, managed and configured successfully
and the output was verified.
2c. Create Spanned, Mirrored and Striped volume
AIM:
To create spanned, mirrored and striped volume in Windows OS.
DEFINITION:
A spanned volume combines areas of unallocated space from multiple disks into one
logical volume, allowing you to more efficiently use all of the space and all the drive
letters on a multiple-disk system. A striped volume is created by combining areas of free
space on two or more disks into one logical volume.
A striped volume (RAID 0) combines areas of free space from multiple hard disks
(anywhere from 2 to 32) into one logical volume. Data that is written to a striped volume
is interleaved to all disks at the same time instead of sequentially.
PROCEDURE:
Step 1: Open disk management by typing either disk management or diskmgmt.msc in start
menu search box and hitting enter.
Select the disk to be converted and click on OK. In the resulting dialog a list of drives
scheduled for conversion is displayed. To view the volumes on a drive, select the drive in
the list and click on details:
Click on Convert to initiate the conversion process. Once completed, the drive will
appear as a dynamic drive in the Disk Management interface.
To enable this we need to select disk 2 from the left hand list of available disks and
click on Add> to add it to the selected disks. Having done so the amount of space
from each drive may be selected up to the maximum combined space from both
disks.
Select one or more disks from the list of dynamic disks that are available and have
unallocated space. Click Add to add the disk or disks to the Selected list box. Next,
select each of the disks in turn, then specify the amount of space you want to use
on the selected disk. Click Next when you are ready to continue.
Use the Assign Drive Letter Or Path page to assign a drive letter or path. You can also choose
Do Not Assign A Drive Letter Or Drive Path if you want to create the partition without assigning
a drive letter or path. Click Next.
Use the Format Volume page, as shown in Figure 19-14, to set the formatting options. Simple
and spanned volumes can be formatted by using FAT, FAT32, or NTFS. Use NTFS because only
volumes using NTFS can be expanded.
Click Next. The final page shows you the options you've selected. If the options
are correct, click Finish. The wizard then creates the volume and configures it.
1. Right-click one of the empty drives, and select New Mirrored Volume.
2. Click Next.
3. Select the available drive from the left.
4. Click Add.
5. Specify the amount of space for the mirrored volume. Important: The volume cannot be larger
than the amount of the available space in the smaller hard drive, as you can't mirror data to space
you don't have.
6. Click Next.
7. Assign a drive letter or leave the default settings and click Next.
8. Select Format this volume with the following settings option making sure file system is set to
NTFS, allocation unit size is set to default, and you enter a name for the volume.
9. Check the Perform a quick format option.
10. Click Next.
11.Click Finish.
Click Yes to convert the basic disks to dynamic disks, which is a requirement to create a
mirrored volume on Windows. Once the process completes, you'll only see one volume created,
and as you store content on the new volume, the data will also automatically get replicated into
the secondary drive.
2. Right-click a segment of free-space that you want to include in the striped volume and right
click on “New Striped Volume”.
4. On the Select Disks page, select from the available disks and then click Add to add the disks
to the striped volume.
5. Set the amount of space to use on the disks for the striped volume and click Next.
6. On the Assign Drive Letter Or Path page, the default is to assign the next available drive letter
to the new volume. You can also mount the volume on an empty NTFS folder on an existing
volume. Click Next.
7. On the Format Volume page of the New Striped Volume Wizard, choose the formatting
options for the new volume. Windows 11/10/8/7/Vista supports only NTFS formatting from the
Disk Management snap-in. Click Next.
8. Click Finish on the summary page to create the volume. If the disks are basic disks, you’ll be
warned that this operation will convert them to dynamic disks. Click Yes to convert the disks and
create the striped volume.
RESULT:
Thus, the spanned volume, mirrored volume and striped volume was created successfully
and the output was verified.
2d.Create RAID 5 volume
DEFINITION:
RAID level 5 is similar to striping, but with parity (equal or equivalent) data distributed across
all components (disk or logical volume). If a component fails, the data on the failed component
can be rebuilt from the distributed data and parity information on the other components.
Then click on the “Next” in the pop-out “New RAID-5 Volume Wizard”.
Then select the disks you want to use for creating RAID-5 volumes, and click on “Next”.
At least 3 disk will be required.
Now, you can assign a drive letter to the RAID 5 volume and format the volume and click on
“Next”.
At last, click on “Finish”.
RESULT:
Thus, the RAID 5 Volume was created successfully and the output was
verified.
Ex No: 3 Date:
AIM:
To install desktop virtualization using VNC.
DEFINITION:
Desktop virtualization is technology that lets users simulate a workstation load to access
a desktop from a connected device. It separates the desktop environment and its
applications from the physical client device used to access it.
PROCEDURE:
Right-click 'My Computer' and then click 'Properties'. Click the 'Remote' tab and then
choose 'Allow remote connections to this computer'. Then click the 'OK' button.
Step 2: Install VNC server software on the host machine where you want to virtualize the
desktop. Examples of popular VNC server software include RealVNC. Follow the
installation instructions specific to the VNC server software you choose.
Step 3: Configure the VNC server software by specifying settings such as display
resolution, authentication methods and other options as needed.
Step 4: Start the VNC server on the host machine, which will make the desktop available
for remote access.
Step 5: Install the VNC client software on the client machine from which you want to
access the virtualized desktop. Examples of client software include RealVNC Viewer.
Follow the installation instructions specific to the VNC client software you choose.
Step 7: Enter the hostname or IP address of the host machine where the VNC server is running
along with the port number and authentication credentials if required.
Step 8: Connect to the VNC server from the client machine which will establish a remote
desktop session with the virtualized desktop on the host machine.
Step 9: Use the VNC client software to interact with the virtualized desktop, just like you would
with a physical desktop.
RESULT:
Thus the output of setting up desktop virtualization using VNC will be a remote
desktop session with the virtualized desktop on the host machine, accessible from the
client machine. The result is that you can remotely access and control the desktop on the
host machine from a different location providing a virtualized desktop experience.
Ex No: 3 Date:
AIM:
To set up desktop virtualization using Chrome Remote Desktop
Desktop,, a free remote
desktop solution provided by Google.
DEFINITION:
Chrome Remote Desktop is a remote desktop software tool, developed by Google, that
allows a user to remotely control another computer's desktop through a proprietary
protocol also developed by Google, internally ca
called Chromoting.
The easy way to remotely connect with your home or work computer, or share your
screen with others. Securely access your computer whenever you're away, using your
phone, tablet, or another computer.
PROCEDURE:
You can set up remote access to your Mac, Windows, or Linux computer.
We may have to enter your computer password to give Chrome Remote Desktop access.
You may also be prompted to change security settings in Preferences.
We can give others remote access to your computer. They’ll have full access to your
apps, files, emails, documents, and history.
The access code will only work one time. If you are sharing your computer, you will be
asked to confirm that you want to continue to share your computer every 30 minutes.
1. If someone has shared their remote access code with you, you can remotely offer
support.
2. On your computer, open Chrome.
3. In the address bar at the top, enter remotedesktop.google.com/support,
remotedesktop.google.com/support and press
Enter.
4. Enter the code under “Gi
“Give support” and click Connect.
1. On each computer where you want to remove Chrome Remote Desktop access,
remove the app:
1. Go to Control Panel Programs Add/Remove Programs.
Programs
2. Find the "Chrome Remote Desktop" application.
3. Click Remove.
Result:
Thus the output of setting up desktop virtualization using Chrome Remote Desktop will
be a remote desktop session with the virtualized desktop on the host machine, accessible
from the client machine using the Chrome Remote Desktop application. The result is that
you can remotely access and control the desktop on the host machine from the client
machine using the Google Chrome web browser, providing a virtualized desktop
experience.
Ex No: 4 Date:
AIM:
To install type 2 virtualization on ESXI 6.5 server.
DEFINITION:
VMware ESXi, also called VMware ESXi Server, is a bare-metal hypervisor
developed by VMware for vSphere. ESXi is one of the primary components in the
VMware infrastructure software suite.
ESXi is a Type 1 hypervisor, meaning it runs directly on system hardware without the
need for an OS. Type 1 hypervisors are also referred to as bare-metal hypervisors because
they run directly on hardware. Hypervisors help run multiple VMs efficiently on a
physical server.
PROCEDURE:
Step 3: Click on New Virtual Machine. It will open New Virtual Machine Wizard.
Step 4: From Select a Create Type, Choose "Create a new virtual machine" and Click
on Next.
Step 5: Enter a unique name for the Virtual Machine and Select either Datacenter or
Specific Folder you want to deploy this VM. The name can contain up to 80
characters. Click on Next.
Step 6: Select Cluster and ESXi host where you will deploy this Virtual Machine.
Virtual machine will have access to the resources of the selected object. (i;e Datastore
and Network attached to that Cluster/Hosts).
Step 7: Select Datastore in which you would like to store the Virtual Machine
configuration files and all of the virtual disks. Please note that Virtual disks and
configuration files can also be in different datastores. Click on Next.
Step 8: Select Compatibility for this Virtual Machine. Choose default and Click
on Next.
Step 9: On Select a Guest OS Wizard, Choose the Guest OS type(i;e
Windows/Linux/Other, 32/64 Bit) and Guest Name. Please note that selecting Guest OS
Type affects the supported devices and number of virtual CPUs available for the virtual
machine. i;e i fwe choosed 32 Bit Windows OS, then even if vSphere 6.5 support 128
vCPU, but this VM will only support up to vCPU depending on OS compatibility.
Step 10: Configure the Virtual Machine Hardware as per requirement and Click on
Next.
Step 15: A new Virtual Machine has been deployed in ESXi Host. You can click on
Summary Page and review the configuration and status.
Step 16: Creating Virtual Machine Wizard only provision a New Virtual Machine in
Environment. It doesn't install Operating System. To Install OS, follow the below
Process:-
RESULT:
Thus, the type 2 virtualization on ESXI 6.5 server was installed on Windows 10 and
successfully created a new virtual machine.
Ex No: 5 Date:
AIM:
To create a VLAN in CISCO packet tracer.
DEFINITION:
A Virtual LAN (VLAN) is simply a logical LAN. VLANs have similar characteristics
with those of physical LANs, only that with VLANs, you can logically group hosts even
if they are physically located on separate LAN segments.
Each VLAN as a separate subnet or broadcast domain. For this reason, to move packets
from one VLAN to another, we have to use a router oor a layer 3 switch. VLANs are
configured on switches by placing some interfaces into one broadcast domain and some
interfaces into another.
PROCEDURE:
Switch#config terminal
Switch(config)#vlan 10
Switch(config-vlan)#name SALES
Switch(config-vlan)#vlan 20
Switch(config-vlan)#name IT
3. Assign switch ports to the VLANs. Remember each VLAN is viewed as separate
broadcast domain.
An access port is assigned to a single VLAN. These ports are configured for switch ports
that connect to devices with a normal network card, for example a PC in a network.
A trunk port on the other hand is a port that can be connected to another switch or router.
This port can carry traffic of multiple VLANs.
We will configure switch interfaces fa 0/1 through fa 0/4 as access ports to connect to our
PCs. Here, interfaces fa 0/1 and fa 0/2 are assigned to VLAN 10 while interfaces fa
0/3 and fa 0/4 are assigned to VLAN 20.
Switch Interface fa0/5 will be configured as trunk port, as it will be used to carry traffic
between the two VLANs via the router.
Switch>enable
Switch#config terminal
Switch(config)#int fa0/1
Switch(config-if)#int fa0/3
Switch(config-if)#int fa0/4
Worth noting: We could have configured all the above interfaces as access ports
using interface range command as shown below:
In the above commands, we have specified an interface range and then proceeded to
configure all the ports specified as access ports.
Interface fa0/5 is configured as trunk and will be used to for inter-VLAN communication.
Switch(config)#int fa 0/5
4. Assign static IP addresses to the four PCs which are located in the separate VLANs.
PC1 and PC2 fall in VLAN 10 while PC3 and PC4 fall in VLAN 20.
Ping PC2 from PC1 both in VLAN 10. Ping test should be successful.
Ping PC3 in VLAN 20 from PC1 in VLAN 10. We have ve used VLANs to place the hosts
into two logical networks which can be viewed as separate broadcast domains.
To test connectivity between computers in different VLANs. Ping PC3 in VLAN 20 from
PC1 in VLAN 10.
RESULT:
Thus, the VLAN was successfully created using CISCO Packet tracer.
Ex No: 6 Date:
AIM:
To install Kernel based Virtual Machine (KVM) in Linux.
DEFINITION:
Kernel-based Virtual Machine (KVM) is an open-source type-1 (bare-metal) hypervisor.
This functionality permits a host system, such as Oracle Linux 8, to host multiple virtual
machines (VMs) or guests when running on supported hardware.
PROCEDURE:
Before installing KVM on Ubuntu, we are first going to verify if the hardware
supports KVM. A minimum requirement for installing KVM is the availability of CPU
virtualization extensions such as AMD-V and Intel-VT.
1. To check whether the Ubuntu system supports virtualization, run the following
command.
sudo kvm-ok
If kvm-ok returns an error stating KVM acceleration cannot be used, try solving the
problem by installing cpu-checker.
The qemu package (quick emulator) is an application that allows you to perform
hardware virtualization.
The qemu-kvm package is the main KVM package.
The libvritd-daemon is the virtualization daemon.
The bridge-utils package helps you create a bridge connection to allow other
users to access a virtual machine other than the host system.
The virt-manager is an application for managing virtual machines through a
graphical user interface.
3. When prompted, type Y, press ENTER, and wait for the installation to finish.
1. Only members of the libvirt and kvm user groups can run virtual machines. Add a
user to the libvirt group by typing:
Note: If you need to remove a user from the libvirt or kvm group, just
replace adduser with deluser in the command above.
4. If the virtualization daemon is not active, activate it with the following command:
1. Before you choose one of the two methods listed below, install virt-manager, a tool for
creating and managing VMs:
Make sure you download an ISO containing the OS you wish to install on a VM and
proceed to pick an installation method.
Method 1: Virt Manager GUI
sudo virt-manager
3. In the dialogue box that opens, select the option to install the VM using an ISO image.
Then click forward.
4. In the next dialogue, click Browse Local and navigate to the path where you stored the
ISO you wish to install.
5. The ISO you chose in the previous window populates the field in Step 2. Proceed to
Step 3 by clicking forward.
6. Enter the amount of RAM and the number of CPUs you wish to allocate to the VM and
proceed to the next step.
7. Allocate hard disk space to the VM. Click Forward to go to the last step.
8. Specify the name for your VM and click Finish to complete the setup.
9. The VM starts automatically, prompting you to start installing the OS that’s on the ISO
file.
Use the virt-install command to create a VM via Linux terminal. The syntax is:
Option Description
--
A short description of the VM
description
The location of the VM on your disk (if you specify a qcow2 disk file that does not
--disk
exist, it will be automatically created)
RESULT:
Thus, the Kernel based Virtual Machine was successfully created in Linux OS.
Ex No: 7 Date:
DEFINITION:
Nested virtualization allows you to run a virtual machine (VM) inside another
VM while still using hardware acceleration from the host.
PROCEDURE:
For example:
cat /sys/module/kvm_intel/parameters/nested
Y
1. Shut down all running VMs and unload the kvm_probe module:
1. Shut down all running VMs and unload the kvm_amd module:
2. Click CPUs in the side menu. In the Configuration section, there are two options -
either type host-passthrough in the Model: field, or select the Copy host CPU
configuration check box (that fills the host-model value in the Model field).
3. Click Apply.
3. Verify that the virtual machine has virtualization correctly set up:
1. sudo virt-host-validate
2. QEMU: Checking for hardware virtualization : PASS
3. QEMU: Checking if device /dev/kvm exists : PASS
4. QEMU: Checking if device /dev/kvm is accessible : PASS
5. QEMU: Checking if device /dev/vhost-net exists : PASS
6. QEMU: Checking if device /dev/net/tun exists : PASS
...
ii) Enable Nested Virtualization Feature for VirtualBox VM from GUI
Step 1: Open VirtualBox manager either from Dash or Menu. Click on the VM in which
you wanted to enabled the nested feature and then select "Settings".
Step 2: Go to "System -> Processor" and click the "Enable Nested VT-x/AMD-V" check
box. Click OK to save the changes.
From now on this VM will act as a hypervisor, so that you can run VMs inside it.
Nested VT feature is available on host systems that run AMD and Intel CPUs. However,
for Intel CPUs, the option is grayed out. So, you can't directly enable it from Virtualbox
manager.
Step 3: Verify If Nested Virtualization Is Enabled For VMs
Log in to the VM and run the following command to check if nested feature is enabled or
not:
If we see “vmx” (Intel-VT technology) or “svm” (AMD-V support) in the output, the
virtualbox guest machine can work as a hypervisor and host VMs. As you can see in the
above output, Ubuntu 20.04 VM supports virtualization.
RESULT:
Thus, the Nested Virtual Machine (VM under another VM) in Kernel based Virtual
Machine was successfully created.