Forrest logo
back to the virt-install tool

virt-install:tldr:aeb8e

virt-install: Create a virtual machine with 1 GB RAM and 12 GB storage and start a Debian installation.
$ virt-install --name ${vm_name} --memory ${1024} --disk path=${path-to-image-qcow2},size=${12} --cdrom ${path-to-debian-iso}
try on your machine

This command is used to create and install a virtual machine using the "virt-install" command-line tool. Let's break down the command and explain each part:

  1. virt-install: This is the command-line tool used to create and install virtual machines.

  2. --name ${vm_name}: This specifies the name of the virtual machine. The ${vm_name} is a placeholder that should be replaced with the desired name of the virtual machine.

  3. --memory ${1024}: This sets the amount of memory (RAM) allocated to the virtual machine. The ${1024} is a placeholder that should be replaced with the desired amount of memory in megabytes.

  4. --disk path=${path-to-image-qcow2},size=${12}: This defines the virtual machine's disk configuration. The path= specifies the path to the qcow2 image file, which serves as the virtual machine's disk. The ${path-to-image-qcow2} is a placeholder that should be replaced with the actual path to the desired qcow2 image file. The size= parameter specifies the size of the disk in gigabytes and ${12} is a placeholder that should be replaced with the desired size.

  5. --cdrom ${path-to-debian-iso}: This indicates that the virtual machine should boot from a CD/DVD-ROM image. The ${path-to-debian-iso} is a placeholder that should be replaced with the actual path to the Debian ISO file.

By running this command with proper values filled in for the placeholders, a virtual machine will be created with the specified name, memory, disk configuration, and boot from the specified ISO 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