I am trying to install CentOS 7 on my VM using Kickstart Configuration file ks.cfg.

All I need is to install CentOS 7 on my VM without using network (offline).

I have created a ks.cfg file with help of online links (see below) but its not working for me.

Following is my ks.cfg script which I am using for the CentOS 7 offline installation:

auth --enableshadow --passalgo=sha512     
firstboot --enable
ignoredisk --only-use=vda  
keyboard --vckeymap=us --xlayouts='us'  
lang en_US.UTF-8  
network  --bootproto=static --device=eth0 --gateway=172.30.#.# --ip=172.30.#.# --nameserver= --netmask= --ipv6=auto --activate  
network  --hostname=localhost.localdomain
rootpw --iscrypted  "encrypted password"
services --enabled="chronyd"  
timezone America/New_York --isUtc  
user --groups=wheel --name=my_name --password="encrypted_password" --iscrypted --gecos="password"    
bootloader --append=" crashkernel=auto" --location=mbr --boot-drive=vda
autopart --type=lvm  
clearpart --none --initlabel  


Problem I am facing is when my machine is in boot menu it is not installing CentOS 7 automatically and I have to write linux ks=cdrom:/ks.cfg in the grub menu. after entering this its shows

insert a CDROM containing ks.cfg

and then installation is starting but gets stuck in the Centos Installation loading window.
Nothing is happening after this step.

I am using a Kickstart script for automated installation of Centos7, so there shouldn't be any manual configuration to be done for this automated installation; e.g to write anything in boot menu to start the installation.

I need help to modify my script for the installation of CentOS without network.

Links I have used to initiate my ks.cfg file:

2 Answers 2


I know that this question is two months old, but I stumbled upon it while researching kickstart and might be able to help.

When you give the argument linux ks=cdrom:/ks.cfg you are telling grub to load linux with a kickstart file located on the root of the cdrom named ks.cfg. If you're using the standard install .iso and you haven't remastered the .iso to include the file, it will fail.

One possible solution would be to copy your ks.cfg to a removable usb thumb drive, and boot your VM with the thumb drive attached to the VM, not the host. Once you get to your grub screen issue linux ks=hd:sdb1:/ks.cfg. This will tell your VM to boot from the Centos .iso BUT load your kickstart file from the root of your USB drive (/dev/sdb in this case).

Answer was adapted from https://linuxhint.com/install-centos-7-kickstart/ by Shahriar Shovan


You seem to be on the right lines here and it's a while since I've done this stuff but I'd suggest building a custom CentOS Boot DVD Image. These are the instructions for CentOS 7: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/installation_guide/sect-making-usb-media

the ks.cfg has to live in the root of the cd/usb image and then it "should just work".

  • Thankyou for your response! i have followed the instructions & now i am facing the issue in boot grub "starting dracut initqueue hook.." installation is hanged on this point. Tried different online solutions to resolve this issue but it still exists. How can i resolve this issue? Sep 24, 2018 at 9:57
  • dracut creates the initramfs used early in boot so I'm wondering if you boot from a centos live dvd image does that work?
    – gm3dmo
    Sep 25, 2018 at 6:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.