Run virtual machines at near-native speeds and manage them at ease
cdromimg
.
https://getfedora.org
16GB
and of format RAW
in a reference directory datadrct
by executing the following command.
$ qemu-img create -f raw datadrct/fedovirt.raw 16G
$ virt-install \
--virt-type kvm \
--name fedoraXX-mstr \
--memory 4096 \
--vcpus 8 \
--cdrom cdromimg/Fedora-Workstation-Live-x86_64-xx-y.z.iso \
--disk datadrct/fedoraXX/fedoraXX-mstr.raw \
--graphics vnc,listen=0.0.0.0,port=5920 \
--network default,mac=00:00:00:00:03:00 \
--noautoconsole \
OR
Invoke virt-install session for installing Fedora Workstation using UEFI on the virtual disk image by executing the following command on the host.
$ virt-install \
--virt-type kvm \
--name fedoraXX-mstr \
--memory 4096 \
--vcpus 8 \
--cdrom cdromimg/Fedora-Workstation-Live-x86_64-xx-y.z.iso \
--disk datadrct/fedoraXX/fedoraXX-mstr.raw \
--graphics vnc,listen=0.0.0.0,port=5920 \
--network default,mac=00:00:00:00:03:00 \
--noautoconsole \
--boot uefi
The following is an example output for the above command.
Starting install...
Domain is still running. Installation may be in progress.
You can reconnect to the console to complete the installation process.
--all
flag lists all domains - even if they are running or not.
$ virsh list --all
Id Name State
-------------------------------
1 fedoraXX-mstr running
0.0.0.0:5920
from the host device (or <ip-address-of-host-device>:5920
if accessed from another device in the same network) to continue installing.Try Fedora
or Install to Hard Drive
.$ virsh list --all
Id Name State
-------------------------------
1 fedoraXX-mstr shut off
$ virsh start fedoraXX-mstr
Domain 'fedoraXX-mstr' started
Switch to the VNC Viewer window and type in 0.0.0.0:5920
from the host device (or <ip-address-of-host-device>:5920
if accessed from another device in the same network) to continue using the domain.
$ virsh shutdown fedoraXX-mstr
Domain 'fedoraXX-mstr' is being shutdown
$ virsh destroy fedoraXX-mstr
Domain 'fedora34-mstr' destroyed
$ virsh undefine fedoraXX-mstr
Domain 'fedora34-mstr' has been undefined
Note that this would not remove the virtual disk image, the installation sources and other related elements for the domain and they must be removed manually.
$ virsh edit fedoraXX-mstr
This would open up the domain’s XML configuration specification in the default text editor of the host. Follow https://libvirt.org/formatdomain.html to learn more about it.
Authors: Akashdeep Dhar, Jarek Prokop, Nick Dirschel