How to fix slow performance ubuntu 13.04 running in virtualbox

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

You should see something like this

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

Now insert vitualbox guest iso from devices and to install manually

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

Add “vboxvideo” at the end of the file

Reboot the machine

Check “Not software rendered” and “Unity 3D supported” are enabled or not after rebooting

The next thing you want to do is to increase video memory. Look for .vbox file

Replace

To

Comments

      • Aikut says

        Hi, Nam!
        I did as in your instruction with Trusty14.04 but it didn’t work.
        Can you write another post?

        • namhuy says

          give me a day or two, let me install Ubuntu 14.04 again on virtualbox and let me see what I can do to speed it up w/ virtualbox

          • namhuy says

            I have virualbox on my Dell Inspiron 11z-1121 laptop with Ubuntu 14.04 LTS Trusty Tahr, I did the same thing I mentioned above and it works just fine.

  1. Joshua says

    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.

  2. Nam Huy says

    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

  3. pederpansen says

    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!

  4. pederpansen says

    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!

  5. daniNoob says

    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)

  6. daniNoob says

    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

  7. daniNoob says

    UPDATE:

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

  8. daniNoob says

    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

  9. Huy Tran says

    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.

  10. Deep Sukhwani says

    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.

  11. AK says

    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!

  12. R. Schreurs says

    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.

  13. Shahran says

    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

    • namhuy says

      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?

  14. Bill says

    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 ?

  15. Bill says

    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.

    • namhuy says

      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

  16. Bill says

    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

    • namhuy says

      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

  17. lostcitizen says

    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.

  18. Giuliano Dias says

    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.

    • namhuy says

      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 says

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

        Thanks for your attention.

        • namhuy says

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

    • namhuy says

      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.

  19. gautam sampathkumar says

    You are the man! Saved the day. I was going nuts as I had to build and install over 20+ libraries and the process was really slow until I followed your steps. Awesome write up and thank you so much.

  20. Steve McDonald says

    This worked great for me with VirtualBox Linux Mint 16 guest on Windows 7 host. I have a 7200rpm Sata as a hard drive. Near native speed/performance.

    • namhuy says

      I guess some distro have installed virtualbox driver for you already, I did not install guest additions for debian 7, but when I ls /etc/home/user there are virtualbox client files within user’s home directory.

  21. muharrem says

    hi, i am trying to do these things in win8 as host.when i type “cd VBOX*” it says “no such file or directory”. what am i doing wrong

    • namhuy says

      On Windows host machine, open your “Oracle VM VirtualBox Manager”, go to “File -> Preferences”. In “General” tab, you should see “Default Machine Folder” box, that’s where your VM guests are stored.

      Now open Computer/Windows Explorer, go to that directory/folder location you see in “Default Machine Folder” box, and go to Ubuntu Folder. You should see a file end with .vbox extension (with blue color icon). Edit that .vbox file with any text editor (notepad or notepad++).

      With your text editor, search with “vram” keyword. You should see something like this
      Display VRAMSize="256" monitorCount="1" accelerate3D="true" accelerate2DVideo="false"/

      Your settings may be different, change VRAMSize to “256”, and accelerate3D to “true”.

      Save the file when you are done.

  22. xun says

    Hi nam:
    Could u help check where i goes wrong?
    1. I thought i’ve followed all your steps and everything looks fine. I’ve attached the process below.
    http://imgur.com/Wt55rby
    2. After i reboot “/usr/lib/nux/unity_support_test -p” still says 3d not enabled.
    3. Then i ckecked if guest additions is installed..the result is strange.. See attached below.
    http://imgur.com/2plGd3f

    plz i need your help..

        • namhuy says

          try to add this package to your guest os
          $ sudo apt-get update; sudo apt-get install mesa-utils

          and can you run this command on guest os and paste the output here for me
          $ sudo glxinfo

          • xun says

            Hi nam:
            your file fixes the 3d acceleration problem I think.. Yet i got some other errors.
            libGL error: pci id for fd 4: 80ee:beef, driver (null)
            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

            Bunch of mesa table warings …

            libGL error: core dri or dri2 extension not found
            libGL error: failed to load driver: vboxvideo
            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

            It looks like people all get this issue. Any suggestions? Thx so much for quick help.

  23. Paresh says

    Thanks for this post.

    I have installed ubuntu 14.04 with virtualbox 4.3.12 with Windows 7 as host. i tried the steps in this post but after enabling 3D Acceleration for Video, windows is reporting a problem that Vbox Manager has stopped working.

    • namhuy says

      hummm, when does virtualbox “hang” !? when you start virtualbox or when you bootup ubuntu guest !?

  24. says

    If you add “elevator=noop” to the kernel line in the /etc/default/grub, you will get better disk i/o performance. Adding “dkms” after build-essential will cause the virtualbox drivers to be rebuilt anytime you upgrade the kernel via apt-get / aptitude / synaptic etc

Leave a Reply