Vous êtes sur la page 1sur 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

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 APIs for accessing servers and also provides virsh utility
which provides command line tool to manage virtual machines.
virt-viewer Graphical console

Ahora verificamos la configuracin de la red,


Cambiamos para que la tarjeta levante en el boot

CONF LA VM VIRTUAL
Modo grafico para news

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 fsica

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/networkscripts/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

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 caractersticas 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 MOMEONTO
ONBOOT=yes
IPADDR=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
[global]

Workgroup = SU_EMPRESA
Server string = Samb Srver %v
Netbios name = srvFile
Security = user
Map to guest = bad user
Dns proxy = no
#============ Share Definitios ============
[CARPETA]
Path = /home/jsanchez/CARPETA_EMPRESA/CARPETA
Valid users = @smbgrp
Guest ok = no
Writable = yes
Browsable = yes
#systemctl
#systemctl
#systemctl
#systemctl

enable smb.service
enable nmb.service
restart smb.service
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


#yum install python-setuptools
#easy_install pyinotify

Vous aimerez peut-être aussi