03.10.2008

Using VMWare Images with Virtualbox

After installing VMWare 2.0 and VirtualBox 2.0.2 i wanted to make a comparison of both virtualization engines. I thought about installing the same guest in both software stacks. But this seemed like too much work ;-). So i started to google about migrating a guest from VMWare to Virtualbox.
I found this helpful blog.
So it is very easy. I created a new Virtual Machine like shown in my posting about VirtualBox and at the step Virtual Hard Disk

i chose Existing...

and added the vmdk-file from the debian-guest, which i used with VMWare Server 2.0.
So i thought, everything was ready but after pressing start the system stopped with:

Waiting for root file system

After a short search, i found out, that VMWare prefers guest systems with SCSI hdd controllers and VirtualBox can only mount IDE hard disks. But this was not really a problem. I started the guest on VMWare and changed the following lines:
in /boot/grub/menu.lst
from kernel /boot/vmlinuz-2.6.18-4-686 root=/dev/sda1 ro
to root=/dev/hda1
and i changed in /etc/fstab all entries with sda to hda. After these changes, the guest bootet without a problem in my VirtualBox.
But it is clear, that with this configuration, it will not run on VMWare. So i changed in the .vmx file all entries form scsi0:0 to ide0:0 and in the .vmdk file the parameter adapterType=lsilogic to ide. Now the guest os is able to start in both virtualization servers.
So everything is ready for a comparison and there is an easy way for migrating from VMWare to VirtualBox, if i want to move...
If you to know how to configure networking via GUI, read this posting.

Kommentare:

  1. Thanks a lot!
    Greetings from Switzerland

    AntwortenLöschen
  2. Hi,
    Since I don't have the VMware, I can't do the changes you stated in your guide, using vmware. I just got the vbox and the guest image created in vmware. I tried to change the booting parameter from sda2 to hda2 exactly in the grub -not in menu.lst file-, as you can predict, since I don't change the /etc/fstab, I received kernel-panic error. So, do you know any other solution, using only the vbox?

    Thanks a lot.

    AntwortenLöschen
  3. Hi,

    have you tried
    http://blog.baeke.info/blog/Technologies/VirtualMachines/_archives/2005/6/6/914327.html
    or
    http://ubuntuforums.org/showthread.php?p=1928545

    AntwortenLöschen
  4. For those stumbling on this thread as I did, it may be good to try just changing the root device in grub. My VirtualBox (2.1.4) also hung trying to find the root disk, but after changing to root=hda1 my image (debian lenny) booted just fine. Even if the disk is referenced (and eventually mounted) as /dev/sda1 in /etc/fstab.

    I also believe that newer Ubuntu's use a UUID to identify disk and don't rely on the old /dev/(s|h)dax notation. So changing the root device in grub should be enough there too.

    AntwortenLöschen
  5. Hi
    I have a vmware virtual machine with ubuntu 8.10.
    I tried to run it in virtual box. It first worked fine but at second but it went into read only mode for the mounts and stopped working. Also whenever I tried to start the same virtual machine in vmware grub returned the error message 18.
    I figured out that I had to change the setting in the vmx and vmdk file to start in vmware now. Also i figured out that the harddisk was corrupt had to start from live disc and repaired the volume. Also I had to recover the fstab file which got lost. Now my virtual machine works in vmware again, but when I change the vmdk and vmx fiel back to scsi grub gives me the error again. What can I do? in the menu.lst all possible booting options are linked via the uuid and changing it to /dev/sda1 does not help either.
    What does virtual box change in the linux confguration?

    cheers marc

    AntwortenLöschen
  6. Perhaps things have changed, but in VB 3.0.8 I could avoid changes to grub and fstab by using these settings in Configuration/ Hard Disks:
    - Activate SATA (AHCI) Controller
    - in Slot, choose SATA, Port 0

    AntwortenLöschen
  7. Thank you very much! you saved me a lot of time!

    cheers!

    AntwortenLöschen
  8. in 2012 works fine! Tested with old vmware image (2008-??) and virtual box 4.2.4
    thanks!!!

    AntwortenLöschen