For this project we are going to use KVM (Kernel-Based Virtual Machines), to work with Windows and Linux guest operating systems. The host operating system during the whole project will be Linux 10.04 (64bits).
Installation of KVM
(following this documentation: https://help.ubuntu.com/community/KVM/Installation )
- First of all we should set the needed switches for the virtualization from BIOS.
- Once we set them we are going to see if our processor really supports KVM. If the output from this command is 1 or more, it does :
In our case,he output is 2, so we can continue with the installation.
egrep -c '(vmx|svm)' /proc/cpuinfo
- Now we are going to install the following packages:
- 'qemu-kvm' : the backend
- 'libvirt-bin' : provides libvirtd which you need to administer qemu and kvm instances using libvirt
- 'ubuntu-vm-builder' : powerful command line tool for building virtual machines
- 'bridge utils' : provides a bridge from your network to the virtual machines
- We should test if the installation it's been successful with the following command:
virsh -c qemu:///system list
If everything is correct we have to see this output:
Id Name State
----------------------------------
But during the installation the output was :
/var/run/libvirt/libvirt-sock : Permission denied
failed to connect to the hypervisor
The problem was that the virtual connection (virbr0) created for the virtual machines, disable the eth0 connection. So I bring up the Ethernet interface with the following command :
ifconfig eth0 10.80.86.1 netmask 255.255.255.0 up
Create Virtual Machines
To create the vm's with the different guest operating systems, we are going to install 'virt-manager'.
With Virtual Machine Manager ( http://virt-manager.et.redhat.com) we can create and administrate our KVM just following the steps of the application. It's a graphical way to create the vm's instead do it with commands in the terminal. But we can install a vm with the command virt-install with the parameters we want.
To create them we have to do it from localhost (QEMU) not from localhost (QEMU Usermode)
The steps to create the Virtual Machine are:
- Click on the button “Create a new virtual machine”
- We have to enter a name for the vm and choose the way we want to install the operating system
- Then we choose the operating system type and version
- Choose memory (RAM) and CPU settings
- Create a disk image in the computer hard disk.
The virtual machine is going to be saved in the path: /var/lib/libvirt/image
In this project we are going to develop two vm's, one with Windows as guest operating system, and the other one with Linux.
Now we are going to explain the setting of the differents vm's.
VM1 ( Windows XP pro SP2 x86 )
- Memory RAM : 512 MB
- CPU's : 1
- Storage : 8 GB
VM2 ( Linux Ubuntu 10.04 32bit )
- Memory RAM : 512 MB
- CPU's : 1
- Storage : 8 GB
Once we have create the vm's, we checked if the virtual conection works and if there was any problem of usability, but in both vm's everything was ok.
FTP
We are going to test FTP service between guest operating systems we had installed in the virtual machines.
FTP is a protocol used to copy file from one host to another. In FTP we use port 20 for data and port 21 for commands
We need a server that will make the files available for others and we are going to have clients that will connect to the server and they will upload or download files.
In this project the server is going to be in Linux O.S. And the client will be Windows O.S.
First of all we are going to install a basic configuration of a FTP server on Ubuntu 10.04.
Just following these steps should be easy to setup the configuration.
- Install the package vsftpd
- The configuration of the FTP server is in vsftpd.conf, that it's located in /etc/vsftpd.conf
To make any change to the settings, we can do it with the following command.
sudo gedit/etc/vsftpd.conf
To let the clients upload files to the server we should change #write_enable = YES to write_enable = YES
3. Everytime we make any change we have to restart the vsftpd, in order to make the