# Vagrant + KVM/libvirt - how to limit RAM?

**URL:** <https://discuss.hashicorp.com/t/vagrant-kvm-libvirt-how-to-limit-ram/67362>\
**Category:** Vagrant\
**Created:** [May 27, 2024, 10:48am UTC](https://discuss.hashicorp.com/t/vagrant-kvm-libvirt-how-to-limit-ram/67362 "2024-05-27T10:48:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![info2](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/info2/32/31439_2.png) [@info2](https://discuss.hashicorp.com/u/info2)\
**Post date:** [May 27, 2024, 10:48am UTC](https://discuss.hashicorp.com/t/vagrant-kvm-libvirt-how-to-limit-ram/67362/1 "2024-05-27T10:48:14Z")

</div>

Hi,

I’m using Vagrant with KVM/libvirt as provider on Rocky Linux 8. Here’s a Vagrantfile I’m currently using for an Ansible test lab, and it’s working as expected:

```auto
NETWORK_PREFIX = "192.168.150"

Vagrant.configure("2") do |config|

 config.vm.define "debian" do |debian|
   debian.vm.box = "generic/debian11"
   debian.vm.hostname = "debian"
   debian.vm.network :private_network, ip: "#{NETWORK_PREFIX}.10"
 end

 config.vm.define "rocky" do |rocky|
   rocky.vm.box = "generic/rocky8"
   rocky.vm.hostname = "rocky"
   rocky.vm.network :private_network, ip: "#{NETWORK_PREFIX}.20"
 end

 config.vm.define "suse" do |suse|
   suse.vm.box = "generic/opensuse15"
   suse.vm.hostname = "suse"
   suse.vm.network :private_network, ip: "#{NETWORK_PREFIX}.30"
 end

 config.vm.define "ubuntu" do |ubuntu|
   ubuntu.vm.box = "generic/ubuntu2004"
   ubuntu.vm.hostname = "ubuntu"
   ubuntu.vm.network :private_network, ip: "#{NETWORK_PREFIX}.40"
 end

 config.vm.define "ansible" do |ansible|
   ansible.vm.box = "generic/debian11"
   ansible.vm.hostname = "ansible"
   ansible.vm.network :private_network, ip: "#{NETWORK_PREFIX}.100"
 end

end

```

The default configuration allocates 2 GB RAM to every single VM.

Is there a way to limit this to 1 GB ? I knew how to do this with VirtualBox provider, but I can’t seem to do it with KVM/libvirt.

Cheers from South France,

Niki
