• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

Convert VM to 'real' OS? And a Gentoo question.

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

curtis1552

Member
Joined
Aug 26, 2007
Location
Dayton, Ohio
I've been playing with VMs recently, mostly using QEMU, and was wondering how i mignt copy a virtual OS to the harddrive in order to create a functional/bootable OS instead of just a VM.

I know that i'll have to edit my GRUB to boot the kernel, but that's not a probelm. (I should be able to jack the GRUB boot sequence from the /boot/grub/grub.conf on the (previously) VM and past it into my current GRUB file, allowign for changes in partition placement.)

Is there a better VM program that i could do this with?

My overall goal is to set Gentoo up 'in the background' and still be able to use my computer while i'm compiling everything - also when i fuber the settings i don't have deal with setting up all mu partitions.

The other thing is i want to set up Gentoo for my older computer but compile everything on my newer computer (currently running Ubuntu). The older computer is:
MOBO: Gigabyte GA-7IXE
CPU: Athlon k6 1Ghz Slot A
RAM: 756 Mb generic (or i can use 512 of it as ECC)
GFX CARD: PNY Nvidia Quadro FX 500
NIC: 3-Com 3C905B-TX
Sound Card: Ectiva MachOne (chipset EV1935)
Other: Hauppauge PVR-150
PSU (if you care): FSP460-601U it's a 460watt rackmount PSU.

My goal would be to allow some TV viewing or recording, and a lightweight WM (not Fluxbox - i just don't like it), internet use, and word processing.

I'm hoping to get an extrememly optimized Gentoo install but i have probelms determining the neccisary USE variables at startup. I'm also wondering if i should change the optimization higher, or leave it at 2.
 
Fresh..

It would be better to install from scratch..the modules and kernel from the vm machine will not match that of the real machine..remember vmware or the like creates virtual drivers...not necessarily what is part of ur hardware...say ur on windows and u use vmware to create a vm on a phyical drive..it would work..but all drivers would not be available..Good thing about Gentoo is the genkernel....Do a fresh install..if ur worrying about compile times..use sabayon..which is Gentoo..but has an overlay...
 
Starting fresh will be easier, but it's possible to move it over.

Also the good thing about gentoo isn't a genkernel but it's compiling your own kernel, which is the first step running outside the vm. Compile your own kernel with the proper drivers needed for the real hardware. Once you have that then create your partition where you want to place it and then you can dump the virtual hard drive file to the physical partition.

Also one advantage of doing a fresh install would be you can setup /, /var, /boot, /home all on different partitions, so that your data in home and your web data in var and stuff is safe if something happens to your install and you need to nuke it, you can reinstall just the base system but save your data.

Also for compiling one multiple system what you want is distcc.
http://www.gentoo.org/doc/en/distcc.xml
http://ubuntuforums.org/showthread.php?t=83186
http://ubuntuforums.org/showthread.php?t=28454
 
Ok, so making a VM real is a PITA. So setup DistCC on all my computers and let them compile in the background. Good deal.
 
I just had an idea. Maybe you can use DD to copy the VM to another partition. If you can mount a blank partition in the VM then copy your root file system to the partition.

Normally if you were copying from one partition to another (overwriting the other) you would use this command (warning it is easy to mess stuff up *loose data* if you get the of location wrong or reversed with the if location with the of)

Code:
sudo dd if=/dev/sda1 of=/dev/sda2

So if you change it to

Code:
sudo dd if=/ of=/mnt/blank-partition-mounted-in-VM

or possibly the VM refers to itself as /dev/sda1 (or hda1) then something like this

Code:
sudo dd if=/dev/sda1 of=/mnt/blank-partition-mounted-in-VM

Some combination of this will make a full bit for bit copy of the VM to a partition that you choose. You could also save the VM to an iso file

Code:
sudo dd if=/VM-mount-location of=/mnt/host-mounted-location/vm.iso

Then when you are ready to copy it to a drive or partition

Code:
sudo dd if=/vm.iso of=/mnt/sdb1

Don't use these examples as is, change what you need to the locations of your mounted folders and partitions. Double check what you have typed. Think of the "if" part as input file and the "of" part as output file. If you reverse them then the blank part that was meant for "of" will be copied over the data part that should have been in "if", this will delete what you were trying to copy.
 
Back