字符界面部署和使用kvm

## 字符界面部署和使用kvm

检查当前服务器 CPU 是否支持虚拟化

grep -E 'svm|vmx' /proc/cpuinfo

在这里插入图片描述
安装相关软件

yum -y install qemu-kvm libvirt libvirt-python libguestfs-tools virt-install virt-manager

启动服务并授权开机自启

systemctl enable libvirtd && systemctl start libvirtd

验证 kvm 的内核模块是否加载

lsmod |grep kvm

在这里插入图片描述
方法一:
首先需要脚本所需要的文件:如下
1.CentOS的iso镜像

2.ks.cfg文件如下:

#platform=x86, AMD64, 或 Intel EM64T
#version=DEVEL
# Install OS instead of upgrade
install
# Keyboard layouts
keyboard 'us'
# Root password
rootpw --iscrypted $1$KXeyOPUO$5JlUe3pPpi.hplHB71JdX/
# 系统语言
#lang zh_CN.UTF-8
lang en_US

# System authorization information
auth  --useshadow  --passalgo=sha512
# Use CDROM installation media
#cdrom

# Use text mode install
# 使用字符界面安装操作系统
text

# Do not configure the X Window System
# 不配置图形界面系统
skipx

# SELinux configuration
selinux --disabled

# Firewall configuration
firewall --disabled

# 设置动态获取 IP
network  --bootproto=dhcp --device=eth0 --onboot=on
#network  --hostname=HOSNAME

# 设置静态 IP
# network  --bootproto=static --device=eth0 --gateway=192.168.122.1 --ip=192.168.122.100 --nameserver=192.168.122.1 --netmask=255.255.255.0 --activate

# 系统安装完成后 重启系统
#halt
reboot

# System timezone 系统时区
timezone Asia/Shanghai

# System services  系统启动时候自动启动的服务
services --enable="chronyd"

# System 
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值