Try a Different Version of VirtualBox
No program is free of bugs, and this goes for both Ubuntu and VirtualBox. Some users have found that different versions of VirtualBox and Ubuntu sometimes just don’t get along. If a certain version of Ubuntu never froze in the past, you can try installing an older version of VirtualBox. Conversely, you might try running a newer version of Ubuntu. Not only will you possibly solve your freezing problem, but you’ll get new features as well. Alternately, if you started using VirtualBox with a newer version of Ubuntu, check to see if there are any freezing issues with that version. For example, if you search for “Ubuntu 20.4 LTS freezing” on Google, you’ll see a lot of complaints. So, the problem could easily be with Ubuntu and not VirtualBox. Installing an earlier version of Ubuntu may help eliminate the freezing issue.
Disable 3D Acceleration
No matter whether you’re running Windows, macOS, or even Linux, 3D acceleration can cause plenty of problems in VirtualBox. While it sounds like something you’d want, it rarely enables any actual gains in performance. If you’re encountering freezing, this is one of the first things to try turning off. In the menu on the left in VirtualBox, right-click on the Ubuntu virtual machine you’re having problems with, then select Settings. Here, click the Display tab and make sure that “Enable 3D Acceleration” is not selected.
Change the Number of Virtual CPUs
Though computers sold to consumers typically have only one physical CPU, they have multiple cores that act like multiple CPUs. Even so, VirtualBox, by default, will only expose one virtual CPU, which has been shown to cause problems with Ubuntu, especially recent versions. If you’re encountering freezing, you may want to bump the number of CPUs up anywhere from two to four. Right-click on your virtual machine, select Settings, then go to the System tab. Here, select processor at the top of the section and raise the slider until the number of CPUs is at least two.
Reduce RAM Usage
If Ubuntu freezing in VirtualBox only happened occasionally, it could be a RAM issue. The host computer only has so much RAM. Even though VirtualBox allows you to run another operating system, it’s still using your computer’s resources. If you’re trying to run apps on your main OS and Ubuntu at the same time, it could result in freezing on Ubuntu and/or your main OS. Ideally, limit your main OS usage when using Ubuntu on VirtualBox. If you need to do something more memory intensive on your main OS, turn off Ubuntu or close any running programs on it to reduce RAM usage. This is especially true if you have an anti-virus scan going. If you’ve recently upgraded to a new version of Ubuntu, it’s possible the new version requires more resources than a previous version. This can result in freezing. Upgrading the RAM in your computer is the best solution if you simply don’t have enough to support two operating systems.
Reinstall Ubuntu
As a last resort, you may need to reinstall Ubuntu. If the freezing issue occurs frequently after the original installation, it could be that the system didn’t install correctly. Also, if the freezing occurs mainly upon boot, the issue is likely with the installation. Removing the Ubuntu virtual machine and reinstalling it is the best way to fix the problem in this scenario. However, it’s well worth adjusting your settings and checking RAM usage to ensure none of those are the issue. If reinstalling Ubuntu is not an option for you, then try to update Ubuntu from the recovery mode. The previous software update could have some corrupted packages that cause the system to freeze. They are usually fixed very quickly, so always run an update to get the latest version of all packages.
Other Options to Try with VirtualBox
There are some other options that users have found solved their problems with freezing. In the same section where you can change the number of CPUs, there’s an option to “Enable PAE/NX.” Toggling this off if it’s on already, or on if it’s already off, could solve your problem. You can also try changing your paravirtualization settings. Go to Settings, then select “System and Acceleration” below it. Paravirtualization Interface will likely be set to “Default,” but some users have had better results setting it to “Minimal.”
Does VirtualBox support all versions of Ubuntu?
Yes, only if you are using the official stable version. If you are running a beta version of Ubuntu, it might not work in VirtualBox, and there’s a higher risk of freezing and other issues. In some cases, with 64-bit versions, you may need to disable Hyper-V to avoid problems.
How can I choose the right amount of RAM?
Since RAM is a major concern to prevent freezing and just a poor overall experience, it’s best to ensure you allocate at least the minimum amount of RAM needed to run Ubuntu to your VirtualBox instance. If this is all your RAM, you should consider upgrading your PC. You should allocate at least 2GB.
Does the number of processors matter?
This is a tricky one. Users report changing the number of processors allocated to their Ubuntu installation can help with the freezing issue, but this isn’t a guarantee. There isn’t one set number that works for everyone as some users change from 1 to 2 or 2 to 1 and both options fixed their freezing issue. It’s an option to try but may not help at all.
Wrapping Up
Hopefully, one of the above options has solved your freezing problem with Ubuntu. If you’re still having trouble, don’t give up hope. Trying different combinations of the above options could prove to be the solution for you. Don’t let one bad experience turn you away from using either Linux or virtual machines. This article covers running Ubuntu in a virtual machine, but what about the other way around? If that’s what you’re looking to do, see our guide to installing and running VirtualBox on Ubuntu. Are you sure VirtualBox is the right solution for you? Read our comparison of VirtualBox vs. VMware.