3

I want to:

  1. Place the .iso of a live CD in a directory.
  2. Use qemu (kvm or kqemu) to run the .iso
  3. Put a 2nd live CD .iso in the same directory.
  4. Have the 1st live CD mount the 2nd .iso.

Say, I have 2 .iso files in the same directory,
how can I emulate one and mount the 2nd
from within the 1st?

--
Wishing you Happiness, Joy, and Laugher,
Drew Brown

2 Answers2

6

I assume that both the ISO images are located outside the virtual file-system. From the KVM man pages, the option that you are looking for is -drive instead of -cdrom.

Instead of -cdrom you should be able to define even multiple cd-roms and mount them from within the live-cd. They should appear as /dev/hda to /dev/hdd in the VM.

qemu -drive file=file,index=0,media=cdrom
qemu -drive file=file,index=1,media=cdrom
qemu -drive file=file,index=2,media=cdrom
qemu -drive file=file,index=3,media=cdrom
sybreon
  • 7,357
  • 1
  • 19
  • 19
2

To run from a live CD, you just need to specify it when starting quemu, as in

qemu -cdrom myiso.iso 

To mount a second live CD, that in principle works as under regular Linux:

mount -o loop disk1.iso /mnt/disk

(must be done as root, mountpount /mnt/disk is arbitrary, but must exist).

You just need to arrange to put your 2nd iso into a directory where the QEMU VM can see it (or copy it over the net etc.).

sleske
  • 9,851
  • 4
  • 33
  • 44