58

I have just installed Ubuntu 14.04 on VirtualBox, including the guest additions.

However, the display is really slow. Looking at the display settings I can see that the video memory is only 12MB but I can't move the slider to increase it. The checkboxes for extended features are greyed-out too. See screenshot.

.

How do I increase the amount of memory?

TIA

9 Answers 9

84

Virtual Box supports up to 256 MB of video RAM. This can not be set using the slider of the Virtual Box Manager.

To make full use of all supported memory we can issue the following command in a terminal:

VBoxManage modifyvm "Name of VM" --vram 256

Before we change settings such as the video RAM a pre-existing virtual machine has to be shut down.

Note that for 3D video hardware acceleration from the guest addition's video driver the physical RAM of the host graphics card will be passed through. The video RAM settings of the virtual machine will not affect this.

10
  • This is the only working way. Updating manually the vbox file doesn't work as the file is refreshed by VirtualBox automatically.
    – ZedTuX
    Dec 1, 2016 at 12:18
  • This is a TERRIBLE suggestion. Trying this just completely borked my VM. Now it boots to a "FATAL: INT18: BOOT FAILURE"
    – krb686
    Dec 25, 2016 at 0:09
  • @krb686: sorry to hear that. We can't reproduce this error here. It may not be related to increasing VRAM.
    – Takkat
    Dec 25, 2016 at 9:43
  • @krb686 this error is related to the bootprocedure. e.g. missing Master Boot Records or similar boot-related parts of an OS
    – Foaster
    Jun 8, 2017 at 13:53
  • This command caused my machine to cease booting (boots to all black screen, no text). Reversing (running again with 128 ) brought it back. Jun 12, 2017 at 20:16
50

You need to shut down the virtual OS before you can edit settings.

2
  • 2
    Just an addition, you need to properly shutdown the virtual OS. Saving the state won't work. Mar 3, 2019 at 17:18
  • Should read the next answer instead as it allows doubling the video memory seen on the GUI.
    – Leathan
    Nov 26, 2020 at 12:37
17
  1. Stop the virtual machine and close virtualbox
  2. Using a text editor like "Sublime Text" open YOUMACHINE.vbox. Make a backup beforehand.
  3. Look for vram entry and change its value

    <Display VRAMSize="256" monitorCount="1" accelerate3D="true"
      accelerate2DVideo="false"/>
    
  4. Save the file.

Now you can increase the video memory above 128.

5
  • 3
    With the virtual machine stopped you should be able to modify the settings through VirtualBox's UI. You don't have to resort to a text editor to change that setting unless something is really wrong.
    – jkt123
    Apr 24, 2015 at 0:30
  • 2
    editing .vbox by hand is not recommended.
    – Elder Geek
    Apr 24, 2015 at 1:22
  • 1
    @jkt123 I would not have suggested it if it was possible through VB UI, I'm talking here about video ram size which can't be otherwise resized beyond 128.
    – elsadek
    Apr 24, 2015 at 13:22
  • @ElderGeek not for advanced users, and making a backup before editing is always a best practice.
    – elsadek
    Apr 24, 2015 at 13:25
  • Shouldn't your answer make that clear to encourage the novice to avoid making a mistake? It's still unnecessary and not recommended - see virtualbox.org/manual/ch08.html
    – Elder Geek
    Apr 24, 2015 at 15:12
9

Set Monitor Count to 8 and you will have the ability to increase the video memory at 256 MB.

3
  • @karel I did not know that, the slider always appeared to be going down and resetting the VRAM to 128. Nice trick :)
    – user720663
    Apr 10, 2019 at 17:47
  • @karel fwiw that no longer works, it slides it back down. Dec 28, 2020 at 16:31
  • @ConstantineK Open a terminal and run the following command VBoxManage modifyvm "Name of VM" --vram 256 where replace Name of VM with the name of the guest OS in VirtualBox settings.
    – karel
    Dec 28, 2020 at 19:33
5
  1. Shutdown your VM
  2. From an elevated command prompt:
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" modifyvm "Ubuntu" --vram 256

Replace Ubuntu with the name of your VM. If your installation path for Virtualbox is different, replace C:\Program Files\Oracle\VirtualBox\ with the directory you installed it to.

Verify it works.

And of course from the terminal from the VM Ubuntu:

  1. sudo apt-get install dkms & sudo apt-get install virtualbox-guest-dkms
  2. Reboot your VM
1
  • 2
    true.. But also the exact location of vboxmanager.exe. (This is missing in previous post) Otherwise it won't work. Feb 24, 2018 at 13:04
2

As Marvin stated, you need to shutdown the VM before you change things. You also need to sudo apt-get install virtualbox-guest-dkms in the virtual ubuntu. And be advised that 3d acceleration might not work, and Unity is heavy on 3D. Thus using a less graphic intensive desktop like xfce4 might be a better/faster option. Please enable 2D acceleration at least. It should provide some speedup.

2
  • Thanks for the info. I already did a sudo apt-get install dkms. What does sudo apt-get install virtualbox-guest-dkms? What's the difference?
    – ksl
    Feb 18, 2015 at 20:52
  • dkms = dynamic/dell kernel management system. virtualbox-guest-dkms are the drivers in guest addition for the ubuntu kernel made to work with dkms. Thus you need both.
    – user283885
    Feb 18, 2015 at 21:00
2

In VB v5.1.x, if you enable 3D Acceleration first in the UI, VRAM automatically jumps to 256M.

3
  • The question refers to an Ubuntu guest, your screenshot is of a Windows 10 guest. VirtualBox has different limits and setting for different types of guests. Linux guest can not use "2D Video Acc", and the max video memory is 128MB
    – xx1xx
    Mar 22, 2017 at 4:51
  • @RichardPierre - don't want to start arguing, but my screenshot was actually from Ubunty. Please recheck.
    – alboko
    Aug 23, 2017 at 21:00
  • 3
    you are running a Windows "Guest" on a Linux "Host". Windows "Guest" have different allowable settings. One of those is 2d acceleration is for "Windows Guests" only : virtualbox.org/manual/ch04.html#guestadd-2d You'll also find that that maximum a Linux "Guest" can allocate to Video memory is 128MB. So try again with a Linux "Guest" and let me know if it's otherwise.
    – xx1xx
    Aug 24, 2017 at 22:52
0

Running vboxmanage itself to find that --vram option but could not, however, using the command in top answer worked. Someone has posted that your VM doesn't need more RAM assigned to your display than needed so am posting my settings for Win7 running in 4k without any acceleration enabled that it complained about "not enough ram". Hope someone will find this useful. The last post is from Feb18 so this is an update that it works. Since someone posted here that it went black screen - advice is - clone your VM and test it there first if it works.

Settings before the change: Settings before the change

Settings after the change: Settings after the change

0

You can set the monitor count to 8 and then it will allow you to set the video ram all the way to 256 MB

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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