Accessing raw partitions with VMDK 2/2

Categories:  linux,
Labels:  OS, virtualization

All the examples that I see are for chmod on a mounted filesystem…..and apparently the partition that VirtualBox accesses shouldn’t be mounted.

Postby achimha » 7. Jun 2007, 16:01
First make sure /dev/sda2 and /dev/sda6 are not mounted. Then issue as root:

# chmod 777 /dev/sda2
# chmod 777 /dev/sda6

Of course 777 is not the best solution but it will show you the direction.

Postby kilou » 7. Jun 2007, 16:19
Thanks achimha but I still have the same problem. I did:

1) $ unmount /dev/sda2
2) $ sudo chmod 777 /dev/sda2
3)

$ sudo VBoxManage internalcommands createrawvmdk -filename /home/kilou/.VirtualBox/WinXP.vmdk -rawdisk /dev/sda -partitions 2 -relative -register

…and virtualdisk manager still warns that the registred virtual hardisk is not accessible.

Postby nuudles » 7. Jun 2007, 19:31
kilou wrote:
Thanks achimha but I still have the same problem. I did:

1) $ unmount /dev/sda2
2) $ sudo chmod 777 /dev/sda2
3)

sudo VBoxManage internalcommands createrawvmdk -filename /home/kilou/.VirtualBox/WinXP.vmdk -rawdisk /dev/sda -partitions 2 -relative -register

…and virtualdisk manager still warns that the registred virtual hardisk is not accessible. Try this:

1) $ sudo su
2) $ umount /dev/sda2
3) $ chmod 666 /dev/sda*
4)

$ VBoxManage internalcommands createrawvmdk -filename /home/kilou/.VirtualBox/WinXP.vmdk -rawdisk /dev/sda -partitions 2 -relative -register

5)

$ chown kilou:users /home/kilou/.VirtualBox/WinXP.vmdk  

6) $ exit

Postby achimha » 7. Jun 2007, 19:53
you have to sudo chown kilou /home/kilou/.VirtualBox/WinXP.vmdk as well.

Postby PFilter » 7. Jun 2007, 20:05
kilou wrote:
Thanks achimha but I still have the same problem. I did:

1) $ unmount /dev/sda2
2) $ sudo chmod 777 /dev/sda2
3)

$ sudo VBoxManage internalcommands createrawvmdk -filename /home/kilou/.VirtualBox/WinXP.vmdk -rawdisk /dev/sda -partitions 2 -relative -register

…and virtualdisk manager still warns that the registred virtual hardisk is not accessible.

Each time you recreate the vmdk you will need to re-register it. VBox keeps a hash(MD5?) of somekind and if the file is replaced, even if the name is the same, you have to delete it from the Virtual Disk Manager and add it again.

Postby kilou » 7. Jun 2007, 21:52
Still no luck on my side :( I did:

1) $ sudo su
2) $ umount /dev/sda2
3) $ chmod 666 /dev/sda2 (also tried with 777)
4)

$ VBoxManage internalcommands createrawvmdk -filename /home/kilou/.VirtualBox/WinXP.vmdk -rawdisk /dev/sda -partitions 2 -relative -register

5) $ chown kilou:users /home/kilou/.VirtualBox/WinXP.vmdk

Now I don’t get any message when starting VirtualBox but when I launch virtual disk manager it is empty (the created vmdk disk is not registred?). I tried to click “Add” and then there are 2 vmdk files: WinXP.vmdk and WinXP-pt.vmdk. Selecting either of those files makes a popup message appear saying:

##############################################

Failed to register the hardisk /home/kilou/.VirtualBox/WinXP.vmdk


Could not access hard disk image /home/kilou/.VirtualBox/WinXP.vmdk
(VERR_VDI_INVALID_SIGNATURE)

Result Code:
0x80004005
Component:
HardDisk
Interface:
IHardDisk {fd443ec1-000f-4f5b-9282-d72760a66916}
Callee:
IVirtualBox {d1a2295c-d257-4a4c-a9a6-843d87db6f45}
###############################################

I tried to do the same but creating a vmdk file with another name but I still can’t access it. :?
Postby nuudles » 7. Jun 2007, 22:09
Like I said, you should try this:

chmod 666 /dev/sda*
I think your problem is the permissions on /dev/sda and not /dev/sda2

source

Social Profiles

This web accept cryptocoin donations
BTC address, LTC, ETH, DASH, Uphold:
Why donations?