How To Virtualise A Physical Linux Machine

Submitted by mannes (Contact Author) (Forums) on Tue, 2008-06-03 12:34. :: Virtualization

How To Virtualise A Physical Linux Machine

This tutorial shows how you can virtualize a physical Linux machine. It is intended not only for virtualisation, but for any relocation of a RedHat Linux based system from one machine to another.

Here are the steps to be completed:

1. Install a virtualisation software on the desired machine.

2. Create an empty virtual machine with enough disk space, selecting the OS you’re going to migrate.

3. Download a Linux Live-CD ISO (e.g. Knoppix).

4. Burn one copy on a CD and then copy the ISO to the virtualisation server (the host).

5. Reboot the original Linux box (the physical machine that you want to virtualize) with the CD you’ve just burnt, and connect the ISO to the newly created virtual machine (i.e., boot the VM from the ISO).

6. Check both live CDs have net connection correctly configured and that they can see each other.

7. In the virtual machine, type this:

nc -l -p 10000 | dd of=/dev/hda

8. On the machine you’re migrating, type:

dd conv=noerror if=/dev/hda | nc $IP_OF_THE_VM 10000

9. Wait until dd finishes its job and do a clean reboot of the virtual machine.

10. Boot in rescue mode with the distro's first CD or DVD and chroot to the new system (on the virtual machine).

11. Run kudzu to remove old devices and find the new ones (or manually edit your /etc/modules.conf file, which is the most important since it includes your scsi-device). For SuSE Linux systems, you may need to run yast to discover the new hardware.

12. Create a new init using mkinitrd on your kernel version. Example:

/sbin/mkinitrd -v -f /boot/initrd-2.6.20-1-new.img 2.6.20-1

13. Edit your /boot/grub/menu.lst file to boot your newly created initrd image.

14. Keep your fingers crossed and reboot your VM.


Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.
Submitted by comedit (registered user) on Fri, 2008-06-20 23:12.

I am looking for something like this for (k)ubuntu.

Does this also work for (k)ubuntu Since I really need to virtualize my physical kubuntu machine

 

Thanks in advance

Submitted by maddog (not registered) on Mon, 2008-09-29 22:48.
wow never thought about such netcat usage - great idea!
Submitted by korovamilk (registered user) on Mon, 2008-06-09 10:30.

smart use of netcat here,

great tutorial... thanks for sharing it!

Submitted by SamTzu (registered user) on Wed, 2008-06-04 10:53.

Great tutorial. thx

Sam