Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How To Copy A VMWare System To A Live Environment?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
joplenmo
n00b
n00b


Joined: 29 Jan 2006
Posts: 5
Location: Joplin. Mo, USA

PostPosted: Sat Oct 20, 2007 8:00 am    Post subject: How To Copy A VMWare System To A Live Environment? Reply with quote

I have spent a lot of time and effort building a Gentoo system entirely from scratch following the guide and reading many helpful hints here on the forums. I've grown so happy with my virtual Gentoo environment I'd like to replicate that in a "live" environment - a.k.a. an actual computer system.

I've searched the forums but only found one brief mention of "copying a system" by tarballing the entire thing then untarring it onto another system but it didn't make any sense. So could someone please direct me to the information I need in order to duplicate my VMWare installation onto an actual computer system? I, of course, realize some changes will be necessary given hardware, but otherwise everything else will remain the same.

Thanks for any assistance/direction you can provide me. And please keep in mind that though I've built a Gentoo virtual system from scratch I'm still fairly new to the terminology. I've only proven one thing thus far - I'm capable of following directions very well (managed to get Gentoo installed and get a desktop environment up and running both on the first try as opposed to the many horror stories I've read on here).
_________________
My Blog: http://joplenmo.blogspot.com
Back to top
View user's profile Send private message
merlijn
Apprentice
Apprentice


Joined: 10 Apr 2007
Posts: 161
Location: Den Haag, Holland

PostPosted: Sat Oct 20, 2007 9:30 am    Post subject: Reply with quote

There is several ways you can do this, ranging from quite easy to very advanced. Tarring your / and deploying that on a pc with different hardware can produce very weird things, so I wouldn't go with that method. For a not so experienced user I would recommend the following way to go:

- Install a fresh stage3 on the new pc according to the handbook / quick install guide. Only thing to note is that it is a good idea to add the same users to the system as you had in the vmware.
- Copy the important dirs from the vmware to your new machine. I would recommend these: /home/, /root/ (if you have anything in there), /etc/ and /var/lib/portage/world. Surely keep a backup of the vmware in case you missed out on anything.
- You will need to 'merge' the /etc dirs, you can copy all of the stuff that isn't there, but you probably want to edit /etc/make.conf and for example /etx/X11/xorg.conf on your new machine. This should pretty much take care of all the settings you had on your system.
- With your old world file in /var/lib/portage/world, you can reinstall all the packages you used to have. 'emerge -uevDN world' will do all the work, but prepare for a whole lot of hours heavy compiling.

After this you should probably want to add a whole bunch of programs to some runlevel, to be started on boot. Once you have done this, you should be all set. (Well anyway I can't help you much further from there now, you will probably need to fix a few things that don't work out of the box).

Hope this helps,
_________________
Gigabyte G33-DS3R, E6850, 4gb ddr2-800, 8800GT, Acer AL2623W - amd64
MacBookPro 2.4ghz, 2gb ddr2-667 - ~x86

Code:
ROOT="/mnt/coffeecup/" USE="sugar extra-sugar milk" emerge --update --deep --verbose --oneshot coffee
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54300
Location: 56N 3W

PostPosted: Sat Oct 20, 2007 10:04 am    Post subject: Reply with quote

joplenmo,

The *.vmdk file in vmware is just a disk image in a file.
You can mount its partitions and copy the contents almost as you would any other partition.

You need to know the starting point of each partition within vmware, which fdisk -l (within your vmare install will tell you)
This example is from a real disk but the method is the same
Code:
Disk /dev/hda: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x40484047

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1               1       14590   117194143+  83  Linux
/dev/hda2           14591       24321    78164257+  83  Linux

The partition starts are at 1 and 14591 Units and from
Code:
Units = cylinders of 16065 * 512 = 8225280 bytes
we see that a Unit=8225280 bytes. This gives the start of /dev/hda2 as 14591 * 8225280 bytes into the disk, or 120015060480 bytes. We need that number for the mount command.
Now, borrowing the mount point /mnt/cdrom, we can do
Code:
mount -o loop,ro,offset=120015060480 /path/to/ *.vmdk /mnt/cdrom
to mount the partition that starts 120015060480 bytes into the file. Your kernel will need, loop support and support for the filesystem you are trying to mount. The ro, means read only, so you can't accidentialy do any damage to it.

You may now use tar or cp -a to make a copy of the files in /mnt/cdrom.

One last complication. The partition reported as start 1 has a faked start point. The first partition starts at block 63, or 32256 bytes into the file - always on PC hardware.

If you are on a windows host, it gets harder. You can do all of the above by booting from a Gentoo liveCD but will need to deposit the copy to another system over the network unless you have a Linux partition on the local hard drive you can mount from a liveCD.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
joplenmo
n00b
n00b


Joined: 29 Jan 2006
Posts: 5
Location: Joplin. Mo, USA

PostPosted: Sat Oct 20, 2007 7:38 pm    Post subject: Reply with quote

Thanks for the suggestions! I am going to give it an attempt this evening. For safety's sake I made a backup of the VMWare Gentoo installation and will work with copies of that installation in case I mess up.

Wish me luck!
_________________
My Blog: http://joplenmo.blogspot.com
Back to top
View user's profile Send private message
joplenmo
n00b
n00b


Joined: 29 Jan 2006
Posts: 5
Location: Joplin. Mo, USA

PostPosted: Mon Oct 22, 2007 9:21 pm    Post subject: Reply with quote

It worked!

Took a few attempts and some patience, but I finally got the VMWare installation duplicated over to the desktop.

I created a backup archive of the VMWare installation (by booting from the Gentoo 2007.0 install disk image in VMWare and backing up the contents of the VMWare disk image that the installation resided on).

I then installed a clean copy of Gentoo onto my desktop computer using the Gentoo 2007.0 installation CD.

Then I exploded the backup over the new installation while I was still running the LiveCD version of Gentoo.

I had to then go in and alter/tweak a number of the config files, etc, but in the end I wound up with a desktop duplicate of the VMWare version of Gentoo I'd played with for the last year.

Thanks guys!
_________________
My Blog: http://joplenmo.blogspot.com
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum