ftocc

Copy your Trixbox to VMWare

frankvdb
Posts: 6
Member Since:
2008-03-03

I found a way to make a copy of my real life Trixbox set into a virtual machine using VMWare. Like others I tried it automatically, but without success. This procedure will work if you have all your data in the main partition, but with some small adjustments it will also work if you've another setup than the default. The basics is that I use the VMWare workstation version of Trixbox.

I made a backup set using the following command on my real machine: "mondoarchive -Oi -E /backup -N -d /backup -s 650m -F -G"
Download the vmware version, delete the lck dir
Make sure you have enough space to copy the backup (you need a free space of a bit more than the amount of the backup). The 8 Gig harddrive wasn't enough for me, so I added an extra virtual SCSI harddrive in VMWare (also 8 Gigs).
Startup vmware
Make the new disk available
startup "fdisk /dev/sdb" (as it is the second scsi drive)
Enter the commands: n p 1 and press enter twice
Save the stuff with command w
Format the partition with "mke2fs /dev/sdb1"
Mount the new disk. Use "mkdir /backup" and then "mount -t ext2 /dev/sdb1 /backup"
Via "df" you see the disk layout results
install mondo
yum -y install cdrecord
yum install mkiofs
rpm -ivh ftp://ftp.mondorescue.org/rhel/5/afio-2.4.7-1.i386.rpm
rpm -ivh ftp://ftp.mondorescue.org/rhel/5/buffer-1.19-1.i386.rpm
rpm -ivh ftp://ftp.mondorescue.org/rhel/5/mindi-busybox-1.7.3-1.rhel5.i386...
rpm -ivh ftp://ftp.uni-bayreuth.de/pub/linux/fedoralegacy/redhat/7.2/os/i3...
rpm -ivh ftp://ftp.mondorescue.org/rhel/5/mindi-2.0.0-1.rhel5.i386.rpm
rpm -ivh ftp://ftp.mondorescue.org/rhel/5/mondo-2.2.5-1.rhel5.i386.rpm
rpm -ivh ftp://ftp.mondorescue.org/rhel/5/mondo-doc-2.2.5-1.rhel5.noarch.r...
Run "/usr/sbin/mondorestore", enable the ISO in VMWare to the (first) backup CDROM
From the dir list, select every dir you like, but do NOT select Boot, Mnt, Lost+found, Root and Dev
Select restore path to "/backup"
Lets remove fstab via "rm /backup/etc/fstab" and mtab "rm /backup/etc/mtab"
Now is a good moment to save all this. Shutdown trixbox, stop VMWare, rar/copy the files
Now startup the VMWare set with a bootable linux ISO (you cannot overwrite files that are in use, which will happen if you try to move or copy the backup files to the root). I use Knoppix (http://www.knoppix.org) which is a cool tool to rescue desktops/laptops. Link the ISO in your VMWare to the CDROM, startup and press F2 at bootup to enter the BIOS. Change the boot sequence so that the Knoppix will be booted and save/exit.
Now open the Konqueror explorer. Go to dir media:/. First determine which disk is your root and which contains the restored files. Two dirs are worth investigating: "/" and "8.6G Media". Go to the "/" and you'll see it is your root (as it contains Boot) and it is called media/sda2. The other one is the backup set and is called media/sdb1. The dirs are mounted automatically.
Go to a console
Make yourself the superuser with "su -" (By default you only have read permissions)
Go to the backup dir. "cd /media/sdb1"
Copy all stuff from the backup to the root dir with ""cp" -R -d -v * /media/sda2". The command cp is between quotes, otherwise you're in interactive mode.
Check/repair your main harddisk for errors. Use "umount /media/sda2" and "fsck /dev/sda2"
Shutdown Knoppix, remove the ISO from VMWare and reboot
You probably see some errors passing by saying the hardware isn't found....
You can mount the backup drive. You can also remove it from your VMWare set (via its settings) and remove the relating vmdk file (I suggest to make a full copy first)

For me it works, feel free to comment.

Frank



jscoulter
Posts: 180
Member Since:
2007-02-27
I THINK I could install

I THINK I could install trixbox quicker than those instructions...hahaha...just kidding.
At my work, we moved over to virtualized servers around xmas time, and one thing the guys who did it was, was they used a tool from VMWare that take any PC installation and turns it into a virtual machine, which saved a lot of time, and I did read somewhere that this was a free tool.
If I find the link again, I will post it here.

Jeremy



jscoulter
Posts: 180
Member Since:
2007-02-27
well that was easy, heres

well that was easy, heres the link :-

http://www.vmware.com/products/converter/

I also found this, but the above instructions look a bit easier to me....

http://swexperience.googlepages.com/virtualpctovmware

Jeremy



frankvdb
Posts: 6
Member Since:
2008-03-03
Hi Jeremy, Thanks for your

Hi Jeremy,

Thanks for your reaction. I looked at the converter page of VMWare, but it does not say it can import Linux based physical machines.

I don't want the vmware system operational in a production environment. I created a Trixbox setup on an old PC and it is about to become live. Before I change the telephone system at my office to the Trixbox I want to be sure we can be quickly up and running if the system fails (we have an ISDN system, so you certainly should be prepared). So that's why I tested the mondo application (any other image tool would be fine as well). Unfortunately I couldn't restore it in a vmware environment. I searched this forum and others had the same experience. Of course I could test it on a real machine, but he, this is a challenge.

Indeed the procedure looks long, but it is not really time consuming (if you take the actually copy/restore process out of the picture). The strange part is that "yum install mondo" did not work (that's why many commands will follow). Hmm I see the layout of my procedure is gone (I had spaces as indents).

Frank.



jscoulter
Posts: 180
Member Since:
2007-02-27
yes indeed, it does seem

yes indeed, it does seem that the VMWare converter IS just for Windows boxes....
Another way I have done it before, and I had to do this when I updated to 2.4 from 2.2, or was it 2.4 to 2.6....anyway, was take a TrueImage clone of my TB HD, then created a VM, then, applied the TrueImage clone into the VM. I DID have to burn the TrueImage clone to CD and make sure it was a bootable CD, but did work quite well.

Jeremy



jahyde
Posts: 1996
Member Since:
2006-06-02
the mondo install script

the mondo install script might help soem out in using this-
http://www.trixbox.org/forums/trixbox-forums/trixbox-projects/who...

--

--my PBX is run on 2 V8's



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.