1

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     
cdrom  
graphical  
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=8.8.8.8 --netmask=255.255.255.0 --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  

%packages  
@^minimal  
@core  
chrony  
kexec-tools  
%end  

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:

Gerald Schneider
  • 23,274
  • 8
  • 57
  • 89
Baqir kazmi
  • 13
  • 1
  • 5

2 Answers2

1

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

joel
  • 26
  • 2
0

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".

gm3dmo
  • 10,057
  • 1
  • 42
  • 36
  • 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? – Baqir kazmi Sep 24 '18 at 09: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 '18 at 06:38