Possible to make differencing disk "immutable"?

This is for discussing general topics about how to use VirtualBox.
Post Reply
kebabbert
Volunteer
Posts: 321
Joined: 31. May 2008, 10:00
Primary OS: OpenSolaris 11
VBox Version: OSE other
Guest OSses: WinXP, RedHat, Ubuntu

Possible to make differencing disk "immutable"?

Post by kebabbert »

I have a immutable vdi. Ontop the immutable vdi, I have made a differencing disk (I created a new virtual machine based on the immutable VDI) and installed some software.

Now I want to make the differencing disk immutable. But the differencing disk is not a VDI file, it is a snapshot, as it shows up as a "Snapshot" in the "/Machines/.../Snapshots" folder.

Can I make the differencing disk immutable? Or is it not a differencing disk, it is actually a snapshot that I try to make immutable?

I want to create new virtual machines, based on a immutable differencing disk.


I noticed a "Differencing Disks" checkbox in the "Storage" tab. Is it of any use?
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Possible to make differencing disk "immutable"?

Post by Sasquatch »

Just tried to change a snapshot file to immutable, this is the result:

Code: Select all

VBoxManage modifyhd bb2498b9-5ec4-4e0f-9a5a-928facb7d25a --type immutable
Oracle VM VirtualBox Command Line Management Interface Version 3.2.8
(C) 2005-2010 Oracle Corporation
All rights reserved.

ERROR: Cannot change the type of medium '/media/VMs/Virtual Machines/Windows 7/Snapshots/{bb2498b9-5ec4-4e0f-9a5a-928facb7d25a}.vdi' because it is a differencing medium
Details: code NS_ERROR_FAILURE (0x80004005), component Medium, interface IMedium, callee nsISupports
Context: "COMSETTER(Type)(DiskType)" at line 444 of file VBoxManageDisk.cpp
So, you can't make snapshots or differencing disks immutable. You have to merge the snapshot to the base VDI and build a new immutable VDI with that.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
kebabbert
Volunteer
Posts: 321
Joined: 31. May 2008, 10:00
Primary OS: OpenSolaris 11
VBox Version: OSE other
Guest OSses: WinXP, RedHat, Ubuntu

Re: Possible to make differencing disk "immutable"?

Post by kebabbert »

That is strange. Basically, I just want to chain differencing disks

http://www.virtualbox.org/manual/ch05.html#diffimages
"Differencing images can be chained. If another differencing image is created for a virtual disk that already has a differencing image, then it becomes a "grandchild" of the original parent. The first differencing image then becomes read-only as well, and write operations only go to the second-level differencing image. When reading from the virtual disk, VirtualBox needs to look into the second differencing image first, then into the first if the sector was not found, and then into the original image."

A) I have immutable VDI: Windows XP
B) I have a differencing disk based on immutable VDI: Windows XP + Firefox. (I only install Firefox here).
c) Now I want to chain another differencing disk ontop B) so I have a image looking like: Windows XP + Firefox + VisualStudio (I only install VisualStudio here)

Is this not possible to do? Or must I use snapshots?
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Possible to make differencing disk "immutable"?

Post by Sasquatch »

From what I understand is that it's another snapshot that you will create to get what you want. Since there are only 4 kinds of disks (normal, writethrough, immutable and shareable) for the modifyhd option, the differencing the manual talks about has to be a snapshot. Or a similar kind like one that gets created for immutable disks.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
kebabbert
Volunteer
Posts: 321
Joined: 31. May 2008, 10:00
Primary OS: OpenSolaris 11
VBox Version: OSE other
Guest OSses: WinXP, RedHat, Ubuntu

Re: Possible to make differencing disk "immutable"?

Post by kebabbert »

I dont really understand the manual on "chaining differencing disks"

I revert my immutable VDI to normal VDI, then install Firefox. Then make a snapshot. Then make the VDI immutable. Then I make a differencing disk and install VisualStudio?

So I can not make a differencing disk, ontop another differencing disk, ontop another differencing disk, ontop ....?
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Possible to make differencing disk "immutable"?

Post by Sasquatch »

That's the whole problem with technical terms, it's not always done consistently. You can create snapshot over snapshot, so I'm guessing this is what the manual is talking about with chaining differencing disks. You chain snapshots.

I hope a dev comes by soon to give more information about the works here.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
kebabbert
Volunteer
Posts: 321
Joined: 31. May 2008, 10:00
Primary OS: OpenSolaris 11
VBox Version: OSE other
Guest OSses: WinXP, RedHat, Ubuntu

Re: Possible to make differencing disk "immutable"?

Post by kebabbert »

Ok, no developer has responded in this thread.

Do you think Snapshots could work in my case? I need to setup Firefox and then do a snapshot.

The purpose is to surf on unsecure websites. I want to rollback after every surf session. How would you solve this problem?
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Possible to make differencing disk "immutable"?

Post by Sasquatch »

To do that, you have to remove the snapshot (not merge it) every time you want to 'forget' what you did and recreate the snapshot. It's easier to make a base image without snapshots and make that VDI immutable.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
4sound
Posts: 4
Joined: 12. Aug 2010, 02:41
Primary OS: MS Windows Vista
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: windows xp

Re: Possible to make differencing disk "immutable"?

Post by 4sound »

simply create a new machine, then copy default machines xml file contents to an appropriate file in a new machine replacing machines GUID.
Now restore one snapshot in default machine and other in the new one.
it will now be possible to use same differencing image in two online machines.
You should not change disk type. It works well for me. Please reply if it works in your case ether and we could submit a feature request if it is correct to use such config.
Post Reply