A guess many people have figured this out by now, but i still know a lot who have not, so here it goes.
There are a few caveats in cloning openSUSE or SLE VirtualBox machines. One is that openSUSE uses device ID in /etc/fstab and grub's menu.lst to reference your hard disk partitions. This is cool for physical machines, since no matter what the usual device name of your hard disk is (/dev/sda, sdb, hda, ...), the device ID always stays the same. When cloning the VirtualBox hard disk image, however, the device ID changes. This consequently causes a problem when booting your new machine with cloned image.
Another one concerns the network card's udev rules, which affect the device names. These are set to use MAC address to identify the card, which also changes when creating new virtual machine (new random MAC address is generated). After booting the cloned machine with this new network card, the original one becomes eth1, and the new one is not configured; you need to configure it, e.g. using YaST. Thanx to Mišo Žugec for this tip.
To avoid these problems, after installing a fresh openSUSE or SLE which i want to use for cloning, i change its /etc/fstab and /boot/grub/menu.lst to use the usual device files, and change the network card's udev rules from MAC to BusID. So, in nutshell, the cloning process looks like this:
- Boot the virtual machine you want to use as base for cloning.
- Replace the
/dev/sdXYin /etc/fstab and /boot/grub/menu.lst.
- In YaST Network module, click Edit to edit the network card, open the Hardware tab, click Change in the Udev rules frame and select BusID instead of MAC address.
- Shut the machine down (from within the machine itself, not using VirtualBox's power off).
- Find the machine's .vdi hard disk file (usually under ~/.VirtualBox/ dir) and use VBoxManage clonevdi command to clone it, for example:
(~/.VirtualBox/HardDisks)$ VBoxManage clonevdi my-perfect-oS11.2-base.vdi oS11.2-some-experiment.vdi
- Create new machine in VirtualBox GUI and attach the cloned disk image to it when asked. You can also copy an existing machine's .xml configuration file and change the hard disk UUID, or create a script that will do this for you.
For more info see: