Maschine ausschalten und alles löschen von der letzten Session

Allgemeine Diskussionen über den Einsatz von VirtualBox.
Post Reply
Alooha
Posts: 61
Joined: 27. Dec 2009, 21:13
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: MX Linux

Maschine ausschalten und alles löschen von der letzten Session

Post by Alooha »

Hallo,
wenn ich eine Maschine ausschalte ohne abzuspeichern, und sie wieder starte, dann müsste die Chronik der letzten Session in Firefox logischerweise doch weg sein, oder nicht? War bei mir eben nicht der Fall.
Die Maschine ausschalten ist doch aber der richtige Weg, um alles zu löschen von der letzten Session? Was macht eigentlich den Unterschied zwischen einfach ausschahlten und ausschalten mit Häkchen bei "Zurückkehren auf Sicherungspunkt..."?
MfG
Alooha
Last edited by Alooha on 19. Jul 2022, 15:03, edited 1 time in total.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Maschine ausgeschalten und alles löschen von der letzten Session

Post by mpack »

That would depend on where Firefox keeps the session information. Being able to resume after a crash is one of Firefox's features, presumably implemented by storing data incrementally in a temp folder. Abruptly closing a VM is likely to result in corruption yes, but you don't get to control what is corrupted!
Alooha
Posts: 61
Joined: 27. Dec 2009, 21:13
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: MX Linux

Re: Maschine ausschalten und alles löschen von der letzten Session

Post by Alooha »

I would like to know how to close the machine so that nothing from the actual session is saved.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Maschine ausschalten und alles löschen von der letzten Session

Post by mpack »

If you want to be able to start a VM fresh each time then look at the immutable drive feature. If it is specifically Firefox you want to mess with then you'd have to ask that question on Firefox forums.
Alooha
Posts: 61
Joined: 27. Dec 2009, 21:13
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: MX Linux

Re: Maschine ausschalten und alles löschen von der letzten Session

Post by Alooha »

I found "immutable image" not "drive"
What I want is that if I catch malware during a session, it is gone when I switch off the machine, so that it starts virus-free the next time.
For me that's the main purpose of running a virtual machine.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Maschine ausschalten und alles löschen von der letzten Session

Post by mpack »

Alooha wrote: For me that's the main purpose of running a virtual machine.
All that a VM is usually expected to do in that regard is keep the host safe, not itself.
Alooha wrote:I found "immutable image" not "drive"
These are two words for the same thing. Disk images are used as virtual drives in a VM.

In any case it has become clear that all you need to do is take regular VM backups, or just a snapshot. If a guest infection is found then restore from the backup, or revert to the snapshot.
fth0
Volunteer
Posts: 5677
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Maschine ausschalten und alles löschen von der letzten Session

Post by fth0 »

FWIW, I'm using VM snapshots instead of the immutable property:

After I've setup a new VM for the first time, I create a snapshot called "Base". For testing purposes, I run the VM, do some tests and close the VM by using the VM window's close button and selecting "Power off the machine" > "Restore current snapshot 'Base'". When updating the VM, I run the VM, update the guest, properly shut down the VM from within the guest OS, delete the previous snapshot and recreate it. Of course, more complex workflows are possible.
Alooha
Posts: 61
Joined: 27. Dec 2009, 21:13
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: MX Linux

Re: Maschine ausschalten und alles löschen von der letzten Session

Post by Alooha »

This is all rather complicated.
How can I make an image (= synonymous with snapshot?) immutable?
properly shut down the VM from within the guest OS
What do you mean by properly?
delete the previous snapshot and recreate it
By "recreate it" you mean that you take a new one?
fth0
Volunteer
Posts: 5677
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Maschine ausschalten und alles löschen von der letzten Session

Post by fth0 »

Snapshots and immutable images are two independent features of VirtualBox, and you can read about them in the VirtualBox User Manual.

The term "properly" is superfluous here. I just mean to use the shutdown functionality of the guest OS, instead of alternative methods like closing the VM's window using its red X button.

Yes, I mean taking a new snapshot.

BTW, thanks for asking, you're helping me to enhance my written English language proficiency. :)
Alooha
Posts: 61
Joined: 27. Dec 2009, 21:13
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: MX Linux

Re: Maschine ausschalten und alles löschen von der letzten Session

Post by Alooha »

When I press the X in the upper right corner of the window, the "Close Virtual Machine" window appears. If I select the option "Power off the Machine" and check the box "Restore Current Snapshot [name of snapshot]" and start again from this snapshot then everything is gone from the previous session, so that should be the (one) correct method!
fth0
Volunteer
Posts: 5677
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Maschine ausschalten und alles löschen von der letzten Session

Post by fth0 »

Yes, that's the correct normal workflow. But once in a while, you'll probably want to update the guest OS and keep the changes, and then you need the other workflow I described.
Alooha
Posts: 61
Joined: 27. Dec 2009, 21:13
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: MX Linux

Re: Maschine ausschalten und alles löschen von der letzten Session

Post by Alooha »

For every change change that I want to be persistent, I make a new snapshot and give it the current date as the name and then start again from this snapshot the next time.

What I don't understand is how to manage the snapshots.

What actually happens if I select the option "Power off the Machine" but do not tick "Restore Current Snapshot [name of snapshot]" in the method I described earlier for closing, i.e. when I press the cross to close?
fth0
Volunteer
Posts: 5677
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Maschine ausschalten und alles löschen von der letzten Session

Post by fth0 »

Alooha wrote:What actually happens if I select the option "Power off the Machine" but do not tick "Restore Current Snapshot [name of snapshot]" in the method I described earlier for closing, i.e. when I press the cross to close?
That's the equivalent of pulling the power plug of a real PC from the wall socket: At the next power up, in the best case the PC/VM will continue to work with all data intact, in the worst case it will never run again. The truth often lies between those two extremes. ;)
Alooha wrote:What I don't understand is how to manage the snapshots.
Did you read the corresponding chapters in the VirtualBox User Manual (1.10. Snapshots, 5.5. Differencing Images)? In short, after you've created the new snapshot, you can delete the previous one (using the VirtualBox Manager, of course), and the contents will be merged automatically.
Alooha
Posts: 61
Joined: 27. Dec 2009, 21:13
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: MX Linux

Re: Maschine ausschalten und alles löschen von der letzten Session

Post by Alooha »

Even after studying the instructions, I still don't understand how to convert a normal image into an "immutable".
fth0
Volunteer
Posts: 5677
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Maschine ausschalten und alles löschen von der letzten Session

Post by fth0 »

Alooha wrote:Even after studying the instructions, I still don't understand how to convert a normal image into an "immutable".
Ok, I can understand that. :)

Regarding making a virtual disk image immutable, the VirtualBox User Manual only describes the method using 8.22 VBoxManage modifymedium. There's an easier way indeed: In the VirtualBox Manager, open the Virtual Media Manager, select the virtual disk image and change the Type in the Properties dialog.

Note that immutable images are rarely used in practice, contrary to snapshots, and you can shoot yourself in the foot when combining immutable images with snapshots. That's why I do not encourage using immutable images and why I prefer snapshots.
Post Reply