You should be able to have a button to clear a virtual disk

Here you can provide suggestions on how to improve the product, website, etc.
Locked
A user
Posts: 1
Joined: 29. Sep 2023, 01:59

You should be able to have a button to clear a virtual disk

Post by A user »

As the title says, in the virtual media manager, you can clear optical discs and floppy drives, but not virtual discs? This can be extremely useful when experimenting in OS's and you need to get a fresh disk. Yes, you can make a new disc, then change it, and so on, but having a button to clear the virtual disc is a necessity.

So please make a button to clear virtual discs! :D
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: You should be able to have a button to clear a virtual disk

Post by scottgus1 »

I see the "clear" button on the Media Manager for Optical and Floppy images. It seems to be a new button for 7.0. A 6.0 host I have does not have it.

FWIW the Clear button is grayed out for any ISO I have on my 7.0 hosts. This makes sense: ISOs are of CDs which are usually not erasable. One doesn't erase an ISO and be left with an empty ISO to be filled with things again later. One just compiles a new list of items and makes a new ISO, perhaps overwriting the old one.

A floppy image I made and loaded something on does not have an active Clear button at any state, whether written to or new, even though technically a floppy could be erased.

So far it appears that the Clear button is not implemented yet.

Were I to have the opportunity to vote on having a Clear button for virtual disks, I would vote to not to. All we need is folks getting on the forum saying "I hit Clear on my essential job-worthy- pink-slip-if-failing millions-of-dollars'-contents virtual drive and didn't notice the warning box, and my VM won't boot! What do I do now???" :shock: :lol:
Whiskeyjack
Oracle Corporation
Posts: 122
Joined: 28. Aug 2017, 13:14

Re: You should be able to have a button to clear a virtual disk

Post by Whiskeyjack »

Clear button/functionality is implemented. It is used to make "VirtualBox" forget optical and floppy disk objects when what they are pointing cannot be found. When you use an iso (to mount it on a guest etc.) VirtualBox makes an entry in its related database. And when that iso/img file becomes unreachable for some reason (deleted, moved, etc) GUI marks them in its so-called "Media Manager" widget. We have realized that these "zombie" media objects tend to accumulate over time and deleting them one by one can be quite tedious. Thus the clear button. The button is disabled when no such inaccessible disks are found. Clearing hard disks is quite another beast. We have left those out of this "Clear" functionality intentionally since when it comes to user data we opt for security rather than convenience. This may change in the future but for now I think this is the best compromise.
Whiskeyjack
Oracle Corporation
Posts: 122
Joined: 28. Aug 2017, 13:14

Re: You should be able to have a button to clear a virtual disk

Post by Whiskeyjack »

And to delete such hard disks you can write a short VBoxManage script. Make it list the list of such hard disks and then remove them. I know it is not simple as clicking on a button. But if you have to remove them often spending some time to come up with such a script may make sense.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: You should be able to have a button to clear a virtual disk

Post by scottgus1 »

Thanks, Whiskeyjack, for the clarification! There have been forum posts where leftover ISOs have been in people's lists and getting rid of them involved manual editing of the XML files. This "Clear" button should make resolving those questions a lot more easy.

And not having it for hard drives also makes sense.

"A user", does this info help you understand your concern?
pawantanwar
Posts: 1
Joined: 29. Sep 2023, 13:19
Primary OS: Ubuntu 8.04
VBox Version: OSE Mandriva
Guest OSses: Windows 7
Contact:

Re: You should be able to have a button to clear a virtual disk

Post by pawantanwar »

I agree that a button to clear virtual disks would be extremely useful. It would be a quick and easy way to reset a virtual disk to its original state, without having to create a new one. This would be especially useful for experimenting with operating systems, as it would allow users to try out different things without having to worry about damaging their main operating system.

There are a few different ways that a button to clear virtual disks could be implemented. One simple approach would be to have a button that simply deletes all of the files on the virtual disk. This would be quick and easy, but it would also be irreversible. Another approach would be to have a button that creates a snapshot of the virtual disk before clearing it. This would allow users to revert to the previous state of the virtual disk if they needed to.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: You should be able to have a button to clear a virtual disk

Post by scottgus1 »

Just to let our non-Oracle posters know, the existing "Clear" button is not for erasing the contents of a storage unit, like an ISO or floppy image.

Per Whiskeyjack's information above, the Clear button is for removing the listing of the image from the Media Manager, when the image is deleted or moved in the main OS's file manager instead of within Virtualbox. The actual contents of the image remain unchanged.

Thus Virtualbox has no button for erasing any image or storage device. Just as real computers don't have a button to erase their hard drives.

Erasing a hard drive is best left to OS functions, such as installers. That makes the erase function a bit harder to get at, therefore less easy to accidentally get at.

There are Virtualbox functions that can get a hard disk reset. Please start a new topic in Using Virtualbox on how to erase or reset a hard disk.
Locked