virt-install examples

Create VM using a local ISO – No kickstart file

virt-install \
--name=centos7test \ 
--ram=1024 \
--disk path=/var/lib/libvirt/images/centos7.qcow2,size=8 \
--vcpus=1 \
--os-type=linux \
--os-variant=rhl7 \
--network bridge=virbr0 \
--console pty,target_type=serial \
--nographics \
--location /root/isos/CentOS-7-x86_64-Everything-1708.iso \
--extra-args=console=ttyS0; 

Create VM using a kickstart file via HTTPD

 virt-install \
--name=centos7test \
--ram=1024 \ 
--disk path=/var/lib/libvirt/images/centos7.qcow2,size=8 \
--vcpus=1 \
--os-type=linux \
--os-variant=rhl7 \
--network bridge=virbr0 \ 
--console pty,target_type=serial  \
--nographics \
--location /root/isos/CentOS-7-x86_64-Everything-1708.iso \
--extra-args="console=ttyS0, ks=http://192.168.0.2/test.cfg"; 

Important note for the Kistarst file via HTTPD
Provided you speficy the http location of the kickstart file in the virt-install command, in the kickstart file as source installation you should use the following entry.

#Install source
cdrom
Share Button