Chapitre 4. Starting virtual machines
To start a virtual machine (VM) in RHEL 9, you can use the command line interface or the web console GUI.
Conditions préalables
- Before a VM can be started, it must be created and, ideally, also installed with an OS. For instruction to do so, see Creating virtual machines.
4.1. Starting a virtual machine using the command-line interface
You can use the command line interface (CLI) to start a shut-down virtual machine (VM) or restore a saved VM. Using the CLI, you can start both local and remote VMs.
Conditions préalables
- An inactive VM that is already defined.
- The name of the VM.
For remote VMs:
- The IP address of the host where the VM is located.
- Root access privileges to the host.
Procédure
For a local VM, use the
virsh start
utility.For example, the following command starts the demo-guest1 VM.
# virsh start demo-guest1 Domain 'demo-guest1' started
For a VM located on a remote host, use the
virsh start
utility along with the QEMU+SSH connection to the host.For example, the following command starts the demo-guest1 VM on the 192.168.123.123 host.
# virsh -c qemu+ssh://root@192.168.123.123/system start demo-guest1 root@192.168.123.123's password: Domain 'demo-guest1' started
Ressources supplémentaires
-
The
virsh start --help
command - Setting up easy access to remote virtualization hosts
- Starting virtual machines automatically when the host starts