Oracle Blog

Blog for jimlaurent

Importing Solaris VMDK image into Virtual Box

Virtual Box 1.6 has been released and is no longer in beta for MacOS X. One of the advertised features is the ability to import VMDK image files from VMware into Virtual Box. Being the eternal optimist, I decided to try it. How long could it take? A few minutes maybe? I have quite a few different VMs in Fusion and did this with Solaris 10 08/07.

That should have been it, right? Unfortunately, after seeing the grub screen and attempting to boot Solaris, I entered an infinite loop of rebooting OS. Obviously, it's mostly working but something is still wrong. Luckily, inside of Sun, we archive our mail aliases and Rudolf Kutina had already posted a solution to the problem.

The rebooting sequence resulted from the fact that VMware Fusion emulates SCSI disks (c0t0d0s0) while VBox emulates IDE disks (c0d0s0). Because of this, the Solaris device trees and vfstab mount entries are not correct. Rudolf's solution is not for the weak of heart but DOES work. After all, it's all just a virtual machine and if I screw it up, I just make another copy. What have you got to lose?

Boot into Solaris Safeboot mode. You can get access at the Grub menu, usually is the 2nd or 3rd option.

Mount the found Solaris partition on /a , Safeboot will usually find the slice on the disk with Solaris and ask if you want it to mount on /a. Select Yes.

Move /a/dev, /a/devices, and /a/etc/path_to_inst to another name (I just append .orig) and then create new directories, (mkdir) /a/dev and /a/devices, and touch file /a/etc/path_to_inst.

Run "devfsadm -r /a" to rebuild the device tree

set TERM so we can use 'vi', TERM=vt100; export TERM

Now we need to fix boot disk patch changes Edit /a/boot/solaris/bootenv.rc and fix the line with "setprop bootpath '/pci@0,0....' to match the path you'll find mounted for /a (i.e. run a 'df -k' command, and you should see /a mounted from /dev/dsk/c1d0s0 or something, then run 'ls -l /dev/dsk/c1d0s0' or whatever your device listed was, and you should see the actual link point to ../../devices/pci@0,0/...ide..)

Fix also disk naming in /a/etc/vfstab to match IDE "c0d0sx" scheme. Change each instance of c1t0d0s0 to c0d0s0 etc.

About

Jim Laurent is an Oracle Sales consultant based in Reston, Virginia. He supports US DoD customers as part of the North American Public Sector hardware organization.
With over 17 years experience at Sun and Oracle, he specializes in Solaris and server technologies. Prior to Oracle, Jim worked 11 years for Gould Computer Systems (later known as Encore).