summaryrefslogtreecommitdiff
path: root/Distrib/HurdOnQEMU.mdwn
blob: 377e26f26adde02e49301039f3cdff0d2e985416 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
## <a name="Hurd_on_QEMU"> </a> Hurd on QEMU

I will assume you have already installed [[QEMU]].

You will need the [debian grub boot disk package](ftp://ftp.debian.org/debian/pool/main/g/grub/grub-disk_0.95+cvs20040624-17_all.deb) for the floppy.img . The floppy boot image is called grub-0.95-i386-pc.ext2fs.gz and you can [[Gunzip]] this and rename it to floppy.img if you like.

First off use `qemu-img` to create a disk image. I set mine to 2 gigabytes.

    # qemu-img create hd0.img 2G

Now you will need a cdrom image or an install CD. I will use Debian/Hurd K9 in this example. I use a floppy image with [[GRUB]] on it to boot the system after I'm done installing. The first time you run it you'll want to use `-boot d` to boot off the cdrom.

    # qemu -hda hd0.img -cdrom debian-K9-hurd-i386-CD1.iso -fda floppy.img  -boot d

Now at his point do the regular install using `hd0` as your harddrive. Partition it and install the base system. Instead of rebooting, just stop QEMU (it'll keep booting off the cdrom).

**Important:** Current versions of gnumach will not boot in QEMU unless you use QEMU's `-isa` command line option (`-M isapc` for QEMU 0.8). A patch to fix this is in the works.

Now run your image with floppy booting and finish the install (`./native-install` .. etc)

    # qemu -isa -hda hd0.img -cdrom debian-K9-hurd-i386-CD1.iso -fda floppy.img -boot a

So far I haven't been able to get networking going, it seems as if gnumach is not finding the ethernet device, although I haven't really looked into it that far.

### <a name="Mounting_disk_image"> Mounting disk image </a>

If you want to mount your disk image, you'll either have to use mount or a program called [[Lomount]] to do this. If you are going to use mount, you will need to know the correct offset.

    # mount -o loop,offset=OFFSET hd0.img /mnt/diskimage

-- [[Main/AndrewResch]] - 23 Feb 2005

Readers may be interested in [[Hurd/QemuImageForL4]] too.

-- [[Main/OgnyanKulev]] - 23 Feb 2005

To find the offset, you can run (from your host OS):

    $ fdisk -ul hd0.img

and multiply sectors by the # of bytes given

-- [[Main/EldonKoyle]] - 25 Aug 2005