- [Instructor] For this exercise,
we'll be doing a non-interactive
automated install of CentOS 7
into a guest VM using our FTP repository
in a remote kickstart file
from the exercisefiles.zip archive we extracted.
Because we're using the kickstart file from the FTP server
we need to copy it there first.
Go to where you extracted the exercise files zip archive,
in my case this is my user's home directory,
so I'm going to type in cd ~ and hit enter
and then type in ls.
You should see the Ex_Files_RHCE_CertPrep_Routing directory.
Cd into it by typing in cd space
capital e tab, capital e tab, capital c tab.
This took me into /home/grant/
Ex_Files_RHCE_CertPrep_Routing
/Exercise Files/Ch 02 and then type in ls
and you should see the kickstart files.
We're going to copy the centos-ftp-ks.cfg file
to our FTP repository.
Type in sudo cp centos7-ks.cfg
/var/ftp/pub/el7 and hit enter.
The complete command line for installing CentOS 7
via kickstart file from an FTP repository
is quite long so let's discuss it.
We have to elevate privileges to create a VM,
so we prefix the line with sudo.
The second highlighted section
sets the name of the VM to centos7-ftp-ks
to remind us that we installed
to the kickstart file from our FTP repository.
This is the amount of RAM for our VM guest
and this is the disk image you will install into.
Virt-install creates this for us.
The --location option is the location of the package files,
make sure the path you use matches
where you created the FTP server.
In my case, the path would be
- -location="ftp://192.168.122.1/pub/el7".
The --nographics option specifies a non-graphical install.
These are the extra arguments that will get passed
to the Linux kernel during install.
The ks= section tells the Linux guest kernel
to use the kickstart file from the FTP server.
The ip= section tells the guest
to get its IP address from a DHCP server.
The console option set up ways for us to see the output.
The latter console line configures a serial console
using the /dev/ttys0 device at 115,200 bits per second,
no parity and eight databits.
The last argument is the os variant
which allows installation time optimization by KVM.
You can use the os-query info command
to get a list of possible os variants.
Now, let's type it all in.
Type in clear and then type in the entire line.
Considering the length of this command line,
there's a high chance of having a typo or two.
Just fix the typos, delete the VM
and run it again until the install is successful.
If you have to run the command line more than once,
virt-install will probably complain
because the VM or disk image may already exist.
In this case you may have to shut down the guest VM
and delete it before running the install again.
If so, just flip over to the
Virtual Machine Manager GUI window and do it there.
Using Virtual Machine Manager you can
right click on the VM and force it to shut down.
Once it's shut down you can delete the guest VM
before trying to install again from the command line.
Now hit enter to start the install.
The install should complete in 15 to 45 minutes
depending on your hardware and your network speed.
Using movie magic we will speed up
the installation process in the video,
so you'll want to pause the video
until your installation catches up.
Once the install is done, the VM will reboot.