S S

Linux support on-site, on-line and in the cloud.

0793 572 8612

Systems Administration Notes.

Installing and configuring Windows on KVM
1. Redefining the storage pool directory.
2. Deleting a VM


Installing and configuring Windows on KVM

1. Redefining the storage pool directory.

The installation assigns a default "pool" directory "/var/lib/libvirt/images/" under which virtual hard disks are created. If you didn’t know this from the outset then like me you will find that the the underlying filesystem is far to small for the job and probably a poor choice for other reasons too. Changing the default doesn’t seem to be well documented.

After many unhappy hours looking for a solution I found this on "ask.fedoraproject.org".

virsh
pool-destroy default
pool-undefine default
pool-define-as --name default -type dir --target </full/path/to/new/location>
pool-autostart default
pool-build default
pool-start default

Da dah! Restart "virt-manager" or whatever and creating a new VM starts to look possible.

2. Deleting a VM

While struggling to get a successful Windows VM I found a repeated need to scrap efforts so far and start again. Now I’m damned if I can find a way of doing this in the "virt-manager" GUI. Happily I eventually found this from Satimis 6 years ago on "howtoforge.com".

$ virsh
virsh # list --all
 Id    Name                           State
----------------------------------------------------
 -     windows                        shut off

virsh # undefine windows
Domain windows has been undefined

virsh # ^D

The virtual disk for the VM can then be deleted as usual with the "rm" command.

Clifford W Fulford
23 Sept 2015.



The layout and associated style sheets for this page are taken from the World Wide Web Consortium and used here under the W3C software licence.