Skip to contentSkip to conversation

Issues booting off virtual SCSI drives in kvm-69

PATCH Applied Freddie Cash 4 participants 5 messages May 30, 2008 – Jun 4, 2008 KVM

lore
Share & tools
lore
#0 lore raw

Am I missing something simple, or can you only boot off virtual IDE drives?

I'm running kvm-69 (from the sid repos) on 64-bit Debian Lenny, using the kvm modules that are part of the kernel 2.6.25 package on Debian.

I can create virtual SCSI drives, boot off a virtual CD-ROM, and install Debian onto the vSCSI drives. However, I cannot boot off the virtual SCSI drives following the install.

The VM is being run as:
/usr/bin/kvm -name webmail -daemonize -localtime -usb -usbdevice tablet -smp 1 -m 2048 -vnc :05 -pidfile /var/run/kvm/webmail.pid -net nic,macaddr=00:16:3e:00:00:05,model=rtl8139 -net tap,ifname=tap05 -boot c -drive index=1,media=disk,if=scsi,file=/dev/mapper/vol0-webmail--storage -drive index=0,media=disk,if=scsi,file=/dev/mapper/vol0-webmail

And the error message on the virtual console is:
Booting from Hard Disk...
Boot from Hard Disk failed: could not read the boot disk
FATAL: No bootable device

The virtual SCSI drives are configured as:

  sda1  100 MB  /boot (bootable flag set)
  sda2    5 GB  /
  sda5   50 GB  /usr
  sda6   50 GB  /var
  sdb1  100 GB  /home

GRUB is installed into the MBR of the first SCSI drive (sda).

I've tried reversing the two -drive options on the commandline, as well as reversing the index numbers on the commandline.

"info block" in the QEmu monitor shows the drives as being attached, and in the correct order.

What, if anything, am I missing? Or is this just not possible?

Signature · 2 lines
Freddie Cash
[email protected]
#1 lore raw
Quoted 2 lines · Freddie Cash

Am I missing something simple, or can you only boot off virtual IDE drives?

add 'boot=on' to the drive specification:

/usr/bin/kvm -name webmail -daemonize -localtime -usb -usbdevice tablet -smp 1 -m 2048 -vnc :05 -pidfile /var/run/kvm/webmail.pid -net nic,macaddr=00:16:3e:00:00:05,model=rtl8139 -net tap,ifname=tap05 -boot c -drive index=1,media=disk,if=scsi,file=/dev/mapper/vol0-webmail--storage -drive index=0,media=disk,if=scsi,file=/dev/mapper/vol0-webmail,boot=on

that got me for a long time too.

Signature · 1 line
Javier
#2 lore raw
Quoted 6 lines · you
Quoted 2 lines · Freddie Cash

Am I missing something simple, or can you only boot off virtual IDE drives?

add 'boot=on' to the drive specification:

Quoted 8 lines

/usr/bin/kvm -name webmail -daemonize -localtime -usb -usbdevice tablet -smp 1 -m 2048 -vnc :05 -pidfile /var/run/kvm/webmail.pid -net nic,macaddr=00:16:3e:00:00:05,model=rtl8139 -net tap,ifname=tap05 -boot c -drive index=1,media=disk,if=scsi,file=/dev/mapper/vol0-webmail--storage -drive index=0,media=disk,if=scsi,file=/dev/mapper/vol0-webmail,boot=on

that got me for a long time too.

A few minutes after sending this, I found, buried deep down in my google results, this non-documented option. :) Spent a good hour reading through mailing list archives, forums posts, and various websites before finding this.

Anyone willing to update the man pages for qemu and/or kvm-qemu to document this option? :D

Signature · 2 lines
Freddie Cash
[email protected]
#3 lore raw

PATCH 1/1 qemu: document "boot" option for "drive" flag

In reply to Javier Guerra

complement 982e9b725e32f58158b6b9968f04e3377f52e63 with some basic documentation, extracted from the commit message.

---
 qemu/qemu-doc.texi |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
qemu/qemu-doc.texi +8 -0
index 7a24676..fcb220f 100644
@@ -266,6 +266,8 @@ These options have the same definition as they have in @option{-hdachs}.
 Specify which disk @var{format} will be used rather than detecting
 the format.  Can be used to specifiy format=raw to avoid interpreting
 an untrusted format header.
+@item boot=@var{boot}
+@var{boot} if "on" allows to enable extboot for a given drive so it can be used as a boot drive.
 @end table
 
 Instead of @option{-cdrom} you can use:
@@ -297,6 +299,12 @@ You can connect a SCSI disk with unit ID 6 on the bus #0:
 qemu -drive file=file,if=scsi,bus=0,unit=6
 @end example
 
+To boot from a SCSI disk, one would use:
+
+@example
+qemu -drive file=file,if=scsi,boot=on
+@end example
+
 Instead of @option{-fda}, @option{-fdb}, you can use:
 @example
 qemu -drive file=file,index=0,if=floppy
Signature · 1 line
1.5.3.7
Applied
#4 lore raw

Re: [PATCH] qemu: document "boot" option for "drive" flag

Quoted 4 lines · Carlo Marcelo Arenas Belon

complement 982e9b725e32f58158b6b9968f04e3377f52e63 with some basic documentation, extracted from the commit message.

Applied, thanks.

Signature · 1 line
Do not meddle in the internals of kernels, for they are subtle and quick to panic.