Halaman

Selasa, 03 Agustus 2010

http://sentientmobile.com/jshaw/blog/post/2009/08/26/Running-VirtualBox-on-a-Windows-Vista-bootcamp-partition-in-Mac-OS-X.aspx


VirtualBox is an open-source virtualization software from Sun much like VMWare and Parallels, but free for personal use!  I just tried it out on my Mac OS X to run a Windows Vista VM on a physical Windows Vista partition created through bootcamp, and thought I'd share my experience (and to write down for myself for future reference :)).  



I had googled and found someone doing very similar thing on a Ubuntu machine.  Most of the info is pretty relevant on a Mac OS X as well, except that I couldn't use the solution of assigning my user account to the "disk" group; there's no "disk" group on Mac OS X.  The other solution mentioned of changing permission works however.  Here's exactly what I did:



0. Read the relevant part of the VirtualBox User Manual regarding using raw partition ("9.10.2 Access to individual physical hard disk partitions").



1. Locate the device and partition holding your Windows Vista partition (e.g, using "df -k" command):




jshawsworlds-macbook:~ jshawsworld$ df -k

Filesystem    1024-blocks     Used Available Capacity  Mounted on

/dev/disk0s2     73269248 31999364  41013884    44%    /

devfs                 110      110         0   100%    /dev

fdesc                   1        1         0   100%    /dev

map -hosts              0        0         0   100%    /net

map auto_home           0        0         0   100%    /home

/dev/disk0s3     82685740 56175456  26510284    68%    /Volumes/Untitled

/dev/disk1s1        15632      144     15488     1%    /Volumes/CANON_DC

/dev/disk2s1    334784000 46614707 288169292    14%    /Volumes/My Book

/dev/disk2s2    153600000 29766376 123833624    20%    /Volumes/Mac OS Partition 2



For me, for example, I know the Windows partition is /dev/disk0s3.



2. Back up your existing Windows Vista partition, to a external drive for example, since you might damage the Windows paritition in this exercise and render it unusable!  One free tool I find pretty reliable in backing up and restoring Windows partition is winclone.



3. Change to root to do the next few commands:




sudo su




You may need to enable root user by going to the "Directory Utility" app, click on the lock icon, and then Edit->Enable Root User.



4. Unmount the Vista partition in Mac OS X if you currently have it mounted, since we don't want VirtualBox accessing it at the same time that Mac OS is accessing it:




umount /dev/disk0s3



and make sure it has been unmounted (i.e.,  the directory /Volumes/Untitled is empty in my case).



5. Change the device to read/write, which is needed by VirtualBox as stated in the user manual:




chmod 666 /dev/disk0*




Note that you have to change permission for all of disk0, not just the Windows parition (hence the "disk0*"), since createrawvmdk needs to access disk0 as well as disk0s3.




6. Run the command




VBoxManage internalcommands createrawvmdk -filename /Users/jshawsworld/WinVista.vmdk -rawdisk /dev/dev0 -partitions 3 -relative




7. Finally change the owner to your user account for the vmdk file you just created as root, so you can access it as yourself when running VirtualBox later:




chown jshawsworld /Users/jshawsworld/*.vmdk




8. Run VirtualBox from Finder, and browse to the vmdk file. 



9. Make sure that "IO APIC" and "VT-x/AMD-V" in your Virtual Machine Settings are both on, and then start the VM.  It should start.



Even though I got it working, it was painfully slow..., even after giving it 2 GB of memory.  I had tried VMWare Fusion to do the same thing before, and remember it wasn't any faster.  To really work efficiently in Windows I think booting to it via bootcamp is still the way to go.  XP might be faster; who knows maybe Windows 7 will be much faster.  For light-weight OS's (like Linux) running it as a VM is definitely the way to go.

Tidak ada komentar: