-
Notifications
You must be signed in to change notification settings - Fork 20
/
centos7_cis.sh
31 lines (26 loc) · 898 Bytes
/
centos7_cis.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
virt-install \
--virt-type kvm \
--name=centos7_cis \
--os-variant=rhel7.6 \
--cpu host-passthrough \
--vcpus 2 \
--memory 2048 \
--disk path=/data5/kvm/centos/centos7_cis.qcow2,size=40,format=qcow2,sparse=true,bus=scsi,discard=unmap \
--controller type=scsi,model=virtio-scsi \
--network bridge=br0,model=virtio \
--channel unix,target_type=virtio,name=org.qemu.guest_agent.0 \
--graphics spice,gl.enable=no,listen=none \
--video qxl \
--console pty,target_type=virtio \
--metadata title="CentOS 7.7 (CIS)" \
--metadata description='192.168.0.91' \
--location /data3/useful_software/unix/centos/CentOS-7.7-x86_64-Everything-1908.iso \
--extra-args='ks=file:centos7_cis.cfg' \
--initrd-inject=centos7_cis.cfg \
--noreboot
<<COMMENTS
mv centos7_cis.qcow2 centos7_cis.qcow2.bak
time qemu-img convert -O qcow2 centos7_cis.qcow2.bak centos7_cis.qcow2
rm centos7_cis.qcow2.bak
COMMENTS