gns3-server icon indicating copy to clipboard operation
gns3-server copied to clipboard

Default CPU type for Qemu VMs

Open grossmj opened this issue 6 years ago • 5 comments

It seems we are getting more and more of the following message or similar when users run Qemu VMs:

qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.80000001H:ECX.svm

Still need to research about it but setting a CPU model by default could solve this.

Libvirt uses qemu32 or qemu64:

https://www.berrange.com/posts/2018/06/29/cpu-model-configuration-for-qemu-kvm-on-x86-hosts/

QEMU Virtual CPU version 2.5+ (32 & 64 bit variants). qemu64 is used for x86_64 guests and qemu32 is used for i686 guests, when no -cpu argument is given to QEMU, or no is provided in libvirt XML.

Proxmox VE uses kvm64 by default:

https://pve.proxmox.com/wiki/Qemu/KVM_Virtual_Machines

Qemu has also its own CPU type kvm64, that Proxmox VE uses by defaults. kvm64 is a Pentium 4 look a like CPU type, which has a reduced CPU flags set, but is guaranteed to work everywhere.

However, it sounds like Qemu already has the default CPU set to qemu64

https://www.linux-kvm.org/page/Tuning_KVM

grossmj avatar Aug 28 '19 09:08 grossmj

There are multiple benefits of having a newer cpu type or just plain "host" type cpu passed through to certain types of virtual machines (ie. nested virtualization inside a gns3 qemu machine to emulate a hypervisor inside the topology).

Is there currently a way to pass a qemu parameter to the machines? This would also be useful for me for developing qemu unikernel appliances inside gns3 and that requires extensive qemu tuning and control.

zapotah avatar Apr 28 '20 19:04 zapotah

To answer myself and anyone looking on the intertubes, since this is practically wholly undocumented, the advanced tab additional settings is in fact parameters passed to qemu and gns3 does not pass that many parameters through to qemu to begin with. Other tickets could be referenced here to allow for more granular control of ie. graphics options and disk controller types in qemu. Most vendors already have virtual images runnable in qemu so having more control here is something that would be required going forward.

zapotah avatar Apr 30 '20 10:04 zapotah

Sorry I missed your question. Indeed you can use the "additional settings" to pass any parameters you want to Qemu.

grossmj avatar Apr 30 '20 10:04 grossmj

https://medium.com/coccoc-engineering-blog/kvm-guests-cpu-flags-5d3ac9525421 explains everything quite nicely. The "host" type CPU is the one recommended and would give maximum performances. I am tempted to add the -cpu host by default but only if the GNS3 server runs inside a virtual machine.

grossmj avatar May 16 '21 23:05 grossmj