Change cdrom: Difference between revisions

From KVM
(How to change the cdrom via the monitor interface.)
 
mNo edit summary
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
Qemu provides a way to change iso in the cdrom via the monitor interface.
Qemu provides a way to change the iso in the virtual cdrom device via the monitor interface (Ctrl+Alt+2).


  QEMU 0.10.5 monitor - type 'help' for more information
  QEMU 0.10.5 monitor - type 'help' for more information
  (qemu)
  (qemu)


The commands you'll want to use, '''info block''', '''eject''', and '''change'''.  First we need to determine which block device is the cdrom you are interested in.  Issue the '''info block''' command and look for cdrom devices.
The commands you'll want to use are '''info block''', '''eject''', and '''change'''.  First we need to determine which block device is the cdrom device you are interested in.  Issue the '''info block''' command and look for cdrom devices.


  (qemu) info block
  (qemu) info block
Line 12: Line 12:
  sd0: type=floppy removable=1 locked=0 [not inserted]
  sd0: type=floppy removable=1 locked=0 [not inserted]


ide1-cd0 is the only cdrom device in this example and there isn't any media inserted.  To change the cdrom, we issue the change command supplying the device name (ide1-cd0) and the path to the new iso file.
ide1-cd0 is the only cdrom device in this example and there isn't any media inserted.  To change the iso, we issue the '''change''' command supplying the device name (ide1-cd0) and the path to the new iso file.


  (qemu) change ide1-cd0 /tmp/dsl-4.4.10.iso  
  (qemu) change ide1-cd0 /tmp/dsl-4.4.10.iso  
Line 36: Line 36:
  floppy0: type=floppy removable=1 locked=0 [not inserted]
  floppy0: type=floppy removable=1 locked=0 [not inserted]
  sd0: type=floppy removable=1 locked=0 [not inserted]
  sd0: type=floppy removable=1 locked=0 [not inserted]
[[Category:HowTo]][[Category:Docs]][[Category:Devices]]

Latest revision as of 21:12, 25 December 2015

Qemu provides a way to change the iso in the virtual cdrom device via the monitor interface (Ctrl+Alt+2).

QEMU 0.10.5 monitor - type 'help' for more information
(qemu)

The commands you'll want to use are info block, eject, and change. First we need to determine which block device is the cdrom device you are interested in. Issue the info block command and look for cdrom devices.

(qemu) info block
ide0-hd0: type=hd removable=0 file=/dev/null ro=0 drv=host_device encrypted=0
ide1-cd0: type=cdrom removable=1 locked=0 [not inserted]
floppy0: type=floppy removable=1 locked=0 [not inserted]
sd0: type=floppy removable=1 locked=0 [not inserted]

ide1-cd0 is the only cdrom device in this example and there isn't any media inserted. To change the iso, we issue the change command supplying the device name (ide1-cd0) and the path to the new iso file.

(qemu) change ide1-cd0 /tmp/dsl-4.4.10.iso 
(qemu) info block
ide0-hd0: type=hd removable=0 file=/dev/null ro=0 drv=host_device encrypted=0
ide1-cd0: type=cdrom removable=1 locked=0 file=/tmp/dsl-4.4.10.iso ro=0  drv=raw encrypted=0
floppy0: type=floppy removable=1 locked=0 [not inserted]
sd0: type=floppy removable=1 locked=0 [not inserted]
(qemu) 

In case you already have a cdrom in the drive you need to eject the current iso first before issuing the change command. The eject command takes the name of the cdrom block device.

(qemu) eject ide1-cd0
(qemu) info block
ide0-hd0: type=hd removable=0 file=/dev/null ro=0 drv=host_device encrypted=0
ide1-cd0: type=cdrom removable=1 locked=0 [not inserted]
floppy0: type=floppy removable=1 locked=0 [not inserted]
sd0: type=floppy removable=1 locked=0 [not inserted]
(qemu) change ide1-cd0 /tmp/fedora11.iso 
(qemu) info block
ide0-hd0: type=hd removable=0 file=/dev/null ro=0 drv=host_device encrypted=0
ide1-cd0: type=cdrom removable=1 locked=0 file=/tmp/fedora11.iso ro=0 drv=raw  encrypted=0
floppy0: type=floppy removable=1 locked=0 [not inserted]
sd0: type=floppy removable=1 locked=0 [not inserted]