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

From Linuxintro
imported>ThorstenStaerk
(New page: Imagine you want your lapTop to run in a virtual machine, maybe because you want to try some changes, maybe because you want to sell it. That's what this article is about. Your not...)
 
m
 
(24 intermediate revisions by one other user not shown)
Line 1: Line 1:
Imagine you want your [[lapTop]] to run in a [[virtual machine]], maybe because you want to try some changes, maybe because you want to sell it. That's what this article is about. Your notebook can be on [[Windows]] or [[Linux]], no matter.
+
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 =
 
= How to =
  
* Boot the computer you want to virtualize [[booting from usb|from usb]] or from [[knoppix]].
+
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''.
* Use a [[USB]] [[disk]] to store an image of your computer's [[hard disk]]:
+
* Get an image of moon's harddisk. Do one of the following:
  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''.
+
== Either: store on a USB disk ==
* Download and [[install]] [[vmWare]] on your host computer.
+
<ul>
 +
<li> Use a [[USB]] [[disk]] to store an image of the [[hard disk]]:</li>
 +
  dd if=''/dev/sda'' of=''/mnt/usb/hdimage.img''
 +
</ul>
 +
This can be used if your harddisk is ''/dev/sda'' and you want your image [[file]] at ''/hdimage.img''.
 +
 
 +
== Or: Transfer over network ==
 +
<ul>
 +
<li>Transfer moon's image over the network:</li>
 +
dd if=''/dev/sda'' | ssh root@earth "cat > hdimage.img"
 +
</ul>
 +
 
 +
----
 +
 
 +
* Download and [[install]] [[VmWare]] on your host computer.
 +
* make sure the command qemu-img exists on your host computer, e.g. under SUSE this will install it if it does not exist:
 +
yast -i qemu
 
* use qemu-img from the [[qemu]] [[package]] to transform your harddisk image to a vmware image:
 
* 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 convert /mnt/usb/hdimage.img -O vmdk ~/hdimage.vmdk
 
* you can now use your vmware image to boot your virtual guest computer.
 
* you can now use your vmware image to boot your virtual guest computer.
  
 
[[Category:Guides]]
 
[[Category:Guides]]

Latest revision as of 20:02, 2 August 2023

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:

Either: store on a USB disk

  • Use a USB disk to store an image of the hard disk:
  • dd if=/dev/sda of=/mnt/usb/hdimage.img

This can be used if your harddisk is /dev/sda and you want your image file at /hdimage.img.

Or: Transfer over network

  • 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.
  • make sure the command qemu-img exists on your host computer, e.g. under SUSE this will install it if it does not exist:
yast -i qemu
  • use qemu-img from the qemu package to transform your harddisk image to a vmware image:
qemu-img convert /mnt/usb/hdimage.img -O vmdk ~/hdimage.vmdk
  • you can now use your vmware image to boot your virtual guest computer.