segunda-feira, 13 de maio de 2013

How to install a Raw Disk on MacOS host with an Windows 7 Guest

Well, today I had great difficult to mount a SDCard on my Windows 7 virtual machine created with Virtualbox. So I decide create this topic to help people like me.
Enough talking let's do this.
In first place open a Terminal and allow sudo access, more information at: http://support.apple.com/kb/HT4103
Then you need discover where is mounted your SDCard. Use the command

mount

The exit will show yours mounted disks, mine looks like this:


/dev/disk0s2   112Gi   90Gi   22Gi    81%    /
devfs          187Ki  187Ki    0Bi   100%    /dev
map -hosts       0Bi    0Bi    0Bi   100%    /net
map auto_home    0Bi    0Bi    0Bi   100%    /home
/dev/disk1s1   1.9Gi  441Mi  1.5Gi    23%    /Volumes/SMI

Where /dev/disk1s1 is my SDCard storage, my disk is disk1 and the partition is s1
Unmount it with the command:

diskutil unmount /Volumes/SMI/

And then, list all partitions on the disk with the follow command:

vboxmanage internalcommands listpartitions -rawdisk /dev/disk1

Like said before, in my case I have only one partition:


Number  Type   StartCHS       EndCHS      Size (MiB)  Start (Sect)
1       0x06  0   /3  /63  982 /54 /54          1934          251

Now we have to create a RawDisk to be read on VirtualBox

vboxmanage internalcommands createrawvmdk -filename ~/SDCARD.vmdk -rawdisk /dev/disk1s1

You should see an exit like:

RAW host disk access VMDK file /Users/myuser/SDCARD.vmdk created successfully

Now give permission then Windows will be able to read and write into the disk:

chown mysuser ~/SDCARD.vmdk

Where is shown myuser should be replaced by your user that is running Virtualbox
Last step:

chmod 766 ~/SDCARD.vmdk

Now just mount as "Existing Disk" in VirtualBox Storage tab.
That's it, any doubt let me known.

Edited.

You may have problems with some access permission, for example:
Error opening the raw disk: VERR_ACCESS_DENIED
This can be fixed executing this command:

chmod 666 /dev/disk1

Thank you.

Nenhum comentário:

Postar um comentário