当前位置:网站首页>KVM installation and deployment
KVM installation and deployment
2022-04-23 09:21:00 【King_ nul】
KVM Installation and deployment
One 、 Create a new virtual machine first , Good configuration ip Address , Close the firewall and selinux
# close selinux
[root@tools ~]# getenforce
Permissive
# Turn off firewall
[root@tools ~]# systemctl stop firewalld && systemctl disable firewalld
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
# To configure ip Address
[root@tools ~]# tail -4 /etc/sysconfig/network-scripts/ifcfg-ens33
IPADDR=192.168.2.13
PREFIX=24
GATEWAY=192.168.2.2
DNS1=114.114.114.114
Two 、 To configure yum
# Move yum.repos.d All the documents under to media in
[root@tools ~]# mv /etc/yum.repos.d/* /media/ | ll /etc/yum.repos.d/
total 0
# Required for transmission yum Mount and make documents repo Source
[root@tools ~]# mv kvm_yum /opt/
[root@tools ~]# ll /opt/
total 0
drwxr-xr-x. 5 root root 53 Apr 6 12:44 kvm_yum
# Make yum Source
[root@tools ~]# vim /etc/yum.repos.d/kvm.repo
[root@tools ~]# head -n 6 /etc/yum.repos.d/kvm.repo
[kvm]
name=kvm
baseurl=file:///opt/kvm_yum
gpgcheck=0
enabled=1
# Verification source
[root@tools ~]# yum repolist
Loaded plugins: fastestmirror
Determining fastest mirrors
kvm | 3.6 kB 00:00:00
(1/2): kvm/group_gz | 166 kB 00:00:00
(2/2): kvm/primary_db | 3.1 MB 00:00:00
repo id repo name status
kvm kvm 4,021
repolist: 4,021
3、 ... and 、 install kvm Software and tools and start the virtual machine
usage: qemu-kvm [options] [disk_image]
'disk_image' is a raw hard disk image for IDE hard disk 0
# Software to install
[root@tools ~]# yum -y install qemu-kvm openssl libvirt
# start-up libvirt service
[root@tools ~]# systemctl start libvirtd
# Give the file executable rights
[root@tools ~]# chmod +x qemu-ifup-NAT.txt
[root@tools ~]# ll
-rw-r--r--. 1 root root 13287936 Apr 6 12:43 cirros-0.3.3-x86_64-disk.img
-rwxr-xr-x. 1 root root 2094 Apr 6 12:43 qemu-ifup-NAT.txt
# Establish a soft connection , Connect kvm The source file
[root@tools ~]# ln -s /usr/libexec/qemu-kvm /usr/bin/qemu-kvm
[root@tools ~]# ll -d /usr/bin/qemu-kvm
lrwxrwxrwx. 1 root root 21 Apr 6 13:14 /usr/bin/qemu-kvm -> /usr/libexec/qemu-kvm
# start-up kvm Program , Start virtual machine
[root@tools ~]# qemu-kvm -m 1024 -drive file=/root/cirros-0.3.3-x86_64.img,if=virtio -net nic,model=virtio -net tap,script=/root/qemu-ifup-NAT.txt -nographic -vnc :1
____ ____ ____
/ __/ __ ____ ____ / __ \/ __/
/ /__ / // __// __// /_/ /\ \
\___//_//_/ /_/ \____/___/
http://cirros-cloud.net
login as 'cirros' user. default password: 'cubswin:)'. use 'sudo' for root.
cirros login: cirros
Password:
$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 52:54:00:12:34:56 brd ff:ff:ff:ff:ff:ff
inet 192.168.122.76/24 brd 192.168.122.255 scope global eth0
inet6 fe80::5054:ff:fe12:3456/64 scope link
valid_lft forever preferred_lft forever
版权声明
本文为[King_ nul]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230629527258.html
边栏推荐
- Kettle experiment
- Image processing in opencv -- Introduction to contour + contour features
- Base de la technologie électronique numérique 3.1 aperçu du circuit de porte, 3.2 circuit de porte à diode semi - conductrice
- LGB, XGB, cat, k-fold cross validation
- Four pictures to understand some basic usage of Matplotlib
- Your guide to lowering your cholesterol with TLC (continuously updated)
- JS prototype chain
- tsdf +mvs
- MySQL小練習(僅適合初學者,非初學者勿進)
- I don't understand time, timestamp and time zone. Look at this article
猜你喜欢

Open services in the bottom bar of idea

How to protect open source projects from supply chain attacks - Security Design (1)

Detailed explanation of delete, truncate and drop principles in MySQL database

错题汇总1

nn. Explanation of module class

MySQL小練習(僅適合初學者,非初學者勿進)

Canary publishing using ingress

Kettle实验 (三)

kettle实验

EmuElec 编译总结
随机推荐
Emuelec compilation summary
First principle mind map
Node installation
NPM reports an error: operation not allowed, MKDIR 'C: \ program files \ node JS \ node_ cache _ cacache’
Learn FPGA (from Verilog to HLS)
The most concerned occupations after 00: civil servants ranked second. What was the first?
Wechat applet catchtap = "todetail" event problem
Canary publishing using ingress
Pctp test experience sharing
《信息系统项目管理师总结》第八章 项目干系人管理
小程序报错 :should have url attribute when using navigateTo, redirectTo or switchTab
小程序报错:Cannot read property 'currentTarget' of undefined
RSA encryption and decryption signature verification
How to protect open source projects from supply chain attacks - Security Design (1)
Harbor enterprise image management system
资源打包关系依赖树
Using JS to realize a thousandth bit
基于ThinkPHP5版本TRC20-资金归集解决方案
NLLLoss+log_ SoftMax=CE_ Loss
LeetCode_ DFS_ Medium_ 1254. Count the number of closed islands