How to encapsulate a virtual machine on a Red Hat Linux system with mirroring

Source: Internet
Author: User

650) this.width=650, "src=" Http://img.baidu.com/hi/jx2/j_0057.gif "alt=" J_0057.gif "/> Today share with everyone in Rhel (Red Hat Company's Linux system), how to encapsulate a virtual machine using mirroring.

First, have to have mirror, here you can see http://ucweb.blog.51cto.com/4042188/1001505 "teach you to get ISO image from Redhat official website"


Second, after downloading, to confirm that the ISO image error-free. You can use the Vitual Machine Manager (VM Manager) to automatically detect the following image installation version, which can be used.

(OS Type:linux

version:red Hat Enterprise Linux7.0)


Third, my real machine is the RHEL7.0 version, ready to encapsulate 3 6.5 versions of the virtual machine to use. Real Machine IP is 172.25.8.250

A yum repository on a real machine that builds a real machine:

Mount/iso/rhel-server-7.0-x86_64-dvd.iso/mnt temporarily hanging the 7.0 version of the image in the/mnt directory

Cd/etc/yum.repos.d/Entering the catalogue

Vim Yum.repo for editing

What to edit: [Yum]

Name=yum

Baseurl=file:///mnt

Gpgcheck=0

Yum Clean all refreshes the warehouse configuration

Yum install-y httpd Installation httpd

Systemctl Start httpd startup httpd

Systemctl Enable httpd boot httpd

Systemctl Stop Firewalld Close firewall

Systemctl Disable FIREWALLD boot does not start firewall

A yum repository for 6.5 virtual machines on a real machine

Mkdir/var/www/html/source

Mount/iso/rhel-server-6.5-x86_64-dvd.iso manually mounted to/var/www/html/source for use

Boot automatically mount writable/etc/fstab

Vim/etc/fstab

/iso/rhel-server-7.0-x86_64-dvd.iso/var/www/html/iso9660 ro,relatime 0 0

The meaning is: The image file hangs in the point type mount parameter not to be detected

Iv. Package version 6.5 virtual machine:

Use the 6.5 version of the image to do a rehel6.5-base first

1. Firewalls

Iptables-l View Firewall (-L is shorthand for--list to list rules)

Vim/etc/sysconfig/selinux kernel-level enhanced firewall modified to =disabled

/etc/init.d/iptables Stop Close Firewall

Iptables-l

Chkconfig--list iptables Displays the status information of the Iptables

CD ~

Rm-f *

CD/ETC/UDEV/RELES.D each file processes a series of rules to help udev assign names to device files to ensure that they are recognized by the kernel

Rm-f 70-persistent-net.rules

Cd/etc/sysconfig/network-scripts

2. Configure the network Vim/etc/sysconfig/network-scripts/ifcfg-eth0

What is written: device= "Eth0"

Bootproto= "None"

onboot= "Yes"

#IPADDR =172.25.8.1 in the same network segment as the real machine

#PREFIX = 24 (First # Note, after configuring the network configuration of 3 virtual machines, remove #)

3. Configure Yum

cd/etc/yum.repod/

Vim Yum.repo

What you wrote: [Yum]

Name=yum

Baseurl=http://172.25.8.250/source assigned to a 6.5-version warehouse built by the real machine

Gpgcheck=0

Enable=1

4.SSH, host name Mapping to IP,/etc/hosts

cd/etc/ssh/

Rm-f ssh_host_*

/etc/init.d/sshd restart

Vim/etc/sysconfig/network Edit/etc/sysconfig/network

What's written: server1.example.com

Vim/etc/hosts editing the hostname configuration file

172.25.8.1 server1.example.com hostname mapped to IP

172.25.8.2 server2.example.com hostname mapped to IP

172.25.8.3 server3.example.com hostname mapped to IP

Force the Rehel6.5-base virtual machine to be closed, delete deleted, delete associated storage files, and take the next snapshot.


5. Take a snapshot on the real machine

Cd/var/lib/libvirt/images

ll Rhel6.5-base.qcow2

Qemu-img create-f qcow2-brhel6.5-base.qcow2 Server1

Qemu-img create-f qcow2-brhel6.5-base.qcow2 Server2

Qemu-img create-f Qcow2-brhel6.5-base.qcow2 Server3

New virtual machine Server1 installation with/var/lib/libvirt/images/server1

New virtual machine Server2 installation with/var/lib/libvirt/images/server2

New virtual machine Server3 installation with/var/lib/libvirt/images/server3


After successful installation, in each virtual machine

Modify the respective host name Vim/etc/sysconfig/network

Modify the respective network configuration Vim/etc/sysconfig/network-scripts/ifcfg-eth0

Configure Yum.

Installing the Yum install-y ftp openssh-clients

True machine input command: SSH [email protected] for connection test

Note: Real machine/etc/hosts also need to have ' 172.25.8.1 server1.example.com ' hostname mapped to 3 local resolution of IP.


This article from the "12148275" blog, reproduced please contact the author!

How to encapsulate a virtual machine on a Red Hat Linux system with mirroring

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.