How to fix slow performance ubuntu 13.04 running in virtualbox

posted in: Linux, Open Source, Tips - Tricks, Ubuntu | 33

Having very slow perform when running Ubuntu 12.10 and 13.04 in virtualbox? It’s because Ubuntu can’t use graphics card for acceleration, ubuntu uses CPU for rendering graphics trough LLVMpipe. It makes running ubuntu in virualbox really slow.

To check if your Ubuntu 12.10 or 13.04 guest is using 3D acceleration
# /usr/lib/nux/unity_support_test -p

You should see something like this
Not software rendered: no
Not blacklisted: yes
GLX fbconfig: yes
GLX texture from pixmap: yes
GL npot or rect textures: yes
GL vertex program: yes
GL fragment program: yes
GL vertex buffer object: yes
GL framebuffer object: yes
GL version is 1.4+: yes
Unity 3D supported: no

If you see “Not software rendered” and “Unity 3D supported” both say no. This means Unity is using slow LLVMpipe.

To enable 3D supported, fist you will need to update linux-headers
$ uname -r
$ sudo apt-get install linux-headers-$(uname -r)
$ sudo apt-get autoremove
$ sudo apt-get install build-essential

Now insert vitualbox guest iso from devices and to install manually
$ cd /media

$ ls
$ cd username
$ ls
$ cd VBOX*
$ ls
$ sudo ./VBoxLinuxAdditions.run

Note: VirtualBox Guest Additions may no automatic activate on your Ubuntu. In my case, Ubuntu 12.04 I have to go to System Settings, Additional Drivers to activate Oracle VM VirtualBox Guest Additions for Linux Module.

Insert vboxvideo to /etc/modules
$ sudo nano /etc/modules

Add “vboxvideo” at the end of the file
loop
lp
vboxvideo

Reboot the machine
$ sudo reboot

Check “Not software rendered” and “Unity 3D supported” are enabled or not after rebooting
$ /usr/lib/nux/unity_support_test -p

The next thing you want to do is to increase video memory. Look for .vbox file
$ nano /home/username/VirtualBox VMs/ubuntu/ubuntu.vbox

Replace
<Display VRAMSize="128" monitorCount="1" accelerate3D="true" accelerate2DVideo="false"/>

To
<Display VRAMSize="256" monitorCount="1" accelerate3D="true" accelerate2DVideo="false"/>

33 Responses

  1. Thank you! That made my guest Ubuntu way smoother.

  2. Very thanks! It worked perfectly now!

  3. Hi, I’m new to Ubuntu and I’m installing it for 1st time on a virtual machine so that I can play around with it before installing it as standalone, but I got lost on this step:

    “Now insert vitualbox guest iso from devices and to install manually”

    Where can I get this guest iso? I tried just entering the code you listed below but I got a prompt that said that the library didn’t recognize such command…what can I do?

    Thanks in advance.

  4. From your VirtualBox window, go to Devices -> Install Guest Additions

    After you click on “Install Guest Additions”, on your running VirtualBox, you will be asked “VBOXADDITIONS_** contains software intended to be automatically started. Would you like to run it?” Click Run. The new windows will show up asking you for password, type in your root password. Virtualbox guest additions should be installing by now.

    Or the terminal way
    Now go to your terminal and run

    # su -
    # cd /media/cdrom
    # sh VBoxLinuxAddition.run

  5. pederpansen

    Hi, I just tried your solution for an Ubuntu 13.04 guest by adding the vboxvideo to /etc/modules. Unfortunately, after a reboot, the command ‘/usr/lib/nux/unity_support_test -p’ still shows me the same output than before, i.e. no 3D acceleration.
    Does this have anything to do with my physical graphics card on my Windows 7 host or is this independent of the host hardware configuration? I have an Nvidia Geforce GTX 560 Ti.
    I would be glad if you could give me any hints on how to get your solution to work!

  6. pederpansen

    Update: I got it to work by rebooting again without host 3D acceleration enabled, reinstalling guest additions and again rebooting with host 3D acceleration ticked. Runs very smoothly now, the performance boost is amazing. Thank you very much!

  7. I’m glad i can help :)

  8. daniNoob

    Hi, I tried this and I got a few.. errors.. after rebooting:

    First: very Weird-looking top and left bars:
    http://postimg.org/image/lwt0p7t3f/

    Second: When I run again the unity support test I get a LOT of warnings:
    http://postimg.org/image/5pz34zegj/
    At least they changed to “yes”…

    Can you help me with that? you really look like you know what you are doing haha I’m a bit new to all this VM stuff and to Ubuntu
    (Already tried to reboot, still the same)

    • Giuliano Dias

      daniNoop, hi.

      I get some problem, do you solve that?

  9. daniNoob

    ok, i have this problems:

    After the reboot the top and left bars didn’t show properly (it was like when you have something broken in your PC), and when I run the unity support test i got lots of Warnings like: “*something* not found in mesa table

    I wanted to link images of the errors but my comment got deleted, so if you want to see them please give me your email, I’ll send them.

    Thanks in advance :P

  10. daniNoob

    UPDATE:

    I rebooted with the host 3D acceleration disabled, bars problem got solved, but the slow is back, ofc

  11. may i know your hardware config and your virtualbox config ?

  12. daniNoob

    I have an iMac with mac OS X 10.6.8

    Processor: 2.16 GHz Intel Core 2 Duo

    2.6 GB Ram…

    Chipset: ATY, radeonX1600
    VRAM 128 MB….

    Dunno, anything specific?

    VBox:
    (the Ubuntu VM):
    1Gb Ram, 128 Mb video, 3D Acc on, 2D off..

    And again, if you want to know anything specific, just ask

  13. Try to increase the video memory to 256 mb in /home/username/VirtualBox VMs/ubuntu/ubuntu.vbox

    Also, in your ubuntu vm setting, go to “System”, then “Processor”, give your vm as much core as your processor support. After that go to “Acceleration” tab, enable “VT-x/AMD-V” and “Nested Paging”

    Your Vm speed also depends on your physical hard drive speed. I have a quad core desktop intel 6600 with 7200 RPM sata2, speed was ok with ubuntu vm 13.04, but my laptop with slower processor intel-3 m ultra if i remember correctly is like 1.3 ghz with SSD hard drive, ubuntu vm loads faster w/ ssd.

    Don’t forget to install virtualbox guest additions for your ubuntu vm, it will give your vm correct vga driver under virtualbox environment.

    On your ubuntu vm, install preload (# apt-get install proload), and set swappiness to 0. http://namhuy.net/431/performance-tuning-linux-kernel-with-swappiness-parameter.html

    I had to do lots of tweaks for ubuntu under virtualbox environment to make it *useable*, ubuntu 13.04 w/ unity it self is slow already, it will be even slower under virtualbox :(

    Honestly I don’t like unity from ubuntu, it’s so slow, if you don’t really need to use gnome/unity, i would recommend you to try xfce which i’m using, you can either install xfce on ubuntu or clean install with ubuntu.

  14. The file in which you need to increase video memory (the final step of above mentioned instructions) is actually present on the host OS, means if you are using VirtualBox on Mac, the file ubuntu.vbox will be present on your hard drive where VirtualBox is installed.

    This might sound obvious, but as I was continuously following all the above instructions step by step, at first, I assumed even the .vbox file exists on guest OS drive and so I was trying to find it there.

    Also, super thanks for your amazing guidelines, it is really helpful and helped me increase performance of Ubuntu 13..10 (64 bit) installed in VirtualBox on Mac.

  15. Thank you very much… worked like a charm along with pederpansen’s comments.

    pederpansen says:
    09/12/2013 at 3:31 pm
    Update: I got it to work by rebooting again without host 3D acceleration enabled, reinstalling guest additions and again rebooting with host 3D acceleration ticked. Runs very smoothly now, the performance boost is amazing. Thank you very much!

  16. R. Schreurs

    Thanks a lot for this elaborate solution. I used in on a fresh install of 13.04 x86.

    I have a few comments.
    1. I had to perform “sudo apt-get update” before “$ sudo apt-get install build-essential”, because it gave the result “Unable to locate package build-essential”.
    2. The test, after reboot “$ /usr/lib/nux/unity_support_test -p” still report “no” twice. I could fix this by checking a setting in the VirtualBox Manager, after I shut down the VM once more. The setting is found as follows:
    a) Select the VM.
    b) Go to Settings.
    c) Select Display in the left column of the new dialog window.
    d) Go to tab Video.
    e) Check Extended Features – Enable 3D Acceleration.
    When I also checked Enable 2D Video Acceleration, a warning appeared, which said: “Invalid settings detected”, with hover text “Display: Video page: The virtual machine is set up to use Video Stream Acceleration. As this feature only works with Windows guest systems it will be disabled.”, so I unchecked it. After booting the VM. outcome of unity_support_test was ok: yes all and performance was improved drastically.

    Hope this helps someone else when using the instructions in this page.

  17. I tried this and everything was fine until i reboot it when i rebooted it it asked me which os did i want to boot on to
    Ubuntu
    Advanced options for ubuntu
    and 2 others i tried ubuntu and it stopped responding before it could load up in the advanced options there were 2 options one was normal and was recovery mode i pressed the normal one and the same thing happened again, what is wrong please help ! btw it didnt boot up so i went into setiings and removed the vbox addition iso

    • Tell me a bit more about your host/guest virtualbox setup. What have you done so far to your virualbox config? Normally for me after I increase the vram for 3d, I can boot normally to Ubuntu w/o being asked at the boot options. By the way, which Ubuntu version of your virualbox guest?

  18. Hello!
    I encounter a problem with the password. After
    # su -
    the system replies with
    Password:
    When entering the password that I always use I receive the message
    Authentication failure.
    Is there anything that I am missing?
    I checked the password in many other ‘authentication’ requests and it works. The installation is new and I don’t know if there is a default password for the root adm.
    Any suggestions ?

  19. Unfortunatelly the Authentication failure persists even with $ sudo su.
    The password I am entering is the same as before..
    Anyways.. Thanks for the very fast reply and help.

    • Do you have root password of your system? Or did you set your root password before?
      Normally $ su – works well with Fedora/CentOs/Redhat based distributions and $ sudo su works with Ubuntu/Linux Mint.

      If you have Ubuntu you can use $ sudo su to become root with your normal user password if you didn’t change your root password I believe.
      Maybe you should try just $ su like this
      $ su

  20. I finally managed to pass the authentication with $sudo su. !!
    However after the prompted:
    root@UbBox:/home/bbn# cd /media/cdrom
    I am getting the message:
    bash: cd: No such file or directory.
    I checked the files via ls in /media direcory and there is only one subdirectory named bbn containing the file
    VBOXADDITIONS_4.3.8_92456
    Shall I do something else?
    Thanks

    • Is there an extension for VBOXADDITIONS_4.3.8_92456 which you have? or VBOXADDITIONS_4.3.8_92456 is an directory?

      Try to go to that VBOX if it’s a directory
      # cd VBOX*
      and list files in side
      # ls
      you should see VBoxLinuxAdditions.run or VBox*.run. If you see a file end with .run extension, run that file to install Virtualbox Guest Additions
      # ./*.run

  21. lostcitizen

    Thanks! Speed has improved a lot but it remains slow for me, so I had to switch to vm ware for virtualizing ubuntu, in which it runs very smooth.

  22. Giuliano Dias

    Hi, it’s don’t work for me, I got some problens, all of things desapears when Ubuntu is ready.
    But they still there, I know it couse when I click with mouse end type the name of program, the program runs.

    This is the mesage that I see when I run the test (/usr/lib/nux/unity_support_test -p

    OpenGL Warning: glFlushVertexArrayRangeNV not found in mesa table
    OpenGL Warning: glVertexArrayRangeNV not found in mesa table
    OpenGL Warning: glCombinerInputNV not found in mesa table
    OpenGL Warning: glCombinerOutputNV not found in mesa table
    OpenGL Warning: glCombinerParameterfNV not found in mesa table
    OpenGL Warning: glCombinerParameterfvNV not found in mesa table
    OpenGL Warning: glCombinerParameteriNV not found in mesa table
    OpenGL Warning: glCombinerParameterivNV not found in mesa table
    OpenGL Warning: glFinalCombinerInputNV not found in mesa table
    OpenGL Warning: glGetCombinerInputParameterfvNV not found in mesa table
    OpenGL Warning: glGetCombinerInputParameterivNV not found in mesa table
    OpenGL Warning: glGetCombinerOutputParameterfvNV not found in mesa table
    OpenGL Warning: glGetCombinerOutputParameterivNV not found in mesa table
    OpenGL Warning: glGetFinalCombinerInputParameterfvNV not found in mesa table
    OpenGL Warning: glGetFinalCombinerInputParameterivNV not found in mesa table
    OpenGL Warning: glDeleteFencesNV not found in mesa table
    OpenGL Warning: glFinishFenceNV not found in mesa table
    OpenGL Warning: glGenFencesNV not found in mesa table
    OpenGL Warning: glGetFenceivNV not found in mesa table
    OpenGL Warning: glIsFenceNV not found in mesa table
    OpenGL Warning: glSetFenceNV not found in mesa table
    OpenGL Warning: glTestFenceNV not found in mesa table
    libGL error: failed to load driver: vboxvideo
    libGL error: Try again with LIBGL_DEBUG=verbose for more details.
    OpenGL vendor string: Humper
    OpenGL renderer string: Chromium
    OpenGL version string: 2.1 Chromium 1.9

    Not software rendered: yes
    Not blacklisted: yes
    GLX fbconfig: yes
    GLX texture from pixmap: yes
    GL npot or rect textures: yes
    GL vertex program: yes
    GL fragment program: yes
    GL vertex buffer object: yes
    GL framebuffer object: yes
    GL version is 1.4+: yes
    Unity 3D supported: yes

    The modules are that way:
    lp (This line was there before changes)
    rtc (This line was there before changes)
    loop
    lp
    vboxvideo

    And I can’t find ubuntu.vbox

    I’m using ubuntu 13.10 (but I get some problem with 13,04) and Virtualbox 4.3.8 under windows 7.
    Sorry about my bad english.

    • Try to install guest additions, and properly install the extension pack for your version of VBox.

      If you can’t find ubuntu.vbox on your Windows 7 host machine. Open “Oracle VM VirtualBox Manager”, go to “File”, then “Preferences”. In General tab, you should see “Default Machine Folder” which where your virtualbox machines are stored. Now in your Windows 7 host machine, use “Windows Explorer” or whatever you like, go the the location what you see in “Default Machine Folder” earlier. Open Ubuntu folder, you should see Ubuntu* files, one with blue color icon end with .vbox. That the one you should use to increase Display VRAMSize.
      You can open the .vbox file with notepad or Notepad++, search for the phrase “Display VRAMSize=”128″”, change VRAMSize value from 128 to 256. Save the file after you done.

      • Giuliano Dias

        I created other VM with Ubuntu 13.10. And just run Addictons that fineshed ok.
        And same problem occured.

        Thanks for your attention.

        • You should try with another Ubuntu ISO, or maybe try xubuntu or lubuntu if you still get that error, let me know

    • OpenGL 3.0 does not work with VirutalBox at the moment, I know that Vmware supports OpenGL thought. Update your VirutalBox to the newest version to see if it’s gonna help or not.

Leave a Reply