2014年4月13日 星期日

Using VirtualBox raw disk on Win7



  1. Offline the Physical Disk 0 and clear the read-only flag
    1. run diskpart.exe
    2. run "SELECT DISK 0" -- 0 is the physical disk I would like to use.
    3. run "OFFLINE DISK"
    4. run "ATTRIBUTES DISK CLEAR READONLY"
    5. run "ATTRIBUTES DISK" to check the readonly flag has been cleared.
  2. Create the raw disk in the Virtualbox Host - Ubuntu-Local
    1. Open up a command prompt.
    2. cd C:\Program Files\Oracle\VirtualBox
    3. VBoxManage internalcommands createrawvmdk -filename "G:\Ubuntu.vmdk" -rawdisk "\\.\PhysicalDrive0"
    4. VBoxManage storageattach "Ubuntu-Local" --storagectl "IDE" --port 0 --device 0 --type hdd --medium G:\Ubuntu.vmdk
      (Noted: You are able to create this by VirtualBox GUI, but be sure to run as an administrator when launching VirtualBox GUI)
  3.  Run VirtualBox as an administrator