Quick ISO testing with Qemu
Submitted by greg on Sun, 12/09/2007 - 20:02
#!/bin/bash
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
Bookmark/Search this post with

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