Here's the easy way
Unless you have some specific why you'd install a GuestOS using virt-install, here's the 'easy' way to do it without virt-install.
I have a working VM with Windows 7 installed. Here's how I created it.
Step 1: Create the virtual disk image
qemu-img create -f qcow2 vdisk.img 100g
This creates a virtual disk in the qcow2 format. Setting the partition size to 100g (gigabytes) will not allocate 100gb of physical hard disk space. The virtual partition will only take as much space as the data it contains. The 100g just makes it so you'll (hopefully) never need to increase the size. Increasing a qcow2 image's default size is still a pain in the a** to do.
Step 2: Install the OS
If you're using an actual physical cd-rom to load the OS, use the following command.
sudo kvm -m 750 -cdrom /dev/sr0 -boot d vdisk.img
If you're using a disk image to load the OS, use this command.
sudo kvm -m 750 -cd-rom /path/to/image/image.iso -boot d vdisk.img
Here's the breakdown of the commands:
- kvm - calls the kernel virtual machine (obvious)
- -m 750 - allocates 750mb of memory for the virtual machine
- -cd-rom sets up the cd-rom. For a physical disk use same disk as your HostOS. For a image, provide a path to the image file.
- -boot d boots the virtual machine from the cd-rom
I set the memory footprint for the initial load to 750 to be conservative so I can be sure that the install finishes without running out of memory. For subsequent loads I usually set it to 512.
Note: AFIAK, the kvm command only works in more recent versions of Debian/Ubuntu or their derivatives. If it doesn't work the equivalent (and more common) command is qemu-system-x86_64 or qemu-kvm for 32 bit.
After you've gone through the whole install process the VM should reboot into a working OS.
To load the VM again just launch this command:
kvm -m 512 vdisk.img
With whatever command line switches you need to mount additional physical disks, hardware, etc. To find info on command line switches check kvm --help.
If you don't understand the difference between 'paravirtualization' and 'native virtualization' Matthias' has already made a great explanation of the differences.
For a more 'in depth' explanation of this process read this article.
The QEMU Guest Agent (qemu-ga) and the SPICE agent are both needed for different purposes.
"QEMU Guest Agent" is one specific component of the 'virtio-win' set of drivers offered by RedHat. For a list of all components, check https://docs.fedoraproject.org/quick-docs/en-US/creating-windows-virtual-machines-using-virtio-drivers.html#virtio-win-iso-contents. These components are not installed all at once as part of a package; instead, the user is expected to manually install what is needed for his particular case.
This is different from the SPICE agent: according to the download page you linked (https://www.spice-space.org/download.html) and also the source repository (https://gitlab.com/spice/spice-nsis), this one includes the qxl video driver and the vioserial (VirtIO serial driver). The latter is a dependency, as the agent communicates with the host through a VirtIO serial channel. The former may be just convenience, or may be needed for automatic resolution switching - I don't know for sure.
So, even though the 'SPICE guest tools' installer for Windows includes some of the virtualization drivers for Windows offered by RedHat, the qemu guest agent itself is not part of the package, and is also not related.
Once installed, it runs as a Windows service (you can find it in services.msc
) and should start automatically. It enables better integration between guest and the hypervisor through a virtio-serial channel (like SPICE) but for management purposes.
To understand how, check these references from the Red Hat Virtualization Deployment and Administration Guide:
(I used to think that qemu-ga was a requirement for the balloon driver to work; looks like I was wrong, though).
Best Answer
Add the '-vga std' flag to the command line
Basically, the virtual machine loads its own virtual driver. Hardware virtualization is necessary because virtual disk images are often copied to many different systems with diverse architectures. By abstracting the hardware the vm images are capable of doing this.
By using the '-vga std' flag you make the GuestOS load a standard VGA device that should be able to support resolution equal-to-or-greater than your physical card can handle.
For more info check out this article.
Note: If you're using an older version of kvm/qemu the you might need to use the '-std-vga' flag instead.
If you aren't able to reach resolutions greater than 1600x1200 note that there are still some issues with this option.