Sponsored Content
Full Discussion: QEMU not booting my image
Special Forums Hardware Filesystems, Disks and Memory QEMU not booting my image Post 302484866 by Corona688 on Monday 3rd of January 2011 01:13:37 PM
Old 01-03-2011
Quote:
Originally Posted by neur0n
ok I found these step on how to make a bootable image:

Code:
$ cd /usr/lib/grub/i386-pc
$ dd if=stage1 of=image.img bs=512 count=1
1+0 records in
1+0 records out
$ dd if=stage2 of=image.img bs=512 seek=1
153+1 records in
153+1 records out
$

But is this correct
Sort of. You didn't need to create image.img in the current directory, and probably shouldn't, and didn't need to run any of that as root. It also only creates a 105KB file, not a 1440KB file, so I'd modify it a little:

Code:
cd /usr/lib/grub/i386-pc
# make a completely blank disk image
dd if=/dev/zero of=~/image.img bs=512 count=2880
# copy the boot sector onto it.  "conv=notrunc" tells it not to shrink the file.
dd if=stage1 of=~/image.img conv=notrunc bs=512
# copy stage2 onto it
dd if=stage2 of=~/image.img conv=notrunc seek=1 bs=512

My system has them in /lib/grub/, not /usr/lib/grub incidentally, but systems do differ. "bs=512" is redundant since dd defaults to that but it doesn't hurt anything.

Quote:
and if it is will I be able to freely add files afterwards?
It contains no filesystem, there's nothing to add files to. It would only boot to a grub prompt.

But it should almost certainly be a valid boot disk image, with which you can test qemu.

---------- Post updated at 12:13 PM ---------- Previous update was at 12:05 PM ----------

[edit] the below instructions didn't work because the grub utility can't install on a floppy that way. argh.

Last edited by Corona688; 01-03-2011 at 02:33 PM..
 

8 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Create an Ignite image on tape from Online IgniteUX image

Hi, (HP-UX 11.11) I need to create a tape image of an igniteUX image created on our igniteUX server. That is to say. I have a "Online" image of the igniteUX of the targeted system but I now need to copy it to a useable TAPE (igniteUX) image so i can build an other server from it that is not... (3 Replies)
Discussion started by: Andrek
3 Replies

2. 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

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. Solaris

Dual Booting - Solaris image CD doesn't read in BIOS

I am trying to install solaris 10-x86 as second OS on top of Windows XP. I have downloaded iso image from Oracle website and burned into bootable cd. when I loaded into CD-drive and made changes in BIOS to boot from CD. Its not reading from CD drive. After restarting the system with CD(solaris... (8 Replies)
Discussion started by: SunSolars_admin
8 Replies

5. Shell Programming and Scripting

matching image files to create one image

Hi, I have two sets of image files. Both sets have names A to Z but set 1 ends with .cdt.png and set 2 ends with .matrix.png. I want set 1 to match with set 2 if the names match (i.e. A.cdt.png will match with A.matrix.png) and with the convert image tool (program for images), it will merge the... (6 Replies)
Discussion started by: kylle345
6 Replies

6. 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

7. Virtualization and Cloud Computing

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... (3 Replies)
Discussion started by: sea
3 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] OPTIONS
The following commands are supported: check [-f fmt] filename create [-s] [-f fmt] [-o options] filename [size] commit [-f fmt] filename convert [-c] [-s] [-f fmt] [-O output_fmt] [-o options] filename [filename2 [...]] output_filename info [-f fmt] filename snapshot [-l | -a snapshot | -c snapshot | -d snapshot] filename rebase [-u] -b backing_file [-F backing_fmt] filename 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 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: 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] filename Commit the changes recorded in filename in its base image. convert [-c] [-f fmt] [-O output_fmt] [-o options] filename [filename2 [...]] output_filename Convert the disk image filename 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. 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. host_device Host device format. This format should be used instead of raw when converting to block devices or other devices where "holes" are not supported. 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. 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 2010-07-01 QEMU-IMG(1)
All times are GMT -4. The time now is 03:39 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy