KS-LIBVIRT(1)

πŸ“¦
version 0 Β· 5 versions
, in fedora 43, fedora 44

πŸ’– ks-libvirt β€” the manual, but make it bestie πŸ’–

okay so. you know how you have a Fedora/CentOS/RHEL kickstart file just sitting there, being all text and potential? ks-libvirt takes that file and turns it into an actual VM. no cap. it's giving "automation main character energy" and honestly? we're obsessed. πŸ’…

this is a User Contributed Perl Documentation page, and yes bestie, it's for ks-libvirt(1). let's get into it. ✨


🌸 NAME 🌸

ks-libvirt β€” Take a Fedora/CentOS/RHEL kickstart file and make a VM πŸ¦‹


✨ SYNOPSIS ✨

ks-libvirt [options] kickstart-file

At the end of install, if the VM is not shut down with --off and the guest agent is not excluded with --noaddga, the script waits until the VM is up and an IPv4 address is configured; it will clean any previous SSH host keys for that IP and then print the IP, so if you have an SSH key defined, you can do:

ssh -l root $(ks-libvirt kickstart-file)
the way that it just hands you the IP and you ssh straight in… iconic. periodt. πŸ‘‘

πŸ’… OPTIONS πŸ’…

  • --addga | -a β€” add qemu-guest-agent to %packages; default is to do this, use --noaddga to disable. without the agent, the hypervisor cannot get the IP of the VM (or do other VM management). so like, lowkey important 🫢
  • --anaconda | -A arguments` β€” extra anaconda boot arguments
  • *--arch *architecture** β€” use an alternate CPU architecture (this usually will require additional qemu-system-<arch>` to be installed); this probably doesn't work with secureboot ⚠️
  • *--config | -C *config** β€” config file for defaults; default is $HOME/.virtinst.cf`
  • *--cpu | -c *count** β€” VM CPU cores; default is 1`
  • *--disk | -d *GB** β€” VM disk size in gigabytes; default is 6`. can be specified more than once to create additional disks πŸ“
  • --dns DNS-IPs` β€” set the DNS server(s) (can be specified more than once for multiple servers); default: copy host DNS config when IPv4 address is set
  • --dumpks | -D β€” generate a modified kickstart file and dump to standard out (don't build VM)
  • --graphics β€” add a graphics console; default is to do this, use --nographics to disable
  • --gw IPv4-gateway` β€” set the IPv4 gateway
  • --hostname | -h FQDN` β€” set the hostname; default is to not set unless network is set, then use the VM name
  • *--ip *IPv4-address/mask** β€” set the IPv4 address and netmask (in bits, e.g. 10.0.0.1/24`); default is to try DHCP (if network needed)
  • --iso | -i ISO` β€” ISO to boot from; default is pulled from KS or to use URL instead. handles a local ISO file (will be uploaded to same pool as VM storage if needed), or pool/volume for an ISO already in a storage pool. πŸŽ€
  • *--libvirt | -l *URL** β€” connection to libvirt; default is $VIRTSH_DEFAULT_CONNECT_UIDorqemu:///system`
  • *--machine *machine** β€” use an alternate machine type rather than the default (e.g. q35` for x86_64)
  • *--mapfile | -m *file** β€” URL map file to use different source repos. the format of the file is one entry per line with a pair of URLs separated by a space. the first URL is the original (which can be a mirrorlist or metalink) followed by a target URL to replace it with (mirrorlist/metalink are turned into direct url entries). the default is $HOME/.virtinst-map`
  • *--name | -n *name** β€” VM name; default is KS file name minus any leading "ks-"`
  • *--net | -N *bridge -or- net spec** β€” network interface, can be specified more than once. if argument is a bridge interface, attach a VM NIC to the bridge. otherwise can be a full network description to virt-install`, like:
--net direct,source=enp3s0

default is bridge interface with default route or none if that's not a bridge. set to "none" to disable default. use "DEFAULT" to get default bridge when creating more than one NIC. 🧚

  • --off | -O β€” leave the VM off at the end of install
  • --pool | -p pool` β€” storage pool name; use pool default by default
  • --os | -o OS` β€” OS name, used to set VM hardware config; default is autodetect
  • --quiet | -q β€” be very quiet - only show errors and IP at end 🀫
  • *--ram | -r *MB** β€” VM RAM size in megabytes; default is 2048` unless specified in the KS
  • --screen | -s β€” open the VM console screen during install
  • --secureboot | -B β€” enable Secure Boot (implies UEFI).
  • --serial | -S β€” add a serial console; default is to do this, use --noserial to disable
  • --ssh β€” add found SSH key(s) to the installed system; default is to do this, use --nossh to disable πŸ”‘
  • --sshscan β€” add VM's SSH host keys after boot; default is to do this, use --nosshscan to disable
  • --tpm β€” add TPM device
  • --uefi | -u β€” use UEFI boot instead of BIOS
  • --vdelete β€” delete an existing VM with the same name before creating new (NOTE: will not ask for confirmation!) πŸ’€
  • --verbose | -v β€” be more verbose
  • *--virtinst | -V *arguments** β€” additional virt-install` arguments (can be used more than once)
  • --vsock β€” enable vsock for SSH access; default is to do this, use --novsock to disable
bestie. --vdelete does NOT ask first. it will just yeet that VM. be so careful. 😭

πŸ¦‹ SPECIAL KICKSTART FILE LINES πŸ¦‹

the KS file is parsed for lines that look like #<tag>:<value>. #include pulls in additional files, while the other options set default values (that can still be overridden on the command line).

supported tags:

  • #include:file β€” include another file - this can be a full path or relative to the kickstart file itself. HTTP/HTTPS URLs are also supported. includes can appear more than once, including in included files. 🌈
  • #CPU:cores β€” number of CPU cores
  • #RAM:MB β€” RAM size in megabytes
  • #DISK:GB β€” disk size in gigabytes
  • #ISO:[pool/]file β€” ISO file/volume to use for install
  • #OS:OS string β€” operating system (only needed if not autodetected)
  • #(NO)SSH:1 β€” add/don't add SSH keys
  • #(NO)TPM:1 β€” add/don't add TPM device
  • #(NO)UEFI:1 β€” use/don't use UEFI boot
  • #ARCH:architecture β€” CPU architecture (for emulated system)
  • #MACHINE:type β€” machine type (for emulated system)

πŸ’œ AUTHOR πŸ’œ

Written by Chris Adams πŸ‘‘


Copyright 2022 Chris Adams. License: GPLv3


and that's the whole page, bestie πŸ’– this was perl v5.42.3, dated 2026-08-14. go build some VMs, you absolute icon. πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from