Monthly Archives: November 2016

Quick copy & paste how-to: Install KVM on CentOS 7

CentOS 7.2.1511 64bit
ftp://ftp.hosteurope.de/mirror/centos.org/7.2.1511/isos/x86_64/CentOS-7-x86_64-NetInstall-1511.iso

URL for netinstall: ftp://ftp.hosteurope.de/mirror/centos.org/7/os/x86_64

Host: LV root: 200 GB

(Somehow, VG group size was not being offered during install, so after install: Removed partition with fdisk, create
new one, fdisk knows start/end cylinder by itself, choose Linux LVM partition type: 8e, write, reboot,
pvresize /dev/sda2, done)

vi /etc/sysconfig/selinux
SELINUX=disabled

yum install wget screen lynx vim libvirt qemu-kvm tigervnc tigervnc-server system-config-firewall-tui xterm bridge-utils virt-manager openssh-askpass

yum groupinstall "GNOME Desktop"

yum update

vi /usr/lib/systemd/system/vncserver@.service
replace USER with root

vi /etc/ssh/sshd_config
Port 450
PermitRootLogin without-password

adduser admin
passwd admin

systemctl disable firewalld
systemctl disable wpa_supplicant
systemctl disable bluetooth
systemctl disable alsa-state
systemctl disable abrtd
systemctl disable ModemManager
systemctl disable NetworkManager
systemctl disable cups
systemctl disable avahi-daemon
systemctl disable gssproxy
systemctl disable dnsmasq
systemctl disable upower
systemctl disable udisks2
systemctl disable colord
systemctl disable chronyd
systemctl disable auditd
systemctl disable libstoragemgmt
systemctl disable accounts-daemon
systemctl disable packagekit
systemctl disable polkit

vi /etc/sysconfig/network-scripts/ifcfg-enp3s0
TYPE="Ethernet"
BOOTPROTO="none"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="no"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_PEERDNS="yes"
IPV6_PEERROUTES="yes"
IPV6_FAILURE_FATAL="no"
NAME="enp3s0"
UUID="ac5861af-de34-416d-afcc-915776a8e4f0"
DEVICE="enp3s0"
ONBOOT="yes"
# IPADDR="x.x.x.x"
PREFIX="24"
# GATEWAY="x.x.x.x"
DNS1="8.8.8.8"
DNS2="8.8.4.4"
DNS3="1.2.3.4"
DOMAIN="something.net"
USERCTL=no
BRIDGE=br0

vi /etc/sysconfig/network-scripts/ifcfg-br0
DEVICE=br0
TYPE=Bridge
BOOTPROTO=none
ONBOOT=yes
DELAY=0
NM_CONTROLLED=no
BROADCAST=x.x.x.x
GATEWAY=x.x.x.x
IPADDR=x.x.x.x
NETMASK=x.x.x.x
DNS1=x.x.x.x
DNS2=x.x.x.x
DNS3=x.x.x.x
IPV6INIT=no
USERCTL=no

vi /etc/sysctl.conf
net.ipv4.ip_forward = 1
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1

vi /etc/postfix/main.cf:
inet_protocols = ipv4

Add hostname to /etc/hosts

reboot

vncpasswd
systemctl start vncserver@:10.service

VNC connect to host:10

virt-manager:

QEMU/KVM ->

1. Virtual Networks -> default -> (Device: virbr0) -> Autostart: unchecked (Never) -> Apply

2. Storage -> + (add) -> Name: “vm-lvm” -> Type: logical: LVM Volume Group -> > Target Path: /dev/ber06 (enter path to VG group manually :-( ) -> Build Pool: unchecked -> Finish