Difference between revisions of "Turn your physical computer into a virtual one"

From LinuxIntro
Jump to: navigation, search
(How to)
Line 4: Line 4:
  
 
Let's call the computer you want to virtualize ''moon'' and the computer you want to use as a host for the virtual machine ''earth''.
 
Let's call the computer you want to virtualize ''moon'' and the computer you want to use as a host for the virtual machine ''earth''.
* Get an image of moon's harddisk. Do one of the following:
+
<ul>
** Use a [[USB]] [[disk]] to store an image of the [[hard disk]]:
+
<li /> Get an image of moon's harddisk. Do one of the following:
 +
<ul>
 +
<li> /> Use a [[USB]] [[disk]] to store an image of the [[hard disk]]:
 
  dd if=''/dev/sda'' of=''/hdimage.img''
 
  dd if=''/dev/sda'' of=''/hdimage.img''
 
This can be used if your harddisk is ''/dev/sda'' and you want your [[image]] [[file]] at ''/hdimage.img''.
 
This can be used if your harddisk is ''/dev/sda'' and you want your [[image]] [[file]] at ''/hdimage.img''.
** Transfer moon's image over the network:
+
<li /> Transfer moon's image over the network:
 
  dd if=''/dev/sda'' | ssh root@earth "cat > hdimage.img"
 
  dd if=''/dev/sda'' | ssh root@earth "cat > hdimage.img"
* Download and [[install]] [[VmWare]] on your host computer.
+
</ul>
* use qemu-img from the [[qemu]] [[package]] to transform your harddisk image to a vmware image:
+
<li /> Download and [[install]] [[VmWare]] on your host computer.
 +
<li /> use qemu-img from the [[qemu]] [[package]] to transform your harddisk image to a vmware image:
 
  qemu-img /mnt/usb/hdimage.img -O vmdk /hdimage.vmdk
 
  qemu-img /mnt/usb/hdimage.img -O vmdk /hdimage.vmdk
* you can now use your vmware image to boot your virtual guest computer.
+
<li /> you can now use your vmware image to boot your virtual guest computer.
 
+
</ul>
 
[[Category:Guides]]
 
[[Category:Guides]]

Revision as of 10:56, 1 September 2008

Imagine you want your physical computer to run as a virtual machine, maybe because you want to try some dangerous changes, maybe because you want to sell one of your two laptops. That's what this article is about. Your computer can be on Windows or Linux, no matter.

How to

Let's call the computer you want to virtualize moon and the computer you want to use as a host for the virtual machine earth.

  • Get an image of moon's harddisk. Do one of the following:
    • /> Use a USB disk to store an image of the hard disk: dd if=/dev/sda of=/hdimage.img This can be used if your harddisk is /dev/sda and you want your image file at /hdimage.img.
    • Transfer moon's image over the network: dd if=/dev/sda | ssh root@earth "cat > hdimage.img"
  • Download and install VmWare on your host computer.
  • use qemu-img from the qemu package to transform your harddisk image to a vmware image: qemu-img /mnt/usb/hdimage.img -O vmdk /hdimage.vmdk
  • you can now use your vmware image to boot your virtual guest computer.