VMware Communities
SvenGus
Expert
Expert

Virtualise a physical Mac OS X Server HD

There was a similar thread in the old beta forum, some time ago:

http://communities.vmware.com/thread/263475

... so I thought that I would share my most recent experiences on this...

I did this on a new mid-2010 Mac mini Server, with OS X Server 10.6.5 (re)installed on the upper drive (disk1) and OS X client 10.6.5 (and Fusion, etc.) installed on the lower drive (disk0😞 i.e., with the computer used mainly as a client desktop rather than a server, so virtualising the server OS might be the most convenient solution, while also being able to natively boot into the server; or maybe I'll return to a file-based server VM, we'll see*...

... So, you want to virtualise a whole HD with OS X Server installed? Here is what I did:

1. Create a new Mac OS X Server (10.6 and 64-bit, in this case) VM and customise its settings (I named it Mac OS X Server and created it in /Users/Shared/Virtual\ Machines.localized).

2. Delete the virtual file-based 40 GB SCSI .vmdk which was automatically created during the VM setup (from within the VM settings; I also reverted it to a non-split disk before).

3. Exit Fusion.

4. Enter the Terminal, and execute this command (but YMMV with the physical disk number and the VM path):

/Library/Application\ Support/VMware\ Fusion/vmware-rawdiskCreator create /dev/disk1 fullDevice /Users/Shared/Virtual\ Machines.localized/Mac\ OS\ X\ Server.vmwarevm/Mac\ OS\ X\ Server lsilogic

5. Open the VM's .vmx configuration file in a text editor (TextEdit or similar), add these lines and save (see also the previous thread):

suspend.disabled = "TRUE"

scsi0:0.deviceType = "rawDisk"

6. Run the Mac OS X Server VM (the first time, you will have to authenticate - which is optional subsequently - and there will probably be a message saying that a raw SCSI disk might be slow with dual booting, etc., or something like that): and voilà - it should work as if it were a "real" Boot Camp partition VM! Smiley Happy :smileycool:

At least, the procedure above worked for me; of course, then, you also have to install the VMware Tools and, optionally, the third party VMsvga2 audio drivers (a SourceForge project: they also have enhanced video drivers): BTW, more complete "official" VMware Tools for Mac OS X would be a very good thing for Fusion 4…

(... And I hope that I listed all steps: but correct me, if perhaps I have forgotten something.)

P.S.: I had to choose SCSI (as it also were in the originally created file-based VM), because IDE didn't work: it gave a bus error when trying to create the "Boot Camp-like" .vmdk with the fullDevice parameter; maybe because the internal Mac mini Server HDs are SATA, or because it is Mac OS X, or even because the OS is on a GPT-formatted HD? Don't know...

* See also the next post...

Reply
0 Kudos
11 Replies
SvenGus
Expert
Expert

OTOH, if you want to create an "ordinary", file-based Mac OS X Server VM, but only have a machine-specific install DVD (such as the one that comes with the new Mac mini Server), you must be a little creative...

Create the VM as usual, customise it and exit Fusion; then, mount the VM in the Finder with VMDKMounter (located in the /Library/Application\ Support/VMware\ Fusion folder), and - instead of booting the VM from the DVD - open /Volumes/Mac\ OS\ X\ Server\ Install\ Disc/System/Installation/Packages/OSInstall.mpkg (it's invisible, so you might need TinkerTool, or something similar, or simply the Terminal*) located on the DVD and install OS X Server on the mounted disk image directly from there: as you now install from your original machine (but on another HD), it will work (and if you want to change the default 40 GB virtual HD size, which might be a little small, you can reformat** the mounted virtual hard drive with Disk Utility before installing OS X Server onto it).

Certainly, it's easier to manage file-based VMs, so I might go back to using the upper drive in the Mac mini Server as a dedicated VM storage HD and thus install OS X Server in an "ordinary" VM.

* That is, simply type open /Volumes/Mac\ OS\ X\ Server\ Install\ Disc/System/Installation/Packages/OSInstall.mpkg in the Terminal.

** After of course having changed its size in the VM's virtual hard drive settings.

Reply
0 Kudos
SvenGus
Expert
Expert

So, I just went back to an ordinary, file-based Mac OS X Server VM, which I installed as described before; I also applied the 10.6.5 Server Combo updater directly onto the mounted virtual HD.

But there was a little glitch at the first boot, with the OS X Server setup assistant: an empty country/region window, so the setup couldn't proceed: luckily, however, a simple reboot fixed the problem, and then the country/region screen appeared correctly. Perhaps it was because I had chosen bridged networking in the VM settings, and it didn't work properly the first time - who knows...

So, if you have a blank country/region choice window the first time you boot into a Mac OS X Server VM, just reboot, and the setup should continue correctly (there weren't any problems subsequently).

It looks like there is a long delay in getting an IP address via DHCP with bridged networking, when resuming the VM from a suspended state: but I must investigate this a little further...

Reply
0 Kudos
NigelPearson
Contributor
Contributor

Sven, instead of using vmware-rawdiskCreator to create a disk image from a disk, is it possible to actually use a partition a la Boot Camp?

This is on an old MacBook that has 10.4 and 10.6 partitions, and trying to image the 10.4 one does nothing:

% /Library/Application\ Support/VMware\ Fusion/vmware-rawdiskCreator print /dev/disk0

Nr      Start       Size Type Id Sytem                  
-- ---------- ---------- ---- -- ------------------------
1          1  488397167 BIOS EE Unknown


% df

Filesystem    512-blocks      Used Available Capacity  Mounted on

/dev/disk0s3   104857600  79149256  25196344    76%    /

devfs                227       227         0   100%    /dev

/dev/disk0s2    83886080  56058144  27827936    67%    /Volumes/10.4

/dev/disk0s4    83886080  81733688   2152392    98%    /Volumes/Users

/dev/disk0s5   214309152 205121176   9187976    96%    /Volumes/Backups

map -hosts             0         0         0   100%    /net

map auto_home          0         0         0   100%    /home


% /Library/Application\ Support/VMware\ Fusion/vmware-rawdiskCreator create /dev/disk0 2 /Volumes/Backups/104 lsilogic


% ls -l /Volumes/Backups/104

ls: /Volumes/Backups/104: No such file or directory

Reply
0 Kudos
WoodyZ
Immortal
Immortal

NigelPearson wrote: This is on an old MacBook that has 10.4 and 10.6 partitions, and trying to image the 10.4 one does nothing:

Apples SLA only allows for Mac OS X Server 10.5 and higher to be virtualized on Apple Branded Hardware therefore any discussions surrounding 10.4 even under VMware Fusion on a Mac violates the Community Terms of Use.  In other words, end of discussion on virtualizing 10.4.

Reply
0 Kudos
SvenGus
Expert
Expert

For partitions, there is a guide, for example, here:

http://fearandloath.us/vmware-fusion-bootcamp-partition.html

... and also on other sites (see Google).

Remember, however (as Woody said above), that it is legal to virtualize only the Server versions of Mac OS X (Leopard and Snow Leopard).

Reply
0 Kudos
NigelPearson
Contributor
Contributor

OK, I will try to buy a 10.5 server release somewhere like eBay (or maybe 10.6, and host it under 10.4). Any ideas about the silent failure of vmware-rawdiskCreator, though?

Reply
0 Kudos
WoodyZ
Immortal
Immortal

Any ideas about the silent failure of vmware-rawdiskCreator, though?

Not sure what you're talking about, "silent feature" and frankly I think it's just easier to set the size of the hard drive from the settings sheet then close VMware Fusion and mount it with VMDKMounter and then use Disk Utility to repartition/format the disk.

Sorry this reply isn't applicable to vmware-rawdiskCreator and I was thinking about vmware-vdiskmanager when commenting about the .vmdk itself.

Message was edited by: WoodyZ

Reply
0 Kudos
SvenGus
Expert
Expert

My hint above - available in a better form on http://hints.macworld.com/article.php?story=20101220034435995 (part 1) - creates a Boot Camp-like setup from an existing Mac OS X Server HD; and obviously you can use the same approach also for a Mac OS X Server partition on your main HD: in your case (see above):

/Library/Application\ Support/VMware\ Fusion/vmware-rawdiskCreator create /dev/disk0 2 /Users/Shared/Virtual\ Machines.localized/Mac\ OS\ X\ Server.vmwarevm/Mac\ OS\ X\ Server ide

... if you name and locate things like in my hint (but try first with ide, à la "real" Boot Camp, and if this fails with lsilogic); YMMV for the path where you want the VM to reside (i.e., in /Users/Shared, or in ~/Documents, or elsewhere) and for the name of the VM.

Of course, you must first create the Boot Camp-like VM in Fusion, following the suggestions in the hint (or on the website that was linked for an Ubuntu VM).

Reply
0 Kudos
SvenGus
Expert
Expert

... In other words (to make things more clear), in order to use an existing partition or disk, you must first create an ordinary Mac OS X Server (or whatever you might want: Ubuntu, etc.) VM with the Fusion "wizard", delete the VMDK from within the VM settings, and only then, finally, use the raw disk creator to recreate a new "raw" VMDK, which this time will be à la Boot Camp (and IDE- or SCSI-based).

Reply
0 Kudos
NigelPearson
Contributor
Contributor

Sven,

1) Thank you for taking the time to answer my questions. I very much appreciate it.

2) I deleted and re-installed all the VMWare binaries. vmware-rawdiskCreator now sometimes reports errors, instead of failing silently.

3) I can create a .vmdk from fullDevice, or partition 1, but not any other partition, presumably because it can't read the partitions for some reason:

%  /Library/Application\ Support/VMware\ Fusion/vmware-rawdiskCreator create /dev/disk0 1 /tmp/part1 ide

macaque% ls -l /tmp/part1*

-rw-------@ 1 nigel  wheel  32256 10 Feb 14:46 /tmp/part1-pt.vmdk

-rw-------@ 1 nigel  wheel    662 10 Feb 14:46 /tmp/part1.vmdk


%  /Library/Application\ Support/VMware\ Fusion/vmware-rawdiskCreator create /dev/disk0 2 /tmp/part2 ide

Unable to determine partition start sector(s).


%  /Library/Application\ Support/VMware\ Fusion/vmware-rawdiskCreator print /dev/disk0
Nr      Start       Size Type Id Sytem                  
-- ---------- ---------- ---- -- ------------------------
1          1  488397167 BIOS EE Unknown


%

This is consistent with fdisk, but not the MacOS partition tools:

% sudo fdisk /dev/disk0

Password:

Disk: /dev/disk0 geometry: 30401/255/63 [488397168 sectors]

Signature: 0xAA55

         Starting       Ending

#: id  cyl  hd sec -  cyl  hd sec [     start -       size]

------------------------------------------------------------------------

1: EE 1023 254  63 - 1023 254  63 [         1 -  488397167] <Unknown ID>

2: 00    0   0   0 -    0   0   0 [         0 -          0] unused     

3: 00    0   0   0 -    0   0   0 [         0 -          0] unused     

4: 00    0   0   0 -    0   0   0 [         0 -          0] unused


% sudo diskutil list disk0

/dev/disk0

   #:                       TYPE NAME                    SIZE       IDENTIFIER

   0:      GUID_partition_scheme                        *250.1 GB   disk0

   1:                        EFI                         209.7 MB   disk0s1

   2:                  Apple_HFS 10.5server              42.9 GB    disk0s2

   3:                  Apple_HFS 10.6                    53.7 GB    disk0s3

   4:                  Apple_HFS Users                   42.9 GB    disk0s4

   5:                  Apple_HFS Backups                 109.7 GB   disk0s5


%

I found a page:  http://arstechnica.com/civis/viewtopic.php?f=19&t=64089 that details the .vdmk file stuff, but I'm still out of ideas as to why vmware-rawdiskCreator can't access the Apple partitions

Reply
0 Kudos
SvenGus
Expert
Expert

Maybe - but it's just a guess - your partition setup is too complex and non-standard? For example, a "real" Boot Camp VM probably expects the Windows partition to be the last one on the disk; while, in your case, the Mac OS X Server partition is before the main Mac OS X one (and the others). Or it could perhaps also be that it's because all partitions are HFS+ (GPT)...?

Well, we need some experts, here...

P.S.: Another tool to inspect/update the partitioning scheme is rEFIt.

Reply
0 Kudos