Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

How can I Change amount of Ram and CPU cores for a virtual machine in KVM that is already created? Thanks

share|improve this question
IN run-time or with reboot? That would be really good to know BTW. –  Andrew Smith Jun 29 '12 at 22:11
+1 - Also would be worth clarifying whether this would be in virt-manager (as referenced in previous question) or from command line. –  rnxrx Jun 30 '12 at 1:44
Thanks, I think It's easier to change this in reboot and yes I created VMs in virt-manager but command-line is ok. –  Zim3r Jun 30 '12 at 4:18

3 Answers 3

up vote 4 down vote accepted

You can edit its XML from command-line with:

virsh name_vhost

Then, you only have to search the <memory> tag and modify it

Keep in mind that the memory allocation is in kilobytes, so to allocate 512MB of memory, use 512 * 1024, or 524288.

share|improve this answer
Really Thanks, Can I increase CPU cores with this method ? –  Zim3r Jun 30 '12 at 10:12
You should check this out semanticlab.net/index.php/… ;) –  blacksoul Jun 30 '12 at 10:15
Is there any other way ? besides what is explaing on semanticlab.net –  Zim3r Jun 30 '12 at 11:09

You can edit the VM settings in virt-manager or in cli by changing the XML in virsh edit VMNAME

share|improve this answer
Thanks for your help. –  Zim3r Jul 1 '12 at 13:44

To increase the maximum amount of memory that can be allocated to the VM you have to increase the maximum memory limit, power off the VM, increase the memory allocated, the start the VM. There's a step-by-step guide here:


To get more VCPUs you have to edit the virsh XML file and restart the VM. There's a step-by-step guide to do this here:


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.