Skip to content

通过知识获得解放,通过技术获得自由

Menu
  • 专题目录
  • 液压相关
    • 液压技术
    • 液压相邻技术
    • 液压应用
  • 计算机相关
    • 计算机和软件
    • 网络和网站技术
  • 哲学
  • 关于本站
Menu

开启centos7下KVM服务器[0]

Posted on 2023年11月14日2025年5月6日 by
对于有强大硬件的设备只是安装centos7作为服务器,有些时候是不足的,除了安全性考虑,另外就是提升资源利用的效率。
本文接前篇《

物理机安装centos7 x64

》,注意以下安装时以非root用户名登录,且采用sudo授权方式

KVM作为通用的linux虚拟化方案,其核心采用的是QEMU(详细见linux虚拟化方案)。另外KVM虚拟化技术还用在软路由系统PVE中作为关键组件。centos7 是默认开启KVM,但是没有安装完整的软件包和界面包,以下为安装和开启KVM工具集的过程的记录。

  • 安装KVM工具集
cat /etc/centos-release #查看系统版本

cat /proc/cpuinfo | egrep 'vmx|svm' 
#查看菜谱是否支持虚拟化,输出中有红色vmx和svm即表示支持

lsmod | grep kvm #查看kvm是否加载
kvm_intel 170086 0 
kvm 566340 1 kvm_intel 
irqbypass 13503 1 kvm
若没有加载输入以下指令加载
modprobe kvm

安装kvm软件包,主要包括qemu-kvm: KVM模块,libvirt: 虚拟管理模块,virt-manager: 图形界面管理虚拟机,virt-install: 虚拟机命令行安装工具
yum install qemu-kvm qemu-img \
virt-manager libvirt libvirt-python virt-manager \
libvirt-client virt-install virt-viewer -y

启动libvirt并设置开机自启动
systemctl start libvirtd
systemctl enable libvirtd

获取文件分区情况
df -hT

新建两个目录
cd ..
ll  #进入root目录
sudo mkdir vmm
cd vmm
sudo mkdir ISO
sudo mkdir images
  • 创建并启用centos7虚拟机(在centos7中安装另外你一个centos7)

进入vmm管理器

此处需要注意,对于有多个物理网卡是host,直接在网络源处更改即可,模式需要选桥接,否则无法上网。

参考资料:

  1. https://blog.csdn.net/qq_39452428/article/details/80781403

欢迎回来

希望本站对你有所帮助!

如有疑问请联系info@fanlog.org
2023 年 11 月
一二三四五六日
 12345
6789101112
13141516171819
20212223242526
27282930 
« 6 月    

AI辅助 (17)

© 2025 | Powered by Superbs Personal Blog theme
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept All”, you consent to the use of ALL the cookies. However, you may visit "Cookie Settings" to provide a controlled consent.
Cookie SettingsAccept All
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT