Quick ISO testing with Qemu

Tagged:

QEMU is a super quick way to test custom ISO images. The major linux distros have it in their respective repositories. For recent RPM-based systems (such as CentOS and Fedora), it's as easy as:
$ sudo yum -y install qemu
To setup the base environment:

<code>
<blockquote>$ mkdir ~/isotest
$ qemu-img create  ~/isotest/qemu-hd1.img 2G     # creates a 2GB hard drive image</blockquote>
Create a new shell script, qemu-test.sh, to wrap the commands:
 
</code>

#!/bin/bash

sudo umount /dev/shm
sudo mount -t tmpfs -o size=144m none /dev/shm
qemu -net nic -net user -cdrom "$1" -hda $HOME/isotest/qemu-hd1.img -boot d
This command will tell QEMU to boot the CD passed on the command line, instead of trying to boot from the hard drive image.

Finally, running is as easy as:

$ ~/qemu-test.sh my-test-cd.iso

Comments

Use sudo mount -o

Use
sudo mount -o remount,size=144m /dev/shm
instead of unmounting and then mounting, it's faster and safer :-)

[...] To quickly test your

[...] To quickly test your new ISO, use qemu (as outlined in another post) [...]

[...] To quickly test your

[...] To quickly test your new ISO, use qemu (as outlined in another post) [...]

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <pre>, <shell>, <c>, <drupal6>, <java>, <javascript>, <objc>, <perl>, <php>, <python>, <rails>, <ruby>, <sql>, <xmlcode>. The supported tag styles are: <foo>, [foo].

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.