How-to clone a FreeBSD virtual machine on
VMware
There is no free tool to clone a FreeBSD virtual machine on
VMware.
Instead, one can do the following:
- create the virtual machine with vSphere client
- boot the virtual machine using FreeBSD live CD
-
partition the disk in FreeBSD
- enable and start the network interface:
ifconfig en0 inet 192.41.170.xxx netmask 255.255.255.0
- in the source FreeBSD machine: in
/etc/ssh/sshd_config, add the line:
PermitRootLogin yes
and restart sshd:
/etc/rc.d/sshd restart
- make sure that dump and restore will have
enough temporary storage:
export TMPDIR=/mnt
- mount the root file system on the target machine:
mount /dev/xxx /mnt
- copy the file system using dump and restore:
cd /mnt
ssh root@192.41.170.xxx "dump -u0 -f - -L filesystem" | restore -r -f -
cd /
umout /mnt
- repeat for each file system
- in the source FreeBSD machine: in
/etc/ssh/sshd_config, remove the line PermitRootLogin
yes and restart sshd:
/etc/rc.d/sshd restart
- configure the Ethernet devices on the target FreeBSD
- configure the bootloader:
mount /dev/root filesystem /mnt
gpart bootcode -b /mnt/boot/pmbr -p /mnt/boot/gptboot -i 1 disk device
- update /etc/fstab in the target FreeBSD