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.
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:
In VirtualBox menu bar, select Devices > Insert Guest Additions CD image.
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.
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.
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.
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.
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.
Unfortunately in 17.10 it doesnt work
I haven’t tried it in 17.10 yet. I guess it’s because Ubuntu 17.10 uses Gnome desktop instead of Unity.
i tried in 17.10 didnt work now i am back at 16.04…all good now
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?
Yes, you can eject it.
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.
For me it wored with VMSVGA only hehe.
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
That’s really weird. Package
gcc
is in the Ubuntu main repository. https://packages.ubuntu.com/xenial/gcc. Which Ubuntu version are you using?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?
Ubuntu 20.04 by default doesn’t use Unity desktop environment, so this guide doesn’t apply.
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