forked from sej7278/virt-installs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
centos7_kickstart.sh
36 lines (28 loc) · 929 Bytes
/
centos7_kickstart.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
32
33
34
35
36
#!/bin/bash
VMNAME="kickstart"
virt-install \
--virt-type kvm \
--name=centos7_${VMNAME} \
--os-variant=rhel7.6 \
--cpu host-passthrough \
--vcpus 2 \
--memory 2048 \
--disk path=~/centos7_${VMNAME}.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 (${VMNAME})" \
--location ~/CentOS-7.7-x86_64-Everything-1908.iso \
--extra-args='ks=file:centos7_kickstart.cfg' \
--initrd-inject=centos7_kickstart.cfg \
--noreboot
<<COMMENTS
kickstart and virt-install should take care of this for you:
systemctl enable fstrim.timer
systemctl start fstrim.timer
systemctl enable [email protected]
systemctl start [email protected]
COMMENTS