How to Speed up Ubuntu 16.04 and 17.04 in VirtualBox

Do you know why Ubuntu runs slow in VirtualBox? The main reason is that the default graphics driver installed in VirtualBox doesn’t support 3D acceleration. To speed up Ubuntu in VirtualBox, you need to install guest additions which contains a more capable graphics driver that supports 3D acceleration.

How to Check if 3D Acceleration is supported

Start up your Ubuntu virtual machine. Then in a terminal window, type the following command:

/usr/lib/nux/unity_support_test -p

This is the output on a newly installed Ubuntu 17.04 VirtualBox machine.

enable 3D acceleration in ubuntu virtualbox

Take a look at the last line which tells us that Unity 3D is not supported. We need to fix that.

Speed up Ubuntu 17.04 in VirtualBox by Installing VirtualBox Guest Additions

VirtualBox guest additions allows you to set up shared folders, enable bidirectional shared clipboard between host and guest, and power up the graphics ability of your guest machine. It’s a set of device drivers (graphics and mouse drivers) and system applications that is going to be installed in the guest OS.

To install guest additions, first we need to install some tools for compiling kernel modules. In the Ubuntu virtual machine, run the following command to update existing software.

sudo apt update && sudo apt dist-upgrade

Please note that if a new kernel is installed, you need to reboot Ubuntu. Then install  required packages for building kernel modules.

sudo apt install build-essential module-assistant dkms

Next, prepare your system to build kernel module.

sudo m-a prepare

Output:

speed up ubuntu virtualbox

In VirtualBox menu bar, select Devices > Insert Guest Additions CD image.

speed up ubuntu 16.04 on virtualbox

You might be asked to download the guest additions CD image if it cannot be found on your hard drive. Click Download. Once the download is complete, click Insert button to insert the CD image into the virtual optical drive.

If the guest additions CD image had already been downloaded before, then you will be asked to run the software contained in it, click Run button.

install virtualbox guest additions in ubuntu 17.04

Then enter your password and it will begin compiling the VirtualBox guest additions kernel modules. You may be notified that your system already have a version of the VirtualBox Guest Additions, but built-in version is of low quality. So enter yes to continue.

ubuntu virtualbox speed up

Once the guest additions is installed, press Enter to close the terminal window and shut down your Ubuntu virtual machine. (Don’t reboot it now.)

Go to your VirtualBox settings. Click Display on the left pane. In the Screen tab, allocate 128M video memory to Ubuntu VM and make sure Enable 3D Acceleration is checked. Save you settings.

ubuntu virtualbox enable 3d acceleration

Start Ubuntu virtual machine. It should be running much faster now because Unity 3D is supported with the new graphics driver. Run the following command in a terminal window.

/usr/lib/nux/unity_support_test -p

You will see that Unity 3D is supported.

virtualbox unity 3d support

Other Tips to Speed up Ubuntu in VirtualBox

You can also check out 4 tips to speed up Ubuntu, which also goes for Ubuntu virtual machine.

That’s it! I hope this tutorial helped you make Ubuntu faster in VirtualBox. As always, if you found this post useful, then subscribe to our free newsletter or follow us on Google+, Twitter or like our Facebook page.

Rate this tutorial
[Total: 53 Average: 3.8]

20 Responses to “How to Speed up Ubuntu 16.04 and 17.04 in VirtualBox

  • Unfortunately in 17.10 it doesnt work

    • Xiao Guo-An (Admin)
      1 month ago

      I haven’t tried it in 17.10 yet. I guess it’s because Ubuntu 17.10 uses Gnome desktop instead of Unity.

      • 理代理
        1 month ago

        i tried in 17.10 didnt work now i am back at 16.04…all good now

      • Phil Meyerson
        1 month ago

        should I expect this to work in 17.04? After following the steps I try to login after enabling 3d, after I enter my password I just get a blank screen with the background, ubuntu version, and virtualbox menu/status bar 🙁

  • then can i eject the cd image(Guest Additions CD image.) or should I leave it there?

  • This totally worked! thank you so much!

  • it works! really thanks

  • Now i got black screen after ubuntu startup logo 🙁

  • This seems to have improved the performance! Thanks a lot for this post. Will update if I face any problems in this context.
    Thank you.

  • You may need to change the graphics controller to VBoxVGA or VBoxSVGA, it did not work for me with VMSVGA.

  • reading package lists… Done
    building dependency tree
    reading state information…Done
    Package gcc is not available,but is referred to by another package.
    This may mean that the package is missing,has been obsoleted, or
    is only available from another source

    E:Package ‘gcc’ has no installation candidate

    sir/mam please give solution for this problem

  • Thank you. This really made it faster and much nicer to look at.

  • Hi

    I’m a beginner to Ubuntu. I’m using Ubuntu 20.04 on VirtualBox. I need to know about the status of my 3D acceleration. for this, I tried to use this command line:

    /usr/lib/nux/unity_support_test -p

    but the this message appears: ” no such file or directory “.

    Would you please help me step by step to resolve it?

    • Xiao Guoan (Admin)
      4 years ago

      Ubuntu 20.04 by default doesn’t use Unity desktop environment, so this guide doesn’t apply.

    • Emiliano
      4 years ago

      Hi Majid try to type:

      sudo /usr/lib/nux/unity_support_test -p

      Hope it helps!

  • Thanks for your answer.

    I want to know that if there is another solution in order to speed up my Ubuntu?
    Because it works slow also when I want to open terminal or Firefox and other apps (they will open after delay!).

    I have allocated 8 gigs of Ram to it. My lap top is Intel Corei5 with Intel(R) 4000 GPU.

    Thanks in advance.

  • thank you

Leave a Comment

  • Comments with links are moderated by admin before published.
  • Your email address will not be published.
  • Use <pre> ... </pre> HTML tag to quote the output from your terminal/console.
  • Please use the community (https://community.linuxbabe.com) for questions unrelated to this article.
  • I don't have time to answer every question. Making a donation would incentivize me to spend more time answering questions.

The maximum upload file size: 2 MB. You can upload: image. Links to YouTube, Facebook, Twitter and other services inserted in the comment text will be automatically embedded. Drop file here