Are you getting tired of Ubuntu taking up valuable space and resources in your virtual machine?
Or perhaps you’re simply done experimenting with Linux for now. Whatever the reason, it’s time to say goodbye to Ubuntu on your virtual machine.
But how do you uninstall it properly without messing up your system? Don’t worry!
In this step-by-step guide, we’ll show you exactly how to uninstall Ubuntu from your virtual machine safely and quickly so that you can move on to more pressing matters. So grab a cup of coffee, sit back and read on!

Contents
Introduction: What is a Virtual Machine?
A virtual machine is a software computer that, like a physical computer, runs an operating system and applications.
The major difference between a physical computer and a virtual machine is that the virtual machine does not exist as a physical entity; it is created by using software to emulate the hardware of a real computer.
Virtual machines are popular because they provide a way to run multiple operating systems on one physical computer.
For example, you can use virtualization software to run Windows on a Mac or vice versa. Or, you can install Ubuntu on your Windows 10 PC alongside your existing Windows installation. That’s what we’ll be doing in this guide.
Disconnecting Virtual Machine from Your Computer
First, you will need to open the VirtualBox application and shut down the virtual machine that you wish to delete.
Next, right-click on the virtual machine in the left sidebar and select “Remove.” You will be prompted to confirm your decision – select “Delete all files” to do so.
Finally, open your terminal and type in “rm -rf ~/.VirtualBox“. This will remove all traces of the virtual machine from your computer.
Uninstalling Ubuntu from Virtual Machine
Uninstalling Ubuntu from your virtual machine is a straightforward process. You can either use the graphical “Ubuntu Software Center” or the command line “apt-get” tool.
To uninstall using the Ubuntu Software Center:
- Open the Ubuntu Software Center from the Dash.
- Search for “Ubuntu”.
- Click on the “Remove” button next to the search result titled, “Ubuntu”.
- Enter your password when prompted and click on the “Authenticate” button.
- Click on the “Continue” button to confirm that you want to uninstall Ubuntu from your virtual machine.
- Wait for the process to complete and click on the “Close” button when it is finished.
To uninstall using apt-get:
- Start by updating your package index files with this command: sudo apt-get update
- Then, unselect all held packages with this command: sudo apt-mark unhold $(dpkg -l | grep ^h | awk ‘{print $2}’)
- Use this command to remove all installed packages: sudo apt-get purge $(dpkg -l | grep ^ii | awk ‘{print $2}’) $(dpkg -l | grep ^rc | awk ‘{print $2}’)
- Finally, delete all downloaded .deb files with this command: sudo rm /var/cache /apt/archives/*.deb
- Finally, reboot the virtual machine to complete the uninstallation process: sudo shutdown -r now
Once the reboot has occurred, your virtual machine will no longer have Ubuntu installed.
Updating Virtual Machine Before Uninstalling Ubuntu
Assuming you have a Ubuntu virtual machine running on top of another OS, the first step is to ensure that your VM is up to date. To do this, SSH into your VM and run the following command:
sudo apt-get update && sudo apt-get upgrade -y
Once the updates are complete, you can proceed with uninstalling Ubuntu from your VM.
Securing Your Data Before Uninstall Ubuntu
If you’re planning on uninstalling Ubuntu from your virtual machine, it’s important to take a few steps first to make sure your data is secure. Here’s what you need to do:
- Backup your data. This is the most important step in ensuring that your data is safe during the uninstall process. There are a few different ways to backup your data, so choose the method that’s best for you.
- Export any settings or configurations you want to keep. If you have any custom settings or configurations that you want to keep, export them before uninstalling Ubuntu. This way, you can import them into your new operating system later on.
- Deactivate any third-party repositories. If you’ve added any third-party repositories to your Ubuntu installation, deactivate them before uninstalling. Otherwise, they’ll remain active and could cause issues with your new operating system.
- Uninstall Ubuntu using the ‘Remove Ubuntu’ option in your VMware Workstation application. Once you’ve completed all of the above steps, you’re ready to uninstall Ubuntu from your virtual machine. To do this, open up VMware Workstation and select the ‘Remove Ubuntu’ option from the menu.
Final Steps to Uninstall Ubuntu from Your Computer
The final steps to removing your Ubuntu virtual machine from your computer are as follows:
- Stop the VM from running. In order to do this, open up the VirtualBox Manager and click on the “Stop” button for your Ubuntu VM.
- Delete the VM. Again, in the VirtualBox Manager, select your Ubuntu VM and click on the “Delete” button.
- You will be prompted to confirm that you want to delete the VM; click “OK” to proceed.
- Unregister the VM with Oracle VM VirtualBox. Once you have deleted the VM, there is one more step to take in order to completely remove it from your system.
- You need to unregister the VM with Oracle VM VirtualBox; otherwise, it will still show up in the list of available VMs even though it has been deleted.
- To unregister a VM, open up a Terminal window and enter the following command:
VBoxManage unregistervm "VM Name" --delete
Replace “VM Name” with the actual name of your Ubuntu virtual machine. For example, if I named my Ubuntu VM “UbuntuTestVM”, I would enter the following command:
VBoxManage unregistervm "UbuntuTestVM" --delete
Once this command has been entered, the VM should be completely removed from your system.
Conclusion on Uninstall Ubuntu
Uninstalling Ubuntu from your virtual machine may seem intimidating at first, but with the right steps, it’s an easy process.
It only takes a few minutes of preparation and following the simple instructions outlined in this guide to quickly remove any Ubuntu operating system from your VM setup.
If you need help with other Linux distributions, we have guides for those as well!
No matter what OS set up you’re running, remember that uninstalling or reinstalling is always easier when done safely and carefully.