How to use qemu

From FedoraProject

Revision as of 14:53, 14 August 2008 by Poelstra (Talk | contribs)

Jump to: navigation, search

Contents

How to use QEMU to test Fedora development or test images

Qemu

QEMU is a generic and open source processor emulator which achieves a good emulation speed by using dynamic translation.

QEMU has two operating modes:

  • Full system emulation. In this mode, QEMU emulates a full system (for example a PC), including a processor and various peripherials. It can be used to launch different Operating Systems without rebooting the PC or to debug system code.
  • User mode emulation (Linux host only). In this mode, QEMU can launch Linux processes compiled for one CPU on another CPU.

Download

QEMU is available on Fedora repository. It can be installed by:

$ su -c "yum install qemu"

Testing Rawhide or Fedora Test releases

Create the virtual image for the system:

$ qemu-img create -f qcow fedora.qcow 5G

Of course you are not obliged to take 5GB.

Note: Even if you take 10GB this does NOT mean that the image does really HAVE the size of 10GB. It just means that your new system is limited up to 10GB - if the new sytem takes only 1,2 GB also the image will only be at 1,2GB.

now let's install the OS. Put in the install CD and type into your konsole (all in one line without break):

$ qemu -cdrom /dev/cdrom -hda fedora.qcow -boot d -net nic -net user -m 196 -localtime

"-user -net" is important to have internet access within your new system. "-m 196" is the Set virtual RAM size (megabytes), default is 128 MB, I chose 196.

The install may take some time. After the install, qemu will try to boot the new OS itself. Maybe this may fail (was the case for me) - but don't worry. If that happens: just close the qemu window and type the following command into your konsole to launch your new OS:

$qemu fedora.qcow -boot c -net nic -net user -m 196 -localtime

Testing ISO Images

Type, in the proper directory

$ qemu -cdrom fXtestN.iso


Credits to MirjamWaeckerlin