Making a virtual hard drive immutable

Discussions related to using VirtualBox on Windows hosts.
Post Reply
20110101
Posts: 5
Joined: 20. Jan 2011, 20:23
Primary OS: Linux other
VBox Version: PUEL
Guest OSses: dos

Making a virtual hard drive immutable

Post by 20110101 »

I obviously don't understand something very basic here.

After many hours of configuration, I finally have the guest os image exactly the way I want it.

So I want to make it immutable.

I did:

Code: Select all

VBoxManage modifyhd /FULL/path/to/disk/image.vdi settype immutable
Now I get a message:

Code: Select all

The selected virtual machine in inaccessible. Please inspect the error message shown below and press the [bold]Refresh[/bold] button if you want to repeat the accessibility check:

Immutable hard disk '/FULL/path/to/disk/image.vdi' with UUID {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} cannot be directly attached to the virtual machine 'virtual' ('/home/user/.VirtualBox/Machines/virtual/virtual.xml').
Result Code: 
NS_ERROR_FAILURE (0x80004005)
Component: 
Machine
Interface: 
IMachine {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
Please enlighten me as to how to create and use an immutable disk image.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Making a virtual hard drive immutable

Post by mpack »

Which VirtualBox version number?
20110101
Posts: 5
Joined: 20. Jan 2011, 20:23
Primary OS: Linux other
VBox Version: PUEL
Guest OSses: dos

Re: Making a virtual hard drive immutable

Post by 20110101 »

mpack wrote:Which VirtualBox version number?
I originally created the virtual machine (and ran into the problem) on 3.2.12. I have since upgraded to 4.0.0 (hoping, but not really expecting, that it would help).

Somebody moved this to post "VirtualBox on Windows Hosts." As seems obvious (at least to me) from the machine path, this issue involves virtualbox running on a linux host.
raistlin majere
Posts: 4
Joined: 20. Jan 2011, 12:50
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: WinXP

Re: Making a virtual hard drive immutable

Post by raistlin majere »

Have you tried using the uuid instead of the full path to the vdi file?
I used:

Code: Select all

VBoxManage modifyhd <uuid> --type immutable
Works fine for me :)

Just make sure that the uuid in use is the one of the hard disk, not the machine uuid. You can use:

Code: Select all

VBoxManage showvminfo <VM name>
and under "IDE Controller" you have the uuid for the hard disk in use. Also, in version 4, in your home dir you have a dir "VirtualBox VMs". Check the *.vbox file to see the configuration of your VM and to see the uuid for the hard disk.

Hope this hepls!

PS If I'm wrong, someone please tell me :))
20110101
Posts: 5
Joined: 20. Jan 2011, 20:23
Primary OS: Linux other
VBox Version: PUEL
Guest OSses: dos

Re: Making a virtual hard drive immutable

Post by 20110101 »

raistlin majere wrote:Have you tried using the uuid instead of the full path to the vdi file?
I used:

Code: Select all

VBoxManage modifyhd <uuid> --type immutable
Works fine for me :)
Now I feel more lost than ever.

When I ran VBoxManage, it appeared to work correctly (making the disk image immutable).

The problem is that I can't seem to attach the disk image back to the virtual machine (why?).
raistlin majere wrote:

Code: Select all

VBoxManage showvminfo <VM name>
Certainly a useful command to know, but it doesn't do anything to help with this problem.
raistlin majere wrote:and under "IDE Controller" you have the uuid for the hard disk in use.
It's under the sata controller, which was the default when I set up the machine.
raistlin majere wrote:Also, in version 4, in your home dir you have a dir "VirtualBox VMs". Check the *.vbox file to see the configuration of your VM and to see the uuid for the hard disk.
Sorry, I don't see anything like that. Would that exist for machines originally created with virtualbox 3?
raistlin majere wrote:Hope this hepls!
Sorry, it didn't. :(
Post Reply