kvm y samba

7
KVM Y SAMBA DOCUMENTO CREADO PARA QUE INICIEN EL CAMINO A LA CONF DE UNA INFRAESTRUCTURA SOBRE CENTOS Y SACARLE PARTIDO A LAS VMs, ESPERO LES SEA DE UTILIDAD. NOTA: no detallo mucho por tema de timepo, pero con conocimentos basicos de cualquier distrib linux podran entender sin problemas el contenido. JSA # egrep '(vmx|svm)' /proc/cpuinfo # yum install qemu-kvm qemu-img virt-manager libvirt libvirt-python python-virtinst libvirt-client virt-install virt-viewer

Upload: jerry-sanchez

Post on 11-Jan-2016

57 views

Category:

Documents


1 download

DESCRIPTION

DOCUMENTO CREADO PARA QUE INICIEN EL CAMINO A LA CONF DE UNA INFRAESTRUCTURA SOBRE CENTOS Y SACARLE PARTIDO A LAS VMs,ESPERO LES SEA DE UTILIDAD.NOTA: no detallo mucho por tema de tiempo, pero con conocimientos básicos de cualquier distribucion linux podrán entender sin problemas el contenido.

TRANSCRIPT

Page 1: KVM Y SAMBA

KVM Y SAMBA

DOCUMENTO CREADO PARA QUE INICIEN EL CAMINO A LA CONF DE UNA INFRAESTRUCTURA SOBRE CENTOS Y SACARLE PARTIDO A LAS VMs,ESPERO LES SEA DE UTILIDAD.NOTA: no detallo mucho por tema de timepo, pero con conocimentos basicos de cualquier distrib linux podran entender sin problemas el contenido.

JSA

# egrep '(vmx|svm)' /proc/cpuinfo

# yum install qemu-kvm qemu-img virt-manager libvirt libvirt-python python-virtinst libvirt-client virt-install virt-viewer

Page 2: KVM Y SAMBA

qemu-kvm =  QEMU emulator

qemu-img = QEMU disk image manager

virt-install =  Command line tool to create virtual machines.

libvirt = Provides libvirtd daemon that manages virtual machines and controls hypervisor.

libvirt-client  = provides client side API’s for accessing servers and also provides virsh utility

which provides command line tool to manage virtual machines.

virt-viewer – Graphical console

Ahora verificamos la configuración de la red,

Cambiamos para que la tarjeta levante en el boot

Page 3: KVM Y SAMBA

CONF LA VM VIRTUAL

Modo grafico para news

Page 4: KVM Y SAMBA

Me pide instalar libvirt-daemon-config-network

Se instala y ok

Pedirá acceso de root si no lo tenemos

crear un puente a la nic física

MUYYYYY IMPORTANT antes de crear el puente

NetworkManager does not support bridging. NetworkManager must be disabled to

use networking with the network scripts (located in the /etc/sysconfig/network-

scripts/directory). In addition, it is highly recommended that there be more than one

connection to a guest virtual machine. Make sure that the host physical machine

interface you choose to bridge is not the only connection to the guest virtual machine.

# systemctl disable NetworkManager

# systemctl enable network

# systemctl stop NetworkManager

# systemctl start network

Page 5: KVM Y SAMBA

If you do not want to disable NetworkManager entirely, add

"NM_CONTROLLED=no" to the ifcfg-* network script being used for the bridge.

SERVIDOR ARCHIVOS – SAMBA

Creamos una vm con 2 tb aprox, con características minimas de desarrollo y

compatiblidad para soft antiguo a centos7

Luego de crear y enlazarlo al br0(automatico) configuramos los servicios,

Levantamos la nic

Como root

#ip link set eth0 up

Chekeamos si se creo el script

#cat /etc/sysconf*/network-s*/ifcfg-eth0

Y cambiamos

BOOTPROTO=yes#COMENTAMOS TODO IPV6, POR EL MOMEONTOONBOOT=yesIPADDR=”192.168.1.13”NETMASK=”255.255.255.0”GATEWAY=”192.168.1.1”DNS1=”192.168.1.1”DNS2=”8.8.8.8”

y reniciamos el servicio#systemctl restart network.service

Verificamos y listo. A configurar el file server

Como root#yum install samba samba-client samba-common

Creamos un smb.conf Nuevo#mv /etc/samba/smb.conf /etc/samba/smb.bak#vi /etc/samba/smb.conf Asignamos la carpeta proyectos s compartir y las credenciales

Page 6: KVM Y SAMBA

[global]Workgroup = SU_EMPRESAServer string = Samb Srver %vNetbios name = srvFileSecurity = userMap to guest = bad userDns proxy = no#============ Share Definitios ============[CARPETA]Path = /home/jsanchez/CARPETA_EMPRESA/CARPETAValid users = @smbgrpGuest ok = noWritable = yesBrowsable = yes

#systemctl enable smb.service#systemctl enable nmb.service#systemctl restart smb.service#systemctl restart nmb.service

#firewall-cmd –permanent –zone=public –add-service=samba#firewall-cmd reload

#groupadd smbgrp#useradd USUARIO –G smbgrp#smbpasswd –a USUARIO#mkdir –p /home/USUARIO/data/CARPETA#cd /home/USUARIO/data#chmod –R 0777 CARPETA/#chcon –t samba_share_t CARPETA/#systemctl restart smb.service#systemctl restart nmb.service

#testparm#chown –R USUARIO:smbgrp CARPETA/

Listo para testear.

Monitoreando cambios en los archivos compartidos

Page 7: KVM Y SAMBA

#yum install python-setuptools#easy_install pyinotify