Score:0

How do I resize/re-partition my hard disk after deleting Oracle Virtual box?

us flag

I downloaded Virtual box, installed Windows 10 pro on the virtual machine I had allocated 100GBs of disk space to. When going to disks > highlighting the UBUNTU partition (1TB) clicking on the cogs and selecting 'resize', it shows the 100GB portion of the disk reserved for the VM highlighted in black and won't let me resize the partition to include it.

Will it do so automatically after I delete the VM from my system or do I have to do something in the command line for it to work? Thanks.enter image description here

enter image description here

ar flag
Could you add a screenshot of gparted showing the 1TB partition and the 100GB partition. It will help me understand whats going on.
Organic Marble avatar
us flag
Do you have an actual partition on the *host* machine dedicated to virtualbox? This is not the normal installation scenario. If you are talking about some kind of partition inside the virtual machine, just delete the .vdi file and you're done. Consider adding a screen shot of gparted from your *host* machine to your question.
jibjab3344 avatar
us flag
@user68186 done
jibjab3344 avatar
us flag
@OrganicMarble when I was setting up the machine I allocated 100GB to the virtual machine. So I'm not really sure.
ar flag
Thanks! I don't see the 100GB partition. I only see the 1TB (approx) Ubuntu system partition in `/dev/nvme0n1p3`. This looks like the 100 GB virtual partition is actually a a very large file with extension `.vdi`. You need to delete that file as @OrganicMarble said. When you allocate 100 GB to a virtual machine, the Virtual Box creates a virtual hard disk, which is a file in your host computer.
jibjab3344 avatar
us flag
@user68186 Thanks another problem is that it seems to have deleted the Virtualbox software and also a few other apps from my system, I have to keep re downloading them, is that caused by the .vdi file?
ar flag
Deleting the VirtualBox software or any other software is unrelated to the .vdi file.
Score:0
cn flag

You must delete the 100GB partition before you can resize the 1TB partition.

Neither partition can be mounted when being deleted or resized. Most folks use a LiveUSB's "Try Ubuntu" environment to do a resize if one of their partitions is root (/).

The warning about "can lead to data loss is SERIOUS; if your data is not backed up, assume it will be destroyed. Maybe it won't.

Score:0
ar flag

100 GB partition is not real

This looks like the 100 GB virtual partition is actually a very large file called <The Name you gave the Virtual Machine>.vdi. The file may be smaller than 100 GB in size, as some virtual disks are created small and are expected to grow as it fills up.

If you have Oracle VirtualBox installed

If you still have Oracle VirtualBox installed on your host Ubuntu computer, you can open the app and delete the virtual machine you created from within the app. It may ask if you want to delete the virtual disk or not. Choose to delete the disk if asked.

If you have uninstalled Oracle VirtualBox, you have to do it manually.

If you don't have Oracle VirtualBox anymore

Based on this Oracle VirtualBox documentation you should have a folder called:

"/home/jibjab/VirtualBox VMs"

Replace jibjab with your username for the host Ubuntu computer. Inside this folder you should have various VirtualBox configuration files for various virtual machines you created.

Since you have uninstalled Oracle VirtualBox and don't want to use these anymore you can delete the folder VirtualBox VMs from your "Home" folder.

If you just want to delete the 100 GB virtual disk, find and delete the file:

"/home/jibjab/VirtualBox VMs/<The Name you gave the Virtual Machine>.vdi"

The configuration files for your virtual machine should be in the file:

"/home/jibjab/VirtualBox VMs/<The Name you gave the Virtual Machine>.vbox"

You may delete it as well.

Delete from Trash

They say nothing is truly deleted from computers and sometimes it can be true. If you used the GUI method to delete the files and folders they get sent to the Trash folder. You may have to permanently delete these folders/files from trash.

  • Either Empty Trash to permanently delete all the deleted folders and files hiding in the trash.
  • Or Delete from Trash by right clicking on the folder/file sitting in Trash.

Hope this helps

jibjab3344 avatar
us flag
Thanks I uninstalled the Virtualbox and deleted the virtualbox home folder but it still shows the file in gparted for some reason?
ar flag
@jibjab3344 Gparted just shows 100 GB is still used. It can't tell us if that is one file, or 10,000. To see which folder/file is taking up all the 100 GB space open the app **Disk Usage Analyzer**. Can you check the "Trash" and see if the files are still there? If so, delete permanently by either emptying the Trash, or right click on the file and **Delete from Trash**.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.