Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm installing Ubuntu in a Virtual Box; my host OS is Windows 7, and I have 6GB of RAM on my system. One tutorial on setting up Ubuntu on a virtual machine (this one, on step 14: http://www.aztcs.org/meeting_notes/linuxsig/ubuntuintovirtualbox/ubuntuintovirtualbox.htm) says to set the RAM at 45% of the total RAM I have available, which would be about 2.7GB in my case. Is this correct?

Also, when I allocate RAM to the vm, is that RAM now reserved exclusively for the vm, and if yes, is it only reserved for the vm when the vm is running a guest OS or does it create a permanent division in the RAM, i.e., when I stop running and quit from the virtual machine, will my host OS (Windows 7) regain all 6GB of RAM as its available RAM?

share|improve this question

2 Answers 2

up vote 5 down vote accepted

You should give virtual machine however much RAM you need for the tasks you're using it to perform.

If you're running a single virtual machine, the suggestion you read is OK (provided that your host machine has enough RAM, which it does). However, depending on what you plan to do with your Ubuntu system, it probably doesn't need 2.7 GB of RAM. I give most of my virtual machines, including Ubuntu virtual machines, 1 GB of RAM, even when I have enough physical RAM available that I could allocate more.

If you plan to run multiple virtual machines, then giving a virtual machine 2.7 GB of RAM out of a total of 6 GB is probably too much. It would not work out well to have two VM's with that amount of RAM!

Finally, your virtual machine will typically reserve all the RAM you give it, whenever it is running. When the virtual machine is turned off, suspended, hibernated, or otherwise not running, this RAM will not be in use. For example, I have about 10 virtual machines, most of which have 1 GB of RAM, on a host machine with 4 GB of RAM. This is not a problem; it just means I can only run up to a few of them at a time.

share|improve this answer
    
Thanks Eliah; I think I'll allocate a little less than 2.7GB- maybe 1.7GB. –  Jay Jun 12 '12 at 23:12

There is not a fixed rule on the amount of RAM we assign for exclusive use by a virtual machine. However there are two points we need to take care of:

Virtual Box Manager will warn you whenever you assign more than 50% of RAM to a virtual machine, but in case we have plenty of RAM this is a rule of thumb recommendation only. Of course we can assign more than 50% of the system RAM to our VM as long as we have enough RAM left for our host OS.

Note that we don't have to worry too much about the amount of RAM we assign to a newly created machine as we can easily change this at any time later.

share|improve this answer

Your Answer

 
discard

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.