CentOS 7 Installing KVM/QEMU Hypervisor

Domain name: example.com     Realm name: EXAMPLE.COM

Workgroup: EXAMPLE     Server IP address: xx.xx.xx.xx

Server name: linuxsvr01     Client name: linuxclnt01

Root password: ?Pa55w0rd!

This presumes a minimal install of CentOS 7 on host (Installing CentOS 7 Server) and that the Post Installation Tasks have been completed.

Install and configure the iSCSI Client as VMs will be stored on another host.

It is necessary set up up an iSCSI Target on the other host that points at this host's ip address.

We can now confirm what partition has been provided from the target server with

# cat /proc/partitions
   8        0  312571224 sda
   8        1     512000 sda1
   8        2  312057856 sda2
  11        0    1048575 sr0
 253        0   52428800 dm-0
 253        1    3932160 dm-1
 253        2  255627264 dm-2
   8       16  161165312 sdb

We can now format the partition

# mkfs.xfs /dev/sdb -f
meta-data=/dev/sdb               isize=512    agcount=4, agsize=10072832 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=0, sparse=0
data     =                       bsize=4096   blocks=40291328, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal log           bsize=4096   blocks=19673, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0

Create a mount directory

# mkdir /vmstore

We can now add /vmstore to auto mount in fstab by adding the following line

# vi /etc/fstab
/dev/sdb /vmstore                                 xfs     _netdev         0 0

Now to install KVM/QEMU

# yum -y install qemu-kvm libvirt virt-install bridge-utils

When that has finished it is time to configure the bridge network (replace eth0 if necessary)

# nmcli c add type bridge autoconnect yes con-name br0 ifname br0
Connection 'br0' (f68369ec-67c7-4701-9dc1-2c47d3642c9b) successfully added.
# nmcli c modify br0 ipv4.addresses xx.xx.xx.xx/24 ipv4.method manual
# nmcli c modify br0 ipv4.gateway xx.xx.xx.xx
# nmcli c modify br0 ipv4.dns ""

We must now delete the current interface eth0 and then add it as a member (slave) of br0, this needs to be done on the client itself as you will lose the connection

# nmcli c delete eth0
# nmcli c add type bridge-slave autoconnect yes con-name eth0 ifname eth0 master br0
# reboot

We are going to use the Virtual Machine Manager GUI to configure the Windows Server 2012 r2 VM so we need a desktop environment

# yum -y groups install "GNOME Desktop"

Because this is a mixed environment (Linux/Windows) I used WinSCP to copy the Windows ISO across to /vmstore

Using the physical machine we can load the GUI

# startx

In Applications>Favourites open Terminal and install Virtual Machine Manager

# yum -y install virt-manager