Installation of virtual machines in Linux

Source: Internet
Author: User

One installation of virtual machines using a graphical interface: 1 Preparation phase:

Configure its CPU to be virtualized:

Prepare the image file and copy it to the specified directory

Installation of virt after configuring Yum source and mounting the software
Installing Virt-manger
[Email protected] ~]# yum-y install virt-*

2 Managing Virtual Machines

Virt-manager Opening the Graphics management tool
Virt-viewer Display virtual machines
Virt List List of running virtual machines
Virsh list--all list all virtual machines
Virsh start runs the specified VM
Virsh shutdown normal shutdown of the specified VM
Virsh Destory forcing the VM to shut down
Virsh create temporarily restores the specified VM
Virsh define permanently restores the specified VM
Virsh undefine Remove front-end management of VMS

3 Generating the virtual machine phase:

1 turning on the virtual Machine Manager


2 Creating a virtual machine


Select Local Browse:

Locate the image file you are in and confirm the installation



Choose to fill in the name of the virtual machine



At this point, the installation is complete and the subsequent configuration needs to be done manually:

Two: command-line installation virtual Machine 1 command parameters in detail:


--name Name
-ram Memory Size
--vcpus Number of virtual CPUs
--file/var/lib/libvirt/images/x.img (can use qcow2 above 7.2) \ installation file location
--file-size 10 \ Its allocated storage size
--CDROM/ROOT/X & its local image file save location

Network remote way to install virtual machines

1 Install the HTTP service and turn it on, turn off the firewall, SELinux




Three: Automatic installation of virtual machine script generation:

Automated installation Steps
must ensure the normal installation and operation of the httpd, the need to ensure the shutdown of the firewall

1 Installing System-config-kickstart

Yum-y Install System-config-kickstart

2 Running System-config-kickstart

A Select time Zone Asia/shanghai

B Select the root user's password

C Select Restart after installation is complete,

D Select mode is Text

E Select how to get the image

F Select New Boot

G Select Auto-start mode is MBR

H Select the partition to select all of the above
1 boot partition first
2 Making swap partitions
3 to go with the partition, with all his remaining memory





I network card selection is generally the way to choose DHCP

J firewall and others are set to off state

K set it to save under the/var/www/html file

3 generated script files for adding edits

%packagesbr/> can add a package name (HTTPD,LFTP, etc.) between them
@base


M using Ksvalidator for syntax detection of scripts

4 added to the KVM Automation script




--vcpus 1 \
--extra-args "KS=HTTP://IP address/Name of build script"

[email protected] ~]# virt-install \
/--name centos8 \
/--ram 512 \
/--vcpus 2 \
/--file/var/lib/libvirt/images/centos8.img \
/--file-size 10 \
/--location/var/www/html/iso/centos-7-x86_64-dvd-1511.iso \
/--extra-args "Ks=127.0.0.1/iso/ks.cfg"

WARNING KVM acceleration not available, using ' QEMU '
Start installation ...
Search for files. Treeinfo ... | 2.2 KB 00:00
Search Files Vmlinuz ... | 9.8 MB 00:00
Search Files Initrd.img ... | MB 00:00
Assigning ' centos8.img ' | Ten GB 00:00
Create a domain ...

Establishment of four virtual machine snapshots 1 Creating a script file

2 Virtual machine creation via KVM graphical interface manager











Installation of virtual machines in Linux

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.