Welcome Guest ( Log In | Register )


Active Users

Reply to this topicStart new topic
create bootable hdd image with QEMU on Ubuntu, small howto
post Yesterday, 09:47 PM
Post #1


Group: Members
Posts: 9
Thank(s): 1
Joined: 22-September 08
Member No.: 18,416


Small howto on how to create a bootable harddrive with MSDOS. The image can be used for booting over pxe/netboot
(bear over wit me, I'm still very new to this netboot a harddrive-thingy)
Thanks to Jaclaz for pointing me towards the excelent QEMU
Full howto with images:

Until now I've got away with PXE-booting floppy disks containing various tools;symantec ghost clients, bios updates, password crackers etc.
With the recent ghost clients, however, both ghost AND different tcp/ip-drivers for various netcards do not any longer fit on a single floppy. So essentially we need to netboot a harddrive.

This howto is for Ubuntu. I have no knowledge of how to do this on windows (and i've come to the conclusion that I really do not care either). Beware though: There are probably about 187 different ways of accomplish the same as this howto, using WINPE, winbuilder, vista PE, dos netboot with network drive etc, This method might not be the best for you, or even suit your needs at all. Oh... and don't come yelling at me when you wrecked your MBR!

Install qemu

# apt-get install qemu-launcher qemu

launch qemu (in “applications--->Accessories”)

Create a new emulated harddisk with as much space you need (the smaller the image, the faster your download with tftp will be).

With hard disk 0, create new image. Use “empty raw image”, give it a size of 100 MB (or any other size you prefer) and press “ok”.

“Insert” a floppy disk with MSDOS OS (or any other os of choice, for that matter)

I've chosen Msdos 6.22 (because it's available), but you could also use freedos, PC DOS 2000 (which comes with ghost). You need these dos programs: fdisk, format and sys.

Fdisk: dos disk partitioner

Format: format the drive

sys: make disk bootable (transfer SYStem)


At the DOS prompt, type “fdisk” to start the partitioner.

Choose “1”: Create DOS partition or Logical DOS Drive

Next, choose “1”, Create Primary DOS partition.

Answear “yes” to the question wether you would like to use all available space and make partition active.

Reboot the virtual machine.


after reboot, type “format c:” at the DOS prompt.

Proceed after the warning (answear “yes”)

Give a fairly reasonable name. Or not.

After the format is finished, transfer the system to your new disk. At the DOS prompt, type “sys c:”


You've just made a bootable harddrive image with MSDOS! With this tool, the world is truly yours! Now as it is, this disk is not very much usable, but fitted with the latest ghost version or perhaps bios updates for your clients or servers, it makes an awsome companion.


To boot your new image via pxe/netboot and pxelinux, you need this menuentry:

label blank disk harddisk testhd

kernel memdisk

append initrd=testhd harddisk

To mount your new harddrive image on a loopback interface:

sudo mkdir /mnt/dosdisk
sudo mount -o loop,offset=32256 /home/einar/qemu/hdd /mnt/dosdisk
sudo cp -r /home/einar/dosapps /mnt/dosdisk/
sudo umount /mnt/dosdisk

You may mount a floppydrive the same way, without the “offset”:

mount -o loop /home/einar/qemu/floppy.img /mnt/floppy

Go to the top of the page
+Quote Post
« Next Oldest · Tutorials · Next Newest »

Fast ReplyReply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:


Display Mode: Standard · Switch to: Linear+ · Switch to: Outline

Track this topic · Email this topic · Print this topic · Subscribe to this forum

RSS Lo-Fi Version Time is now: 28th October 2008 - 11:52 PM

W3C XHTML • © 2008 Boot Land • All rights reserved • W3C CSS