Page 1 of 1

uuid

Posted: 18. Aug 2008, 13:35
by Dejavou42
somehow I have my windows VM associated with root. when I run VBox as sudo, everything works great, when I open it as my user ,I get:
actual uuid of hard disk image does not match uuid stored in registry.


Does anyone know how I might change this?

Posted: 18. Aug 2008, 16:42
by TerryE
Unless you are setting and exporting VBOX_USER_HOME then by default Virtualbox picks up its root folder from $HOME/.VirtualBox and when you are running in
  • your user account (let's call is fred) $HOME is /home/fred and you are in your "home" UID/GID.
  • in sudo command $HOME is /home/fred and you are in you (0,0)
  • in sudo -i $HOME is /root and you are in you (0,0)
    • hence it is very easy to get in a muddle. Normally the reason that people end up using sudo is if they are using rawvmdk because by default users do not have r/w access to underlying partitions so the rawvmdk only works is you start up Virtualbox with sudo (unless you start changing device permissions during boot).

      If you are not using raw partitions or sudo -i then the best thnig to do is sudo chown -R your entire $HOME/.VirtualBox hierarchy back to your home UID and GID.

      If you are using sudo -i then don't and come back here.

uuid difference

Posted: 18. Aug 2008, 17:13
by Dejavou42
I didn't quite catch that.....

basically what I have done is created a .mbr that is located in my home folder. I have the .vdi file in an entirely different hard drive. one that I have permanently mounted on /mnt/sdb1. The hard drive was a previous windows partition, but because of a virus I erased that partition and started from new, setting up windows as a virtual machine instead of a native system. The same hard drive had another partition, which I mounted to /mnt/sdb5. This partition had all of my storage files from my old windows xp native system. I left this intact and created a file share partition (one that both linux and my VM could access. I have created a network bridge to give my VM a local IP. That said, when I run "sudo VBoxSDL -startvm vm name" linux boots up my xp system. If I leave out the sudo or open VB from the applications menu, I get error: uuid of actual hard disk image does not match uuid of stored registry.

you may have answered my question with the last reply, but being the noob that I am didn't totally comprehend it. Thanks for the help though.

Posted: 18. Aug 2008, 18:03
by TerryE
Do me a favour and do an ls -lR of your VDIs directory and your machine directory and post them back. I think you've got an ownership issue / protections issue.

uuid

Posted: 19. Aug 2008, 04:16
by Dejavou42
here is the command with the response.

Code: Select all

myron@ubuntu:~$ ls -ir /mnt/sdb1
13504 Myron.vdi
myron@ubuntu:~$ ls -IR /mnt/sdb1
Myron.vdi
myron@ubuntu:~$ ls -IR /home/myron

Posted: 19. Aug 2008, 12:09
by Sasquatch
This is not the output we need. You mistook the small 'l' for a capital 'i'. You need:

Code: Select all

ls -lR
With that, you should get something like this as output:

Code: Select all

-rwxrwxrwx 1 sasquatch sasquatch  452 2008-06-28 12:06 New Text Document.txt

uuid

Posted: 20. Aug 2008, 04:58
by Dejavou42

Code: Select all

 myron@ubuntu:~$ ls -l /mnt/sdb1
total 10647432
-rwxrwxrwx 1 root root 10949291008 2008-08-18 11:24 Myron.vdi
l did mistake the lowercase L for a capital i.. Anyway, there is the output. I had given world complete world access to the file, but I still got the uuid difference message when I open VBox without using sudo.

Posted: 20. Aug 2008, 10:55
by Sasquatch
Do a chown on the file. You are not the owner of the file, and VB asks that either you, or your group is the owner. See the man page on how to use chown.

Posted: 20. Aug 2008, 14:20
by TerryE
I've just reread your post. You are focusing in on /mnt/sdb1 but you also say
The same hard drive had another partition, which I mounted to /mnt/sdb5. This partition had all of my storage files from my old windows xp native system. I left this intact and created a file share partition (one that both linux and my VM could access.)
So are you saying that you have a rawvmdk mapping /mnt/sdb5 that you are also trying to mount? This will fail for a user account unless you have access to the device. Clearly root does. Devices are typically owned by the group disk so adding your account to this group will achieve what you need, but this is a dangerous weapon: any process you run can write to and corrupt any of your file systems. As the manual says: using raw partitions is an advanced topic.

BTW just include the full error message in a code block, will you?

uuid

Posted: 26. Aug 2008, 02:35
by Dejavou42
Sorry it has taken me so long to reply. Things have been hectic around here.

It isn't a rawvmdk, but instead its a .vdi file. The windows xp is an entirely virtual machine. A master boot record points to the .vdi file from /home/myron and the .vdi file is stored in a seperate hard drive than the linux system located in /mnt/sdb1. The entire error log is:

Code: Select all


VM cannot start because the hard disk '/mnt/sdb1/Myron.vdi' is not accessible (Actual UUID {95cbd806-afa0-4db1-c3a7-9e2aab9cc05a} of the hard disk image '/mnt/sdb1/Myron.vdi' doesn't match UUID {45f64a35-9bb7-49b5-37af-6ac44a2c49f0} stored in the registry).


Result Code: 
0x80004005
Component: 
Console
Interface: 
IConsole {d5a1cbda-f5d7-4824-9afe-d640c94c7dcf}

 
Thanks for all the help everyone.

Posted: 26. Aug 2008, 04:33
by TerryE
This is a good example of where quoting the exact error tells all. The VDI embeds its own UUID and the registry records one UUID, e.g.:

Code: Select all

    <DiskRegistry>
      <HardDisks>
        ...
        <HardDisk uuid="{45f64a35-9bb7-49b5-37af-6ac44a2c49f0}" type="normal">
          <VirtualDiskImage filePath="/mnt/sdb1/Myron.vdi"/>
        </HardDisk>
        ...
      </HardDisks>
      ...
    </DiskRegistry>
where the UUID in the VDI itself is {95cbd806-afa0-4db1-c3a7-9e2aab9cc05a}. I don't know this mismatch occurred. Perhaps at some point you did a clone vdi. However, the point is that whilst the VDI is unique, the registry is on a per user basis, since its location is $HOME/.VirtualBox/VirtualBox.xml and $HOME will be different for root and your normal logon user account. So lesson 1 is
only register a VDI with one user account at one time. And lesson 2 is avoid running VBox from root. It is just too dangerous.

There are times when I run VBox from special service accounts. For example, I have one with the disk group so that I can access raw partitions, but in this case I use VBOX_USER_HOME to point back to my logon registry and have my group privileges set up so that these users have full rwx control over the VirtualBox file hierarchies.

In this case you need to unregister the root VM and VDI (make sure you don't delete it!). You need to sudo chown all the file back to you own UID:GID ownership. You need to (temporarily) remove the VDI from you home user VM; unregister the VDI; register it; and add it back to the VM. This "bounce" will reset the UUIDs correctly.

uuid

Posted: 27. Aug 2008, 02:15
by Dejavou42
In this case you need to unregister the root VM and VDI (make sure you don't delete it!). You need to sudo chown all the file back to you own UID:GID ownership. You need to (temporarily) remove the VDI from you home user VM; unregister the VDI; register it; and add it back to the VM. This "bounce" will reset the UUIDs correctly.
*(whooosh) - that flew right over my head.

so, I unregister the VDI (located in /mnt/sdb1). I suppose I open VBox and Release it with the Virtual Disk Manager to do this.

then I sudo chown /mnt/sdb1 to my user. (sounds easy enough) :

Code: Select all

 sudo  chown -r myusername /mnt/sdb1 && chown -r  myusername /mnt/sdb1/XP.vdi
yeah I'm lost.....

sorry to be such a noob here. Keep the help (and patience) coming... :D

Posted: 27. Aug 2008, 04:21
by TerryE
In general I would recommend keeping file system roots and their mount points owned by root. What is bad practice here is putting your VDIs into the root of the mounted file system. At a minimum I would expect a container directory, say VDIs or myusername/VDIs, at the root of the FS, hence the indivual VDIs would be
  • /mnt/sb1/myusername/VDIs/Myron.vdi
and you could even set up your preferences so that this directory would be the default folder for your VDIs (Ctl+G in the GUI). You would sudo mv your VDIs into this directory (after unregistering them) and then

Code: Select all

sudo chown -R myusername:myusergroup /mnt/sb1/myusername
and then register them and add them back into your VMs. Once you own the directory, you have full control over it without needing sudo. You should not need to sudo as part of your normal work cycle.

Any clearer? Come back if you need more help.

uuid

Posted: 28. Aug 2008, 16:56
by Dejavou42
Much Clearer! Thanks for all of the help and patience on this one Terry. Two last questions though.

1. to properly unregister a .VDI do I have to use the command line to do that, or does "releasing" the .vdi with the VirtualBox disk manager do the same thing?

2. Since this is my first virtual machine I wonder about how to treat a .VDI file. What I mean is a VDI file as corruptible as a normal operating system, or could I, say, move the file from my linux box to another linux box, register the .VDI file, and successfully boot up the Virtual Machine?

Thanks Again!

Posted: 28. Aug 2008, 17:30
by Sasquatch
Releasing a VDI is not the same as unregistering it. Releasing it unmounts it from the VM, unregistering it will remove it from the list and ask you to remove it from disk too.

The VDI file is just one big archive where an OS is installed on. If you would copy/move it to a different computer that has VB installed, you can use the same VDI there without problems. Of course, it's best to use the VDI in a VBox that has the same version as it was created on, or newer.