Forrest logo
back to the virt-install tool

virt-install:tldr:bb2e1

virt-install: Create a virtual machine with 16 GiB RAM, 250 GiB storage, 8 cores with hyperthreading, a specific CPU topology, and a CPU model that shares most features with the host CPU.
$ virt-install --name ${vm_name} --cpu ${host-model},topology.sockets=${1},topology.cores=${4},topology.threads=${2} --memory ${16384} --disk path=${path-to-image-qcow2},size=${250} --cdrom ${path-to-debian-iso}
try on your machine

This command is used to create and install a virtual machine using the "virt-install" tool.

Here is a breakdown of the command and its options:

  • virt-install: This is the actual command to create and install a virtual machine.

  • --name ${vm_name}: Sets the name of the virtual machine. ${vm_name} is a placeholder that should be replaced with the desired name.

  • --cpu ${host-model},topology.sockets=${1},topology.cores=${4},topology.threads=${2}: Defines the CPU configuration for the virtual machine. ${host-model} represents the CPU model of the host machine. ${1}, ${4}, and ${2} are placeholders that should be replaced with the desired number of sockets, cores, and threads respectively.

  • --memory ${16384}: Sets the amount of memory (RAM) allocated to the virtual machine. ${16384} is a placeholder that should be replaced with the desired amount in megabytes.

  • --disk path=${path-to-image-qcow2},size=${250}: Specifies the disk configuration for the virtual machine. ${path-to-image-qcow2} should be replaced with the desired path to the image file in QCOW2 format. ${250} is a placeholder that should be replaced with the desired disk size in gigabytes.

  • --cdrom ${path-to-debian-iso}: Sets the path to the ISO image file that will be used to install the operating system. ${path-to-debian-iso} should be replaced with the actual path to the ISO file.

Overall, this command creates a virtual machine with the specified name, CPU configuration, memory allocation, disk configuration, and starts the installation process using the provided ISO image file.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the virt-install tool