0% found this document useful (0 votes)
16 views

Cloud Computing Lab

Uploaded by

sri.03.saiv
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Cloud Computing Lab

Uploaded by

sri.03.saiv
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 5

Ex.

No: Virtual Machine with Different Configuration


Date :

Aim:
To create and run the virtual machine of different configuration. Check how many virtual
machines can be utilized at particular time.
Procedure:
Step 1: Check that your CPU supports hardware virtualization.
$ egrep -c '(vmx|svm)' /proc/cpuinfo
Step 2: To see if your processor is 64-bit or not.
$ egrep -c ' lm ' /proc/cpuinfo
Step 3: Now see if your running kernel is 64-bit or not.
$ uname –a
Step 4: To install the KVM, execute the following command.
$ sudo apt-get install qemu-kvm
$ sudo apt-get install libvirt-bin
$ sudo apt-get install ubuntu-vm-builder
$ sudo apt-get install bridge-utils
Step 5: Verify the KVM installation has been successful or not.
$ virsh -c qemu:///system list
Step 6: Installing a GUI for KVM.
$ sudo apt-get install virt-manager
Step 7: Creating a KVM guest machine.
$ virt-manager

Step 9: Then start with creating a new virtual machine by hitting the new button. Enter the name
of your virtual machine. Select your installation media type and click forward.

1
Step 10: Then you will have to set the amount RAM and CPU's that will be available to that
virtual machine.

Step 11: Finally, you will get a confirmation screen that shows the details of your virtual
machine. Then click finish button.

Step 12: Repeat the same procedure to create multiple virtual machines.

Output:

Result:

2
Ex.No: Install Gcc Compilers in Virtual Machine
Date :

Aim: To install a C compiler in the virtual machine and execute a sample program.

Algorithm:
Step 1: To check Gcc compiler is installed or not.
$ dpkg - l | grep gcc
Step 2: If GCC compiler is not installed in VM, to execute the following command
$sudo apt-get install gcc (or) $sudo apt-get install build-essential
Step 3: Open a Vi Editor
Step 4: Get the no. of rows and columns for first and second matrix.
Step 5: Get the values of x and y matrix using for loop.
Step 6: Find the product of first and second and store the result in multiply matrix.
multiply[i][j]=multiply[i][j]+(first[i][k]*second[k][j]);
Step 7: Display the resultant matrix.
Step 8: Stop the program.

Program:
#include <stdio.h>
void main()
{
int m, n, p, q, c, d, k, sum = 0;
int first[10][10], second[10][10], multiply[10][10];
printf("Enter the number of rows and columns of first matrix\n");
scanf("%d%d", &m, &n);
printf("Enter the elements of first matrix\n");
for ( c = 0 ; c < m ; c++ )
for ( d = 0 ; d < n ; d++ )
scanf("%d", &first[c][d]);
printf("Enter the number of rows and columns of second matrix\n");
scanf("%d%d", &p, &q);
if ( n != p )
printf("Matrices with entered orders can't be multiplied with each other.\n");
else
{
printf("Enter the elements of second matrix\n");

for ( c = 0 ; c < p ; c++ )


for ( d = 0 ; d < q ; d++ )
scanf("%d", &second[c][d]);
for ( c = 0 ; c < m ; c++ )
{
3
for ( d = 0 ; d < q ; d++ )
{
for ( k = 0 ; k < p ; k++ )
{
sum = sum + first[c][k]*second[k][d];
}
multiply[c][d] = sum;
sum = 0;
}
}
printf("Product of entered matrices:-\n");
for ( c = 0 ; c < m ; c++ )
{
for ( d = 0 ; d < q ; d++ )
printf("%d\t", multiply[c][d]);
printf("\n");
}
}
}
Output:
Compile: it105@it105-HP-ProDesk-400-G1-SFF:~$ gcc matrix.c
Run: it105@it105-HP-ProDesk-400-G1-SFF:~$ ./a.out
Enter the number of rows and columns of first matrix
22
Enter the elements of first matrix
2222
Enter the number of rows and columns of second matrix
22
Enter the elements of second matrix
2222
Product of entered matrices:-
8 8
8 8

Result:

4
5

You might also like