virt-install
is a command-line tool used to create virtual machines in KVM. Here are the steps to install FreeBSD or CentOS as a guest operating system using virt-install
:
- Open a terminal window on your KVM host machine.
- Type the following command to start the installation process:
virt-install \
--name guest_name \
--memory 2048 \
--vcpus 2 \
--disk size=20 \
--location ftp://ftp.freebsd.org/pub/FreeBSD/releases/amd64/amd64/11.1-RELEASE \
--os-type=freebsd \
--os-variant=freebsd11.1 \
--graphics vnc \
--console pty,target_type=serial
Replace
guest_name
with the name you want to give the virtual machine.In this example, we are installing FreeBSD 11.1 as a guest operating system. If you want to install CentOS, replace the
--location
parameter with the URL of a CentOS ISO file. - Press Enter to execute the command. The installation process will start, and you will see output similar to the following:
Starting install...
Retrieving file .treeinfo...
Retrieving file MANIFEST...
Retrieving file base.txz...
This step will take some time as it downloads the required packages.
- Follow the prompts to complete the installation process. When prompted, select the disk to install the operating system to, and configure any other settings as necessary.
- Once the installation is complete, you can connect to the virtual machine using VNC. To do this, type the following command:
virsh console guest_name
Replace
guest_name
with the name of the virtual machine that you created.This will open a console window for the virtual machine, allowing you to access its command line interface.
That’s it! You have successfully installed FreeBSD or CentOS as a guest operating system using virt-install
. You can use the same basic steps to install other operating systems as well. (sullivansusa.net)