ruzickap / packer-templates

Scripts and Templates used for generating Vagrant images
Apache License 2.0
443 stars 113 forks source link

WindowsServer libvirt images slow #423

Closed achelos-fde closed 1 year ago

achelos-fde commented 2 years ago

I am using the WindowsServer-libvirt images (tried 2016, 2019 and 2022) for setting up a VM using Vagrant. In the VM I am compiling a quite big C project. The compilation on the VM takes about 3.5 hours.

If I set up a Virtualbox-VM using the corresponding Virtualbox image the compilation takes only less than 1.5 hours on identical hardware.

So, if I don't miss anything the only difference between the images is the virtualization (Virtualbox <-> libvirt).

Can anybody advise me how to speed up the libvirt VM ?

ruzickap commented 2 years ago

It is hard to say... I tried to build the automation which creates the images with "best practices" related to VM performance.

I'm using VirtIO everywhere it is possible, Qemu Guest Agent and maybe few more.

Anyway the automation was developed several years ago and what was great at that time may not be actual in these days...

If somebody can suggest better approach I can look at it and implement it...

The comments above are related to the box image itself.

You also need to properly configure your libvirt/qemu to use as much as possible from your hardware. I'm pretty sure there are many guides how to do it...

achelos-fde commented 2 years ago

Thanks @ruzickap , actually I'm also running Linux-VMs on that hardware (with libvirt) and I also tried your Linux images (from this repo). The same project that takes 3.5 hours to build on Windows-libvirt takes around 0.5 hours on Linux-libvirt. So, there might be some issues related to Windows, but there are definitely problems with libvirt in connection with the Windows image. Do you have any ideas what might be worth investigating?

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.