Sponsored Content
Full Discussion: QEMU performance?
Special Forums UNIX and Linux Applications Virtualization and Cloud Computing QEMU performance? Post 302930185 by sea on Wednesday 31st of December 2014 05:12:34 AM
Old 12-31-2014
Computer QEMU performance?

Heyas

So, i like doing custom a LiveImage of my OS.
Using Redhats kickstart/livecd-creator method.

Anyway, so i would like to test the liveimages...
AND also, i WOULD like to install FreeBSD, Solaris, or whatever, onto a Virtual Machine.

I used to use Oracles Virtualbox, but eversince i'm booting with SecureBoot enabled, i'm no longer able to start it, so i had to change to QEMU.

Now, to just 'test' if the fresh generated iso is 'working' or not, QEMU is just fine.
But if i ever want to actualy do in QEMU, like, switching desktop, or changing the folder in pcmanfm inside QEMU, it needs patience out of this world...

I'm running my ISO's like this:
Code:
#!/bin/bash
# isotest
# Description:	Simply boots an iso file with qemu.
# ------------------------------------------------------
#
#	Variables
#
	DEFAULT_ARCH=x86_64
	DEFAULT_ARCH=$(uname -m)
	DEFAULT_RAM=$(( 4 * 1024 ))
	DEFAULT_CORES=4
	DEFAULT_VGA=vmware
	DEFAULT_FORMAT=qcow2
	DEFAULT_SIZE=5G
	DEFAULT_IMAGE_DIR=$HOME/Virtual_Machine_Images
	DEFAULT_IMAGE_FILE=isotest.img
#
#	Display & Action
#
	qemu-system-$DEFAULT_ARCH \
		-smp $DEFAULT_CORES \
		-m $DEFAULT_RAM \
		-cdrom "$1"

And to 'install' or run an intalled image i execute:
Code:
#!/bin/bash
# distrotest
# Description:	Simply boots an OS file with qemu.
# ------------------------------------------------------
#
#	Variables
#
	DEFAULT_ARCH=x86_64
	DEFAULT_ARCH=$(uname -m)
	DEFAULT_RAM=$(( 4 * 1024 ))
	DEFAULT_CORES=4
	DEFAULT_VGA=vmware
	DEFAULT_FORMAT=qcow2
	DEFAULT_SIZE=5G
	DEFAULT_IMAGE_DIR=$HOME/Virtual_Machine_Images
	DEFAULT_IMAGE_FILE=distrotest.img
#
#	Functions
#
	DEFAULT_IMAGE="$DEFAULT_IMAGE_DIR/$DEFAULT_IMAGE_FILE"
	[[ -f "$1" ]] || exit 1
	if [[ ! -f "$DEFAULT_IMAGE" ]]
	then	# We just need an image to boot an iso, this can be quite small.
		qemu-img create -f "$DEFAULT_FORMAT" "$DEFAULT_IMAGE" $DEFAULT_SIZE
	fi
#
#	Display & Action
#
	qemu-system-$DEFAULT_ARCH \
		-smp $DEFAULT_CORES \
		-m $DEFAULT_RAM \
		-cdrom "$1" \
		-hda "$DEFAULT_IMAGE"
# 		-full-screen \

As you see, i'm quite, sharing?, with my hardware for qemu...
4 Cores and 4 GB of ram, but booting an ISO (same for installed) takes up to ~7mins, when with O-VB it was as low as ~1min -- using 768mb ram and 70% of 1 core....

Doing a mouse click and wait for like 20 secs for ANYTHING to happen, is just annoying.

Any ideas or advices please?
Thank you in advance
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Anyone ever used qemu and networked it ?

hi i got a virtual linux machine running on qemu my problem is connecting it to the internet im a bit confused weather i have to make a virtual network card in qemu and than tun tap it? can anyone thats done it before help me out? (1 Reply)
Discussion started by: russian460
1 Replies

2. Filesystems, Disks and Memory

QEMU not booting my image

hello all, I have been trying to boot an image (.IMG) using qemu, for quite some time now and i can't seem to get it to work. I've been able to boot from the Windows XP CD, the Debian iso image, etc, so I know qemu is configured properly and is working. But when it come to booting an image that I... (34 Replies)
Discussion started by: neur0n
34 Replies

3. Programming

Qemu + gdb

Hi, I got: host machine: RedHat (RHEL6) virtual machine: RedHat (RHEL6) I run (on host machine): qemu-system-x86_64 ...... -S -s after that i run (on host machine): gdb target remote localhost:1234 set architecture i386:x86-64 and then i can use (on host machine) 'ctrl + c' to... (2 Replies)
Discussion started by: Chrisdot
2 Replies

4. AIX

IBM AIX and QEMU Emulator?

Hi friends, I am a UNIX lover. I have tried several unix flavors including linux, solaris(x86) and FreeBSD, all these are the unices which can be installed on x86 hardware. Now to use the IBM AIX, I searched and googled alot, finally I came across QEME, which emulates the PowerPC platorm to turn... (9 Replies)
Discussion started by: gabam
9 Replies

5. Programming

Running c code in ARM QEMU

I created and Compiled a C program to run in QEMU for ARM. When I run the program using the command #qemu-arm -L /home/arm-2010.09/arm-none-linux-gnueabi/libc ./test it gives me the following error: If 'qemu-arm' is not a typo you can use command-not-found to lookup the package that contains... (0 Replies)
Discussion started by: rupeshkp728
0 Replies

6. Red Hat

help about qemu-kvm boot with initrd

I used the redhat RHEL6 boot with initrd but it failed, can sb help me # /usr/libexec/qemu-kvm --enable-kvm -smp 8 -m 1024 -net nic,model=virtio -net tap,script=/etc/qemu-ifup -initrd /boot/initramfs-2.6.32-279.el6.x86_64.img -kernel /boot/vmlinuz-2.6.32-279.el6.x86_64 -append "root=/dev/ram... (4 Replies)
Discussion started by: yanglei_fage
4 Replies

7. IP Networking

Create a Bridge for Qemu using only loopback

hello networking folks, i have 3 virtual machines that need to talk to each other How can i create a bridge to loopback ? -net tap,vlan=0,ifname=tap1 where tap1 is connected to lo:1 , tap2 is connected to lo:2 etc thx (0 Replies)
Discussion started by: TwiceDone
0 Replies

8. BSD

How to install Ultrix 4.2 on Qemu?

Hi Problem changed. I've got a message showing on the screen which says Guest has not initialized the display (yet) Any how I can fix this? Thanks Jack (4 Replies)
Discussion started by: lucky7456969
4 Replies
QEMU-IMG(1)															       QEMU-IMG(1)

NAME
qemu-img - QEMU disk image utility SYNOPSIS
usage: qemu-img command [command options] DESCRIPTION
qemu-img allows you to create, convert and modify images offline. It can handle all image formats supported by QEMU. Warning: Never use qemu-img to modify images in use by a running virtual machine or any other process; this may destroy the image. Also, be aware that querying an image that is being modified by another process may encounter inconsistent state. OPTIONS
The following commands are supported: check [-f fmt] filename create [-f fmt] [-o options] filename [size] commit [-f fmt] [-t cache] filename convert [-c] [-p] [-f fmt] [-t cache] [-O output_fmt] [-o options] [-s snapshot_name] [-S sparse_size] filename [filename2 [...]] output_filename info [-f fmt] filename snapshot [-l | -a snapshot | -c snapshot | -d snapshot] filename rebase [-f fmt] [-t cache] [-p] [-u] -b backing_file [-F backing_fmt] filename resize filename [+ | -]size Command parameters: filename is a disk image filename fmt is the disk image format. It is guessed automatically in most cases. See below for a description of the supported disk formats. size is the disk image size in bytes. Optional suffixes "k" or "K" (kilobyte, 1024) "M" (megabyte, 1024k) and "G" (gigabyte, 1024M) and T (terabyte, 1024G) are supported. "b" is ignored. output_filename is the destination disk image filename output_fmt is the destination format options is a comma separated list of format specific options in a name=value format. Use "-o ?" for an overview of the options supported by the used format or see the format descriptions below for details. -c indicates that target image must be compressed (qcow format only) -h with or without a command shows help and lists the supported formats -p display progress bar (convert and rebase commands only) -S size indicates the consecutive number of bytes that must contain only zeros for qemu-img to create a sparse image during conversion. This value is rounded down to the nearest 512 bytes. You may use the common size suffixes like "k" for kilobytes. -t cache specifies the cache mode that should be used with the (destination) file. See the documentation of the emulator's "-drive cache=..." option for allowed values. Parameters to snapshot subcommand: snapshot is the name of the snapshot to create, apply or delete -a applies a snapshot (revert disk to saved state) -c creates a snapshot -d deletes a snapshot -l lists all snapshots in the given image Command description: check [-f fmt] filename Perform a consistency check on the disk image filename. Only the formats "qcow2", "qed" and "vdi" support consistency checks. create [-f fmt] [-o options] filename [size] Create the new disk image filename of size size and format fmt. Depending on the file format, you can add one or more options that enable additional features of this format. If the option backing_file is specified, then the image will record only the differences from backing_file. No size needs to be specified in this case. backing_file will never be modified unless you use the "commit" monitor command (or qemu-img commit). The size can also be specified using the size option with "-o", it doesn't need to be specified separately in this case. commit [-f fmt] [-t cache] filename Commit the changes recorded in filename in its base image. convert [-c] [-p] [-f fmt] [-t cache] [-O output_fmt] [-o options] [-s snapshot_name] [-S sparse_size] filename [filename2 [...]] output_filename Convert the disk image filename or a snapshot snapshot_name to disk image output_filename using format output_fmt. It can be optionally compressed ("-c" option) or use any format specific options like encryption ("-o" option). Only the formats "qcow" and "qcow2" support compression. The compression is read-only. It means that if a compressed sector is rewritten, then it is rewritten as uncompressed data. Image conversion is also useful to get smaller image when using a growable format such as "qcow" or "cow": the empty sectors are detected and suppressed from the destination image. You can use the backing_file option to force the output image to be created as a copy on write image of the specified base image; the backing_file should have the same content as the input's base image, however the path, image format, etc may differ. info [-f fmt] filename Give information about the disk image filename. Use it in particular to know the size reserved on disk which can be different from the displayed size. If VM snapshots are stored in the disk image, they are displayed too. snapshot [-l | -a snapshot | -c snapshot | -d snapshot ] filename List, apply, create or delete snapshots in image filename. rebase [-f fmt] [-t cache] [-p] [-u] -b backing_file [-F backing_fmt] filename Changes the backing file of an image. Only the formats "qcow2" and "qed" support changing the backing file. The backing file is changed to backing_file and (if the image format of filename supports this) the backing file format is changed to backing_fmt. There are two different modes in which "rebase" can operate: Safe mode This is the default mode and performs a real rebase operation. The new backing file may differ from the old one and qemu-img rebase will take care of keeping the guest-visible content of filename unchanged. In order to achieve this, any clusters that differ between backing_file and the old backing file of filename are merged into filename before actually changing the backing file. Note that the safe mode is an expensive operation, comparable to converting an image. It only works if the old backing file still exists. Unsafe mode qemu-img uses the unsafe mode if "-u" is specified. In this mode, only the backing file name and format of filename is changed without any checks on the file contents. The user must take care of specifying the correct new backing file, or the guest-visible content of the image will be corrupted. This mode is useful for renaming or moving the backing file to somewhere else. It can be used without an accessible old backing file, i.e. you can use it to fix an image whose backing file has already been moved/renamed. You can use "rebase" to perform a "diff" operation on two disk images. This can be useful when you have copied or cloned a guest, and you want to get back to a thin image on top of a template or base image. Say that "base.img" has been cloned as "modified.img" by copying it, and that the "modified.img" guest has run so there are now some changes compared to "base.img". To construct a thin image called "diff.qcow2" that contains just the differences, do: qemu-img create -f qcow2 -b modified.img diff.qcow2 qemu-img rebase -b base.img diff.qcow2 At this point, "modified.img" can be discarded, since "base.img + diff.qcow2" contains the same information. resize filename [+ | -]size Change the disk image as if it had been created with size. Before using this command to shrink a disk image, you MUST use file system and partitioning tools inside the VM to reduce allocated file systems and partition sizes accordingly. Failure to do so will result in data loss! After using this command to grow a disk image, you must use file system and partitioning tools inside the VM to actually begin using the new space on the device. Supported image file formats: raw Raw disk image format (default). This format has the advantage of being simple and easily exportable to all other emulators. If your file system supports holes (for example in ext2 or ext3 on Linux or NTFS on Windows), then only the written sectors will reserve space. Use "qemu-img info" to know the real size used by the image or "ls -ls" on Unix/Linux. qcow2 QEMU image format, the most versatile format. Use it to have smaller images (useful if your filesystem does not supports holes, for example on Windows), optional AES encryption, zlib based compression and support of multiple VM snapshots. Supported options: "backing_file" File name of a base image (see create subcommand) "backing_fmt" Image format of the base image "encryption" If this option is set to "on", the image is encrypted. Encryption uses the AES format which is very secure (128 bit keys). Use a long password (16 characters) to get maximum protection. "cluster_size" Changes the qcow2 cluster size (must be between 512 and 2M). Smaller cluster sizes can improve the image file size whereas larger cluster sizes generally provide better performance. "preallocation" Preallocation mode (allowed values: off, metadata). An image with preallocated metadata is initially larger but can improve performance when the image needs to grow. qed Image format with support for backing files and compact image files (when your filesystem or transport medium does not support holes). Good performance due to less metadata than the more featureful qcow2 format, especially with cache=writethrough or cache=directsync. Consider using qcow2 which will soon have a similar optimization and is most actively developed. Supported options: "backing_file" File name of a base image (see create subcommand). "backing_fmt" Image file format of backing file (optional). Useful if the format cannot be autodetected because it has no header, like some vhd/vpc files. "cluster_size" Changes the cluster size (must be power-of-2 between 4K and 64K). Smaller cluster sizes can improve the image file size whereas larger cluster sizes generally provide better performance. "table_size" Changes the number of clusters per L1/L2 table (must be power-of-2 between 1 and 16). There is normally no need to change this value but this option can be used for performance benchmarking. qcow Old QEMU image format. Left for compatibility. Supported options: "backing_file" File name of a base image (see create subcommand) "encryption" If this option is set to "on", the image is encrypted. cow User Mode Linux Copy On Write image format. Used to be the only growable image format in QEMU. It is supported only for compatibility with previous versions. It does not work on win32. vdi VirtualBox 1.1 compatible image format. vmdk VMware 3 and 4 compatible image format. Supported options: "backing_fmt" Image format of the base image "compat6" Create a VMDK version 6 image (instead of version 4) vpc VirtualPC compatible image format (VHD). cloop Linux Compressed Loop image, useful only to reuse directly compressed CD-ROM images present for example in the Knoppix CD-ROMs. SEE ALSO
The HTML documentation of QEMU for more precise information and Linux user mode emulator invocation. AUTHOR
Fabrice Bellard 2014-10-04 QEMU-IMG(1)
All times are GMT -4. The time now is 06:11 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy