60

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

ksl
  • 804
  • 3
  • 10
  • 14

9 Answers9

93

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.

Takkat
  • 140,996
  • 54
  • 308
  • 426
  • This is the only working way. Updating manually the vbox file doesn't work as the file is refreshed by VirtualBox automatically. – ZedTuX Dec 01 '16 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 '16 at 00:09
  • @krb686: sorry to hear that. We can't reproduce this error here. It may not be related to increasing VRAM. – Takkat Dec 25 '16 at 09:43
  • 1
    @krb686 this error is related to the bootprocedure. e.g. missing Master Boot Records or similar boot-related parts of an OS – Foaster Jun 08 '17 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. – some bits flipped Jun 12 '17 at 20:16
  • If after the change machine is not booting up, try using `Machine` > `Reset` from the top menu. – Mohd Abdul Mujib Sep 13 '17 at 03:56
  • If the "VBoxManage" solution is supported, why is there a problem supporting it with a slidef in VirtualBox? And why are these sliders anyway when, for example, I want a value that is hard to set via a slider? – Bruce Sep 11 '18 at 19:48
  • @Bruce: you would rarely need that much video memory for a **virtual** screen. For 3D rendering we would use the host graphics card anyway. – Takkat Sep 11 '18 at 20:36
  • @takkat -- thank you. I have much to learn. I have 64 GB of RAM and the platform is basically dedicated to running Photoshop on Windows 10 within a VM under Linux. (I hate Windows and don't trust it.) So I don't mind squandering RAM. – Bruce Sep 12 '18 at 23:42
  • @Bruce you can assign a luxury of 63 GB of RAM for Windows and PS but the video RAM you need will depend on your virtual windows size only. Try out different settings to see if there is any difference in performance ;) – Takkat Sep 13 '18 at 06:07
50

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

Marvin Micek
  • 822
  • 7
  • 17
19
  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.

elsadek
  • 299
  • 2
  • 5
  • 4
    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 '15 at 00:30
  • 3
    editing .vbox by hand is not recommended. – Elder Geek Apr 24 '15 at 01:22
  • 2
    @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 '15 at 13:22
  • 1
    @ElderGeek not for advanced users, and making a backup before editing is always a best practice. – elsadek Apr 24 '15 at 13:25
  • 1
    Shouldn't your answer make that clear to encourage the novice to avoid making a mistake? It's still unnecessary and not recommended - see https://www.virtualbox.org/manual/ch08.html – Elder Geek Apr 24 '15 at 15:12
9

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

  • @karel I did not know that, the slider always appeared to be going down and resetting the VRAM to 128. Nice trick :) –  Apr 10 '19 at 17:47
  • @karel fwiw that no longer works, it slides it back down. – ConstantineK Dec 28 '20 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 '20 at 19:33
6
  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
unrealapex
  • 115
  • 4
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.

user283885
  • 446
  • 2
  • 5
  • 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 '15 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 '15 at 21:00
2

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

alboko
  • 129
  • 2
  • 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 '17 at 04:51
  • @RichardPierre - don't want to start arguing, but my screenshot was actually from Ubunty. Please recheck. – alboko Aug 23 '17 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 : https://www.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 '17 at 22:52
1

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

RadoslavL
  • 13
  • 3
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

ThunderBird
  • 1,915
  • 13
  • 19
  • 31
Vlad
  • 1