Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install a virtual machine in kvm character interface

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "kvm character interface how to install virtual machine". In daily operation, I believe many people have doubts about how to install virtual machine in kvm character interface. Xiaobian consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubt of "how to install virtual machine in kvm character interface". Next, please follow the editor to study!

Link: https://pan.baidu.com/s/15dhiBfFxqSDUGWLvy-rHgw

Extraction code: 2iah

Maintenance of Baidu network disk without password

Command line to install the kvm virtual machine: yum-y install kvm qemu libvirt virt-viewer qemu-system virt-manager libguestfs-tools bridge-utils virt-install libvirt-python qemu-kvm python-virtinst yum install acpid-y / / if you want to use the virsh command, you must open the acpid service systemctl start acpid.servicesystemctl enable acpid.servicesystemctl start libvirtd.servicesystemctl enable libvirtd.service to create a bridging network Bridge mode, that is, the virtual bridge network connection mode, so that the client and the machines in the subnet can communicate with each other. You can make a virtual machine a host with a separate IP in the network. A bridged network (also known as physical device sharing) is used to copy a physical device to a virtual machine. Bridges are often used for advanced settings, especially if the host has multiple network interfaces. Add a new line at the end of cd / etc/sysconfig/network-scripts/cp ifcfg-ens33 ifcfg-br0vi ifcfg-ens33//, and remove BRIDGE= "br0" vi ifcfg-br0 from the IP-related parameters of the network card and modify the following: DEVICE=br0BOOTPROTO=static#NM_CONTROLLED=noONBOOT=yesTYPE=BridgeIPADDR=192.168.80.100NETMASK=255.255.255.0 service network restart

What my two network cards look like.

Before installation, set the environment language to English LANG= "en_US.UTF-8". If it is Chinese, some versions may report an error. CentOS 7 modifies / etc/locale.conf here. Mkdir-p / opt/kvm/images create a new storage pool create pre-allocated metadata options qcow2 format image file: qemu-img create-f qcow2-o preallocation=metadata / opt/kvm/images/centos7.qcow2 9G Note: create the create required to create the client,-f qcow2 means to create a disk in the format qcow2, / home/vms/centos7.qcow2 represents the disk name and disk file created 9G indicates the available size of the disk. The key to success is to select the preallocation=metadata option when creating a qcow2 mirror. Qemu-img info centos6.5.qcow2virt-install-name=centos6.5-virt-type=kvm-ram=512-vcpus=1-cdrom=/var/lib/libvirt/images/CentOS-6.5-x86_64-minimal.iso-disk path=/opt/kvm/images/centos6.5.qcow2 Size=9-- network bridge=br0-- vnc-- vncport=15950-- vnclisten=0.0.0.0-- noautoconsole-- autostart Note:-- name: specify the name of the virtual machine-- ram: specify the memory size of the virtual machine-- disk path=xxx: specify the location of the virtual machine disk size=xxx: specify the disk size of the virtual machine-- vcpus: specify the number of virtual cpu-- os-type: specify the type of kvm virtual machine operating system-- os-variant: specify the guest. Type of home system-you can confirm this list with the following command # osinfo-query os--network: specify the network type of the virtual machine-graphics: specify the type of graphics. If set to "none", there is no graphics-- console: specify console type-- cdrom: use CD image-- location: specify the installation media path, such as the file path of CD image. Http:// ftp:// nfs://--extra-args: specify the parameters set in the kernel and set different additional options according to different installation methods. Centos has an installation graphical interface yum install-y tigervnc-servercd / lib/systemd/system to copy the service. Name it vncserver@:1.servicecp vncserver@.service vncserver@:1.service and then modify vncserver@:1.servicevi vncserver@:1.service to change the vi in the text to root (if you are now a root user) and change it as follows: [Unit] Description=Remote desktop service (VNC) After=syslog.target network.target [Service] Type=forking # Clean any existing files in/ tmp/.X11-unix environment ExecStartPre=/bin/sh-c'/ usr/bin/vncserver-kill% I > / dev/null 2 > & 1 | |: 'ExecStart=/sbin/runuser-l root-c "/ usr/bin/vncserver% I" PIDFile=/root/.vnc/%H%i.pid ExecStop=/bin/sh-c' / usr/bin/vncserver-kill% I > / dev/null 2 > & 1 | |:'[Install] WantedBy=multi-user.targetsystemctl daemon-reloadvncserver: 1netstat-anpt | grep vnc creates one in the software and enters 192.168.80.10015950 on the first line

At this point, the study of "how to install a virtual machine in the kvm character interface" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report