Adding the qemu.adoc

This commit is contained in:
Eduard Alexander Lucena Mendoza 2018-04-11 11:46:02 -03:00 committed by Brian (bex) Exelbierd
parent 4b6f098443
commit 8224320672
2 changed files with 29 additions and 93 deletions

View file

@ -12,6 +12,8 @@ Topics:
File: installing-java File: installing-java
- Name: Installing Chromium or Google Chrome browsers - Name: Installing Chromium or Google Chrome browsers
File: installing-chromium-or-google-chrome-browsers File: installing-chromium-or-google-chrome-browsers
- Name: How to use qemu
File: qemu
- Name: Getting started with virtualization - Name: Getting started with virtualization
File: getting-started-with-virtualization File: getting-started-with-virtualization
- Name: Using nested virtualization in KVM - Name: Using nested virtualization in KVM
@ -67,6 +69,7 @@ Topics:
File: bumblebee File: bumblebee
- Name: Creating GPG Keys - Name: Creating GPG Keys
File: create-gpg-keys File: create-gpg-keys
<<<<<<< HEAD
# - Name: (CHECK) GRUB 2 # - Name: (CHECK) GRUB 2
# File: grub2 # File: grub2
# - Name: (FIX ME!) AutoUpdates # - Name: (FIX ME!) AutoUpdates
@ -105,8 +108,6 @@ Topics:
# File: packagekit-not-found # File: packagekit-not-found
# - Name: (FIX ME!) PostgreSQL # - Name: (FIX ME!) PostgreSQL
# File: postgresql # File: postgresql
# - Name: (FIX ME!) How to use qemu
# File: qemu
# - Name: (FIX ME!) Raspberry Pi # - Name: (FIX ME!) Raspberry Pi
# File: raspberry-pi # File: raspberry-pi
# - Name: (FIX ME!) How to reset a root password # - Name: (FIX ME!) How to reset a root password

View file

@ -1,83 +1,35 @@
= How to use qemu = How to use qemu
'''
[IMPORTANT]
======
This page was automatically converted from https://fedoraproject.org/wiki/How_to_use_qemu
It is probably
* Badly formatted
* Missing graphics and tables that do not convert well from mediawiki
* Out-of-date
* In need of other love
Pull requests accepted at https://pagure.io/fedora-docs/quick-docs
Once you've fixed this page, remove this notice, and update
`_topic_map.yml`.
Once the document is live, go to the original wiki page and replace its text
with the following macro:
....
{{#fedoradocs: https://docs.fedoraproject.org/whatever-the-of-this-new-page}}
....
======
'''
[[how-to-use-qemu]] [[how-to-use-qemu]]
How to use QEMU == How to use QEMU
---------------
QEMU is a very flexible virtualization technology however it is quite QEMU is a very flexible virtualization technology however it is quite slow and it is recommended that you understand and evaluate alternative solutions before picking this one.
slow and it is recommended that you understand and evaluate alternative Refer to https://fedoraproject.org/wiki/Getting_started_with_virtualization[Getting started with virtualization]
solutions before picking this one. Refer to
link:Getting_started_with_virtualization[Getting started with
virtualization]
[[qemu]] [[qemu]]
Qemu == Qemu
~~~~
QEMU is a generic and open source processor emulator which achieves a QEMU is a generic and open source processor emulator which achieves a good emulation speed by using dynamic translation.
good emulation speed by using dynamic translation.
QEMU has two operating modes: QEMU has two operating modes:
* Full system emulation. In this mode, QEMU emulates a full system (for * Full system emulation.
example a PC), including a processor and various peripherials. It can be In this mode, QEMU emulates a full system (for example a PC), including a processor and various peripherials.
used to launch different Operating Systems without rebooting the PC or It can be used to launch different Operating Systems without rebooting the PC or to debug system code.
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.
* User mode emulation (Linux host only). In this mode, QEMU can launch
Linux processes compiled for one CPU on another CPU.
[[download]] [[download]]
Download == Download
~~~~~~~~
QEMU is available on Fedora repository. It can be installed by using QEMU is available on Fedora repository. It can be installed by using https://fedoraproject.org/wiki/dnf[DNF]:
link:dnf[DNF]:
.... ....
$ su -c "dnf install qemu" $ su -c "dnf install qemu"
.... ....
Or with YUM:
....
$ su -c "yum install qemu"
....
[[qemu-commands-since-f]] [[qemu-commands-since-f]]
Qemu commands since F?+ == Qemu commands since F?+
~~~~~~~~~~~~~~~~~~~~~~~
To discover the qemu commands that are installed perform the following: To discover the qemu commands that are installed perform the following:
@ -85,8 +37,7 @@ To discover the qemu commands that are installed perform the following:
$ ls /usr/bin/qemu-* $ ls /usr/bin/qemu-*
.... ....
In the following examples where "qemu" is, substitute your command for In the following examples where "qemu" is, substitute your command for executing qemu. E.g.
executing qemu. E.g.
.... ....
qemu-system-i386 qemu-system-i386
@ -101,8 +52,7 @@ qemu-i386
Of course, this does not apply to "qemu-img". Of course, this does not apply to "qemu-img".
[[qemu-virtual-machine-installation]] [[qemu-virtual-machine-installation]]
Qemu virtual machine installation == Qemu virtual machine installation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Create the virtual image for the system: Create the virtual image for the system:
@ -112,34 +62,27 @@ $ qemu-img create fedora.qcow 5G
Of course you are not obliged to take 5GB. Of course you are not obliged to take 5GB.
Note: Even if you take 10GB this does NOT mean that the image does 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 system takes only 1,2 GB also the image will only be at 1,2GB.
really HAVE the size of 10GB. It just means that your new system is
limited up to 10GB - if the new system 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 Now let's install the OS. Put in the install CD and type into your konsole (all in one line without break):
konsole (all in one line without break):
.... ....
$ qemu -cdrom /dev/cdrom -hda fedora.qcow -boot d -net nic -net user -m 196 -localtime $ 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 "-user -net" is important to have internet access within your new system.
system. "-m 196" is the Set virtual RAM size (megabytes), default is 128 "-m 196" is the Set virtual RAM size (megabytes), default is 128 MB, I chose 196.
MB, I chose 196.
The install may take some time. After the install, qemu will try to boot The install may take some time. After the install, qemu will try to boot the new OS itself.
the new OS itself. Maybe this may fail (was the case for me) - but don't Maybe this may fail (was the case for me) - but don't worry.
worry. If that happens: just close the qemu window and type the If that happens: just close the qemu window and type the following command into your konsole to launch your new OS:
following command into your konsole to launch your new OS:
.... ....
$qemu fedora.qcow -boot c -net nic -net user -m 196 -localtime $qemu fedora.qcow -boot c -net nic -net user -m 196 -localtime
.... ....
[[testing-iso-images]] [[testing-iso-images]]
Testing ISO Images == Testing ISO Images
~~~~~~~~~~~~~~~~~~
Type, in the proper directory Type, in the proper directory
@ -148,20 +91,12 @@ $ qemu -m 512M -cdrom <isoname>.iso
.... ....
[[debugging]] [[debugging]]
Debugging == Debugging
~~~~~~~~~
To get kernel output dumped to a file outside the virtual system, add To get kernel output dumped to a file outside the virtual system, add e.g. "-serial file:/tmp/qemu-output.log" to the qemu command line.
e.g. "-serial file:/tmp/qemu-output.log" to the qemu command line. When When booting the virtual system, add "console=ttyS0" to the kernel boot parameters.
booting the virtual system, add "console=ttyS0" to the kernel boot
parameters.
This output is particularly helpful if you are having trouble booting This output is particularly helpful if you are having trouble booting the system, in which case you may also wish to remove "rhgb" and "quiet" from the kernel boot parameters.
the system, in which case you may also wish to remove "rhgb" and "quiet"
from the kernel boot parameters.
Category:How_to
'''
See a typo, something missing or out of date, or anything else which can be See a typo, something missing or out of date, or anything else which can be
improved? Edit this document at https://pagure.io/fedora-docs/quick-docs. improved? Edit this document at https://pagure.io/fedora-docs/quick-docs.