GNS3 / gns3-server

GNS3 server
GNU General Public License v3.0
791 stars 261 forks source link

Default CPU type for Qemu VMs #1644

Open grossmj opened 5 years ago

grossmj commented 5 years ago

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

zapotah commented 4 years ago

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 commented 4 years ago

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.

grossmj commented 4 years ago

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

grossmj commented 3 years ago

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.

evilhamsterman commented 4 months ago

Any update on this? Also why only add -cpu host if the GNS3 server is in a VM, the benefits would be helpful in both VM version and not.