All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] Running KVM guest on X86
@ 2012-08-06 15:40 Bhushan Bharat-R65777
  2012-08-06 15:56 ` Avi Kivity
  2012-08-06 15:56 ` Alex Williamson
  0 siblings, 2 replies; 14+ messages in thread
From: Bhushan Bharat-R65777 @ 2012-08-06 15:40 UTC (permalink / raw)
  To: qemu-devel, Avi Kivity, alex.williamson

Hi Avi/All,

I am facing issue to boot KVM guest on x86 (I used to work on PowerPC platform and do not have enough knowledge of x86). I am working on making VFIO working on PowerPC Booke, So I have cloned Alex Williamsons git repository, compiled kernel for x86 on fedora with virtualization configuration (selected all kernel config options for same). Run below command to boot Guest (I have not provided vfio device yet): 

"qemu-system-x86_64 -enable-kvm -m 1024 -nographic -kernel arch/x86_64/boot/bzImage -initrd /boot/initramfs-3.5.0-rc4+.img -serial tcp::4444,server,telnet"

After the I can see qemu command line (able to run various commands like "info registers" etc), while guest does not boot (not even the first print comes).

Can anyone help in what I am missing or doing wrong?

Thanks
-Bharat

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] Running KVM guest on X86
  2012-08-06 15:40 [Qemu-devel] Running KVM guest on X86 Bhushan Bharat-R65777
@ 2012-08-06 15:56 ` Avi Kivity
  2012-08-06 15:56 ` Alex Williamson
  1 sibling, 0 replies; 14+ messages in thread
From: Avi Kivity @ 2012-08-06 15:56 UTC (permalink / raw)
  To: Bhushan Bharat-R65777; +Cc: alex.williamson, qemu-devel

On 08/06/2012 06:40 PM, Bhushan Bharat-R65777 wrote:
> Hi Avi/All,
> 
> I am facing issue to boot KVM guest on x86 (I used to work on PowerPC platform and do not have enough knowledge of x86). I am working on making VFIO working on PowerPC Booke, So I have cloned Alex Williamsons git repository, compiled kernel for x86 on fedora with virtualization configuration (selected all kernel config options for same). Run below command to boot Guest (I have not provided vfio device yet): 
> 
> "qemu-system-x86_64 -enable-kvm -m 1024 -nographic -kernel arch/x86_64/boot/bzImage -initrd /boot/initramfs-3.5.0-rc4+.img -serial tcp::4444,server,telnet"
> 
> After the I can see qemu command line (able to run various commands like "info registers" etc), while guest does not boot (not even the first print comes).
> 
> Can anyone help in what I am missing or doing wrong?

Drop '-nographic'.  Alterantively, add '-append console=ttyS0'.


-- 
error compiling committee.c: too many arguments to function

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] Running KVM guest on X86
  2012-08-06 15:40 [Qemu-devel] Running KVM guest on X86 Bhushan Bharat-R65777
  2012-08-06 15:56 ` Avi Kivity
@ 2012-08-06 15:56 ` Alex Williamson
  2012-08-07  6:30   ` Bhushan Bharat-R65777
  1 sibling, 1 reply; 14+ messages in thread
From: Alex Williamson @ 2012-08-06 15:56 UTC (permalink / raw)
  To: Bhushan Bharat-R65777; +Cc: qemu-devel, Avi Kivity

On Mon, 2012-08-06 at 15:40 +0000, Bhushan Bharat-R65777 wrote:
> Hi Avi/All,
> 
> I am facing issue to boot KVM guest on x86 (I used to work on PowerPC platform and do not have enough knowledge of x86). I am working on making VFIO working on PowerPC Booke, So I have cloned Alex Williamsons git repository, compiled kernel for x86 on fedora with virtualization configuration (selected all kernel config options for same). Run below command to boot Guest (I have not provided vfio device yet): 
> 
> "qemu-system-x86_64 -enable-kvm -m 1024 -nographic -kernel arch/x86_64/boot/bzImage -initrd /boot/initramfs-3.5.0-rc4+.img -serial tcp::4444,server,telnet"
> 
> After the I can see qemu command line (able to run various commands like "info registers" etc), while guest does not boot (not even the first print comes).
> 
> Can anyone help in what I am missing or doing wrong?

x86 doesn't use the serial port for console by default, so you're making
things quite a bit more difficult that way.  Typically you'll want to
provide a disk image (the -hda option is the easiest way to do this), a
display (-vga std -vnc :0 is again easiest), and probably something to
install from (-cdrom <image.iso>).  You can also add a -boot d to get it
to choose the cdrom the first time for install.  Thanks,

Alex

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] Running KVM guest on X86
  2012-08-06 15:56 ` Alex Williamson
@ 2012-08-07  6:30   ` Bhushan Bharat-R65777
  2012-08-07  7:31     ` Gleb Natapov
  2012-08-09 14:58     ` Stuart Yoder
  0 siblings, 2 replies; 14+ messages in thread
From: Bhushan Bharat-R65777 @ 2012-08-07  6:30 UTC (permalink / raw)
  To: Alex Williamson; +Cc: qemu-devel, Avi Kivity



> -----Original Message-----
> From: Alex Williamson [mailto:alex.williamson@redhat.com]
> Sent: Monday, August 06, 2012 9:27 PM
> To: Bhushan Bharat-R65777
> Cc: qemu-devel@nongnu.org; Avi Kivity
> Subject: Re: Running KVM guest on X86
> 
> On Mon, 2012-08-06 at 15:40 +0000, Bhushan Bharat-R65777 wrote:
> > Hi Avi/All,
> >
> > I am facing issue to boot KVM guest on x86 (I used to work on PowerPC platform
> and do not have enough knowledge of x86). I am working on making VFIO working on
> PowerPC Booke, So I have cloned Alex Williamsons git repository, compiled kernel
> for x86 on fedora with virtualization configuration (selected all kernel config
> options for same). Run below command to boot Guest (I have not provided vfio
> device yet):
> >
> > "qemu-system-x86_64 -enable-kvm -m 1024 -nographic -kernel
> arch/x86_64/boot/bzImage -initrd /boot/initramfs-3.5.0-rc4+.img -serial
> tcp::4444,server,telnet"
> >
> > After the I can see qemu command line (able to run various commands like "info
> registers" etc), while guest does not boot (not even the first print comes).
> >
> > Can anyone help in what I am missing or doing wrong?
> 
> x86 doesn't use the serial port for console by default, so you're making things
> quite a bit more difficult that way.  Typically you'll want to provide a disk
> image (the -hda option is the easiest way to do this), a display (-vga std -vnc
> :0 is again easiest), and probably something to install from (-cdrom
> <image.iso>).  You can also add a -boot d to get it to choose the cdrom the
> first time for install.  Thanks,

Thanks Avi and Alex, I can see the KVM guest boot prints by adding -append "console=ttyS0"

Now my exact command is like: 
"qemu-system-x86_64 -enable-kvm -nographic -nodefconfig -kernel /boot/vmlinuz-3.5.0+  -initrd /boot/initramfs-3.5.0+.img -append "console=ttyS0" -hda fedora.qcow  -m 1024"

  Where fedora.qcow is created by "qemu-img create fedora.qcow 5G"

With this it is falling to Dracut, below are the error prints:

--------------------
[    2.288931] dracut: FATAL: No or empty root= argument
[    2.291808] dracut: Refusing to continue


[    2.294721] dracut Warning: Signal caught!
dracut Warning: Signal caught!
[    2.298894] dracut Warning: dracut: FATAL: No or empty root= argument
dracut Warning: dracut: FATAL: No or empty root= argument
[    2.304713] dracut Warning: dracut: Refusing to continue
dracut Warning: dracut: Refusing to continue

[    2.320311] init (1) used greatest stack depth: 2664 bytes left
[    2.323851] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000100
[    2.323851] 
[    2.324551] Pid: 1, comm: init Not tainted 3.5.0+ #7
[    2.324551] Call Trace:
[    2.324551]  [<ffffffff8171c34e>] panic+0xc6/0x1e1
[    2.324551]  [<ffffffff81729be0>] ? _raw_write_unlock_irq+0x30/0x50
[    2.324551]  [<ffffffff810c0020>] do_exit+0xa20/0xb70
[    2.324551]  [<ffffffff8172a215>] ? retint_swapgs+0x13/0x1b
[    2.324551]  [<ffffffff810c04bf>] do_group_exit+0x4f/0xc0
[    2.324551]  [<ffffffff810c0547>] sys_exit_group+0x17/0x20
[    2.324551]  [<ffffffff81732d69>] system_call_fastpath+0x16/0x1b
-----------------

Should I mount the root-file-system in disk and pass -append "root=<mount-path>.

I had no luck when I tried "qemu-system-x86_64 -device virtio-scsi-pci,id=scsi  -enable-kvm  -nographic -nodefconfig -nodefaults  -chardev stdio,id=charserial0  -device isa-serial,chardev=charserial0,id=serial0  -drive file=fedora.qcow,if=none,id=sda  -device scsi-disk,bus=scsi.0,drive=sda  -device sga  -kernel /boot/vmlinuz-3.5.0+  -initrd /boot/initramfs-3.5.0+.img  -append "console=ttyS0" -m 1024"
 

Thanks in Advance
-Bharat


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] Running KVM guest on X86
  2012-08-07  6:30   ` Bhushan Bharat-R65777
@ 2012-08-07  7:31     ` Gleb Natapov
  2012-08-09 14:58     ` Stuart Yoder
  1 sibling, 0 replies; 14+ messages in thread
From: Gleb Natapov @ 2012-08-07  7:31 UTC (permalink / raw)
  To: Bhushan Bharat-R65777; +Cc: Alex Williamson, qemu-devel, Avi Kivity

On Tue, Aug 07, 2012 at 06:30:05AM +0000, Bhushan Bharat-R65777 wrote:
> 
> 
> > -----Original Message-----
> > From: Alex Williamson [mailto:alex.williamson@redhat.com]
> > Sent: Monday, August 06, 2012 9:27 PM
> > To: Bhushan Bharat-R65777
> > Cc: qemu-devel@nongnu.org; Avi Kivity
> > Subject: Re: Running KVM guest on X86
> > 
> > On Mon, 2012-08-06 at 15:40 +0000, Bhushan Bharat-R65777 wrote:
> > > Hi Avi/All,
> > >
> > > I am facing issue to boot KVM guest on x86 (I used to work on PowerPC platform
> > and do not have enough knowledge of x86). I am working on making VFIO working on
> > PowerPC Booke, So I have cloned Alex Williamsons git repository, compiled kernel
> > for x86 on fedora with virtualization configuration (selected all kernel config
> > options for same). Run below command to boot Guest (I have not provided vfio
> > device yet):
> > >
> > > "qemu-system-x86_64 -enable-kvm -m 1024 -nographic -kernel
> > arch/x86_64/boot/bzImage -initrd /boot/initramfs-3.5.0-rc4+.img -serial
> > tcp::4444,server,telnet"
> > >
> > > After the I can see qemu command line (able to run various commands like "info
> > registers" etc), while guest does not boot (not even the first print comes).
> > >
> > > Can anyone help in what I am missing or doing wrong?
> > 
> > x86 doesn't use the serial port for console by default, so you're making things
> > quite a bit more difficult that way.  Typically you'll want to provide a disk
> > image (the -hda option is the easiest way to do this), a display (-vga std -vnc
> > :0 is again easiest), and probably something to install from (-cdrom
> > <image.iso>).  You can also add a -boot d to get it to choose the cdrom the
> > first time for install.  Thanks,
> 
> Thanks Avi and Alex, I can see the KVM guest boot prints by adding -append "console=ttyS0"
> 
> Now my exact command is like: 
> "qemu-system-x86_64 -enable-kvm -nographic -nodefconfig -kernel /boot/vmlinuz-3.5.0+  -initrd /boot/initramfs-3.5.0+.img -append "console=ttyS0" -hda fedora.qcow  -m 1024"
> 
>   Where fedora.qcow is created by "qemu-img create fedora.qcow 5G"
> 
> With this it is falling to Dracut, below are the error prints:
> 
> --------------------
> [    2.288931] dracut: FATAL: No or empty root= argument
> [    2.291808] dracut: Refusing to continue
> 
> 
> [    2.294721] dracut Warning: Signal caught!
> dracut Warning: Signal caught!
> [    2.298894] dracut Warning: dracut: FATAL: No or empty root= argument
> dracut Warning: dracut: FATAL: No or empty root= argument
> [    2.304713] dracut Warning: dracut: Refusing to continue
> dracut Warning: dracut: Refusing to continue
> 
> [    2.320311] init (1) used greatest stack depth: 2664 bytes left
> [    2.323851] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000100
> [    2.323851] 
> [    2.324551] Pid: 1, comm: init Not tainted 3.5.0+ #7
> [    2.324551] Call Trace:
> [    2.324551]  [<ffffffff8171c34e>] panic+0xc6/0x1e1
> [    2.324551]  [<ffffffff81729be0>] ? _raw_write_unlock_irq+0x30/0x50
> [    2.324551]  [<ffffffff810c0020>] do_exit+0xa20/0xb70
> [    2.324551]  [<ffffffff8172a215>] ? retint_swapgs+0x13/0x1b
> [    2.324551]  [<ffffffff810c04bf>] do_group_exit+0x4f/0xc0
> [    2.324551]  [<ffffffff810c0547>] sys_exit_group+0x17/0x20
> [    2.324551]  [<ffffffff81732d69>] system_call_fastpath+0x16/0x1b
> -----------------
> 
> Should I mount the root-file-system in disk and pass -append "root=<mount-path>.
> 
Yes, you should. Not <mount-path>, but root device. Something like
"root=/dev/sda1"

> I had no luck when I tried "qemu-system-x86_64 -device virtio-scsi-pci,id=scsi  -enable-kvm  -nographic -nodefconfig -nodefaults  -chardev stdio,id=charserial0  -device isa-serial,chardev=charserial0,id=serial0  -drive file=fedora.qcow,if=none,id=sda  -device scsi-disk,bus=scsi.0,drive=sda  -device sga  -kernel /boot/vmlinuz-3.5.0+  -initrd /boot/initramfs-3.5.0+.img  -append "console=ttyS0" -m 1024"
>  
> 
> Thanks in Advance
> -Bharat
> 

--
			Gleb.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] Running KVM guest on X86
  2012-08-07  6:30   ` Bhushan Bharat-R65777
  2012-08-07  7:31     ` Gleb Natapov
@ 2012-08-09 14:58     ` Stuart Yoder
  2012-08-09 17:39       ` Bhushan Bharat-R65777
  1 sibling, 1 reply; 14+ messages in thread
From: Stuart Yoder @ 2012-08-09 14:58 UTC (permalink / raw)
  To: Bhushan Bharat-R65777; +Cc: Alex Williamson, qemu-devel, Avi Kivity

On Tue, Aug 7, 2012 at 1:30 AM, Bhushan Bharat-R65777
<R65777@freescale.com> wrote:
>
>
>> -----Original Message-----
>> From: Alex Williamson [mailto:alex.williamson@redhat.com]
>> Sent: Monday, August 06, 2012 9:27 PM
>> To: Bhushan Bharat-R65777
>> Cc: qemu-devel@nongnu.org; Avi Kivity
>> Subject: Re: Running KVM guest on X86
>>
>> On Mon, 2012-08-06 at 15:40 +0000, Bhushan Bharat-R65777 wrote:
>> > Hi Avi/All,
>> >
>> > I am facing issue to boot KVM guest on x86 (I used to work on PowerPC platform
>> and do not have enough knowledge of x86). I am working on making VFIO working on
>> PowerPC Booke, So I have cloned Alex Williamsons git repository, compiled kernel
>> for x86 on fedora with virtualization configuration (selected all kernel config
>> options for same). Run below command to boot Guest (I have not provided vfio
>> device yet):
>> >
>> > "qemu-system-x86_64 -enable-kvm -m 1024 -nographic -kernel
>> arch/x86_64/boot/bzImage -initrd /boot/initramfs-3.5.0-rc4+.img -serial
>> tcp::4444,server,telnet"
>> >
>> > After the I can see qemu command line (able to run various commands like "info
>> registers" etc), while guest does not boot (not even the first print comes).
>> >
>> > Can anyone help in what I am missing or doing wrong?
>>
>> x86 doesn't use the serial port for console by default, so you're making things
>> quite a bit more difficult that way.  Typically you'll want to provide a disk
>> image (the -hda option is the easiest way to do this), a display (-vga std -vnc
>> :0 is again easiest), and probably something to install from (-cdrom
>> <image.iso>).  You can also add a -boot d to get it to choose the cdrom the
>> first time for install.  Thanks,
>
> Thanks Avi and Alex, I can see the KVM guest boot prints by adding -append "console=ttyS0"

Note, once you get to user space you will need a getty specified in
inittab in order to get a login on your serial port.   Something like:

   T0:23:respawn:/sbin/getty -L ttyS0

Stuart

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] Running KVM guest on X86
  2012-08-09 14:58     ` Stuart Yoder
@ 2012-08-09 17:39       ` Bhushan Bharat-R65777
  2012-08-09 17:54         ` Alex Williamson
  2012-08-10  7:24         ` Gleb Natapov
  0 siblings, 2 replies; 14+ messages in thread
From: Bhushan Bharat-R65777 @ 2012-08-09 17:39 UTC (permalink / raw)
  To: Stuart Yoder; +Cc: Alex Williamson, qemu-devel, Avi Kivity



> -----Original Message-----
> From: Stuart Yoder [mailto:b08248@gmail.com]
> Sent: Thursday, August 09, 2012 8:28 PM
> To: Bhushan Bharat-R65777
> Cc: Alex Williamson; qemu-devel@nongnu.org; Avi Kivity
> Subject: Re: [Qemu-devel] Running KVM guest on X86
> 
> On Tue, Aug 7, 2012 at 1:30 AM, Bhushan Bharat-R65777 <R65777@freescale.com>
> wrote:
> >
> >
> >> -----Original Message-----
> >> From: Alex Williamson [mailto:alex.williamson@redhat.com]
> >> Sent: Monday, August 06, 2012 9:27 PM
> >> To: Bhushan Bharat-R65777
> >> Cc: qemu-devel@nongnu.org; Avi Kivity
> >> Subject: Re: Running KVM guest on X86
> >>
> >> On Mon, 2012-08-06 at 15:40 +0000, Bhushan Bharat-R65777 wrote:
> >> > Hi Avi/All,
> >> >
> >> > I am facing issue to boot KVM guest on x86 (I used to work on
> >> > PowerPC platform
> >> and do not have enough knowledge of x86). I am working on making VFIO
> >> working on PowerPC Booke, So I have cloned Alex Williamsons git
> >> repository, compiled kernel for x86 on fedora with virtualization
> >> configuration (selected all kernel config options for same). Run
> >> below command to boot Guest (I have not provided vfio device yet):
> >> >
> >> > "qemu-system-x86_64 -enable-kvm -m 1024 -nographic -kernel
> >> arch/x86_64/boot/bzImage -initrd /boot/initramfs-3.5.0-rc4+.img
> >> -serial tcp::4444,server,telnet"
> >> >
> >> > After the I can see qemu command line (able to run various commands
> >> > like "info
> >> registers" etc), while guest does not boot (not even the first print comes).
> >> >
> >> > Can anyone help in what I am missing or doing wrong?
> >>
> >> x86 doesn't use the serial port for console by default, so you're
> >> making things quite a bit more difficult that way.  Typically you'll
> >> want to provide a disk image (the -hda option is the easiest way to
> >> do this), a display (-vga std -vnc :0 is again easiest), and probably
> >> something to install from (-cdrom <image.iso>).  You can also add a
> >> -boot d to get it to choose the cdrom the first time for install.
> >> Thanks,
> >
> > Thanks Avi and Alex, I can see the KVM guest boot prints by adding -append
> "console=ttyS0"
> 
> Note, once you get to user space you will need a getty specified in
> inittab in order to get a login on your serial port.   Something like:
> 
>    T0:23:respawn:/sbin/getty -L ttyS0

1)
I tried booting with prebuilt qcow2 then it works for me:
qemu-system-x86_64  -enable-kvm  -nographic  -device sga  -m 1024 -hda debian_squeeze_amd64_standard.qcow2

Does anyone help on how I can add my kernel to qcow2? Or create a proper qcow2?

2)
Also I tried as mentioned in section "3.9 Direct Linux Boot": http://qemu.weilnetz.de/qemu-doc.html#disk_005fimages : 

qemu-kvm  -enable-kvm  -nographic -kernel /boot/vmlinuz-3.5.0+ -hda /boot/initramfs-3.5.0+.img  -append "console=ttyS0 root=/dev/sda" -m 1024 

I get below error :
[    1.299225] No filesystem could mount root, tried:  ext3 ext2 ext4 iso9660
[    1.303232] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(8,0)
[    1.307683] Pid: 1, comm: swapper/0 Not tainted 3.3.5-2.fc16.x86_64 #1
[    1.311201] Call Trace:
[    1.312548]  [<ffffffff815eac62>] panic+0xba/0x1cd
[    1.315160]  [<ffffffff81cf1075>] mount_block_root+0x258/0x283
[    1.318275]  [<ffffffff81cf10f3>] mount_root+0x53/0x57
[    1.321047]  [<ffffffff81cf1234>] prepare_namespace+0x13d/0x176
[    1.324206]  [<ffffffff81cf0d59>] kernel_init+0x156/0x15b
[    1.327114]  [<ffffffff81089587>] ? schedule_tail+0x27/0xb0
[    1.330102]  [<ffffffff815fd6a4>] kernel_thread_helper+0x4/0x10
[    1.333413]  [<ffffffff81cf0c03>] ? start_kernel+0x3c5/0x3c5
[    1.336446]  [<ffffffff815fd6a0>] ? gs_change+0x13/0x13

Thanks
-Bharat

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] Running KVM guest on X86
  2012-08-09 17:39       ` Bhushan Bharat-R65777
@ 2012-08-09 17:54         ` Alex Williamson
  2012-08-09 18:06           ` Bhushan Bharat-R65777
  2012-08-10  7:24         ` Gleb Natapov
  1 sibling, 1 reply; 14+ messages in thread
From: Alex Williamson @ 2012-08-09 17:54 UTC (permalink / raw)
  To: Bhushan Bharat-R65777; +Cc: Avi Kivity, qemu-devel, Stuart Yoder

On Thu, 2012-08-09 at 17:39 +0000, Bhushan Bharat-R65777 wrote:
> 
> > -----Original Message-----
> > From: Stuart Yoder [mailto:b08248@gmail.com]
> > Sent: Thursday, August 09, 2012 8:28 PM
> > To: Bhushan Bharat-R65777
> > Cc: Alex Williamson; qemu-devel@nongnu.org; Avi Kivity
> > Subject: Re: [Qemu-devel] Running KVM guest on X86
> > 
> > On Tue, Aug 7, 2012 at 1:30 AM, Bhushan Bharat-R65777 <R65777@freescale.com>
> > wrote:
> > >
> > >
> > >> -----Original Message-----
> > >> From: Alex Williamson [mailto:alex.williamson@redhat.com]
> > >> Sent: Monday, August 06, 2012 9:27 PM
> > >> To: Bhushan Bharat-R65777
> > >> Cc: qemu-devel@nongnu.org; Avi Kivity
> > >> Subject: Re: Running KVM guest on X86
> > >>
> > >> On Mon, 2012-08-06 at 15:40 +0000, Bhushan Bharat-R65777 wrote:
> > >> > Hi Avi/All,
> > >> >
> > >> > I am facing issue to boot KVM guest on x86 (I used to work on
> > >> > PowerPC platform
> > >> and do not have enough knowledge of x86). I am working on making VFIO
> > >> working on PowerPC Booke, So I have cloned Alex Williamsons git
> > >> repository, compiled kernel for x86 on fedora with virtualization
> > >> configuration (selected all kernel config options for same). Run
> > >> below command to boot Guest (I have not provided vfio device yet):
> > >> >
> > >> > "qemu-system-x86_64 -enable-kvm -m 1024 -nographic -kernel
> > >> arch/x86_64/boot/bzImage -initrd /boot/initramfs-3.5.0-rc4+.img
> > >> -serial tcp::4444,server,telnet"
> > >> >
> > >> > After the I can see qemu command line (able to run various commands
> > >> > like "info
> > >> registers" etc), while guest does not boot (not even the first print comes).
> > >> >
> > >> > Can anyone help in what I am missing or doing wrong?
> > >>
> > >> x86 doesn't use the serial port for console by default, so you're
> > >> making things quite a bit more difficult that way.  Typically you'll
> > >> want to provide a disk image (the -hda option is the easiest way to
> > >> do this), a display (-vga std -vnc :0 is again easiest), and probably
> > >> something to install from (-cdrom <image.iso>).  You can also add a
> > >> -boot d to get it to choose the cdrom the first time for install.
> > >> Thanks,
> > >
> > > Thanks Avi and Alex, I can see the KVM guest boot prints by adding -append
> > "console=ttyS0"
> > 
> > Note, once you get to user space you will need a getty specified in
> > inittab in order to get a login on your serial port.   Something like:
> > 
> >    T0:23:respawn:/sbin/getty -L ttyS0
> 
> 1)
> I tried booting with prebuilt qcow2 then it works for me:
> qemu-system-x86_64  -enable-kvm  -nographic  -device sga  -m 1024 -hda debian_squeeze_amd64_standard.qcow2
> 
> Does anyone help on how I can add my kernel to qcow2? Or create a proper qcow2?
> 
> 2)
> Also I tried as mentioned in section "3.9 Direct Linux Boot": http://qemu.weilnetz.de/qemu-doc.html#disk_005fimages : 
> 
> qemu-kvm  -enable-kvm  -nographic -kernel /boot/vmlinuz-3.5.0+ -hda /boot/initramfs-3.5.0+.img  -append "console=ttyS0 root=/dev/sda" -m 1024 
> 
> I get below error :
> [    1.299225] No filesystem could mount root, tried:  ext3 ext2 ext4 iso9660
> [    1.303232] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(8,0)


Chances are your root is a partition on /dev/sda, not the disk itself
(ex. sda1, sda2)... Why exactly are you causing yourself so much pain by
doing these direct boot, no VGA options instead of starting with an ISO
image, installing it, then setting up a serial console if you want
serial access?  This may be the norm for powerpc VMs, but it's not how I
think most people setup x86 VMs.  Thanks,

Alex

> [    1.307683] Pid: 1, comm: swapper/0 Not tainted 3.3.5-2.fc16.x86_64 #1
> [    1.311201] Call Trace:
> [    1.312548]  [<ffffffff815eac62>] panic+0xba/0x1cd
> [    1.315160]  [<ffffffff81cf1075>] mount_block_root+0x258/0x283
> [    1.318275]  [<ffffffff81cf10f3>] mount_root+0x53/0x57
> [    1.321047]  [<ffffffff81cf1234>] prepare_namespace+0x13d/0x176
> [    1.324206]  [<ffffffff81cf0d59>] kernel_init+0x156/0x15b
> [    1.327114]  [<ffffffff81089587>] ? schedule_tail+0x27/0xb0
> [    1.330102]  [<ffffffff815fd6a4>] kernel_thread_helper+0x4/0x10
> [    1.333413]  [<ffffffff81cf0c03>] ? start_kernel+0x3c5/0x3c5
> [    1.336446]  [<ffffffff815fd6a0>] ? gs_change+0x13/0x13
> 
> Thanks
> -Bharat
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] Running KVM guest on X86
  2012-08-09 17:54         ` Alex Williamson
@ 2012-08-09 18:06           ` Bhushan Bharat-R65777
  2012-08-09 19:08             ` Alex Williamson
  2012-08-12  9:11             ` Avi Kivity
  0 siblings, 2 replies; 14+ messages in thread
From: Bhushan Bharat-R65777 @ 2012-08-09 18:06 UTC (permalink / raw)
  To: Alex Williamson; +Cc: Avi Kivity, qemu-devel, Stuart Yoder



> -----Original Message-----
> From: Alex Williamson [mailto:alex.williamson@redhat.com]
> Sent: Thursday, August 09, 2012 11:25 PM
> To: Bhushan Bharat-R65777
> Cc: Stuart Yoder; qemu-devel@nongnu.org; Avi Kivity
> Subject: Re: [Qemu-devel] Running KVM guest on X86
> 
> On Thu, 2012-08-09 at 17:39 +0000, Bhushan Bharat-R65777 wrote:
> >
> > > -----Original Message-----
> > > From: Stuart Yoder [mailto:b08248@gmail.com]
> > > Sent: Thursday, August 09, 2012 8:28 PM
> > > To: Bhushan Bharat-R65777
> > > Cc: Alex Williamson; qemu-devel@nongnu.org; Avi Kivity
> > > Subject: Re: [Qemu-devel] Running KVM guest on X86
> > >
> > > On Tue, Aug 7, 2012 at 1:30 AM, Bhushan Bharat-R65777
> > > <R65777@freescale.com>
> > > wrote:
> > > >
> > > >
> > > >> -----Original Message-----
> > > >> From: Alex Williamson [mailto:alex.williamson@redhat.com]
> > > >> Sent: Monday, August 06, 2012 9:27 PM
> > > >> To: Bhushan Bharat-R65777
> > > >> Cc: qemu-devel@nongnu.org; Avi Kivity
> > > >> Subject: Re: Running KVM guest on X86
> > > >>
> > > >> On Mon, 2012-08-06 at 15:40 +0000, Bhushan Bharat-R65777 wrote:
> > > >> > Hi Avi/All,
> > > >> >
> > > >> > I am facing issue to boot KVM guest on x86 (I used to work on
> > > >> > PowerPC platform
> > > >> and do not have enough knowledge of x86). I am working on making
> > > >> VFIO working on PowerPC Booke, So I have cloned Alex Williamsons
> > > >> git repository, compiled kernel for x86 on fedora with
> > > >> virtualization configuration (selected all kernel config options
> > > >> for same). Run below command to boot Guest (I have not provided vfio
> device yet):
> > > >> >
> > > >> > "qemu-system-x86_64 -enable-kvm -m 1024 -nographic -kernel
> > > >> arch/x86_64/boot/bzImage -initrd /boot/initramfs-3.5.0-rc4+.img
> > > >> -serial tcp::4444,server,telnet"
> > > >> >
> > > >> > After the I can see qemu command line (able to run various
> > > >> > commands like "info
> > > >> registers" etc), while guest does not boot (not even the first print
> comes).
> > > >> >
> > > >> > Can anyone help in what I am missing or doing wrong?
> > > >>
> > > >> x86 doesn't use the serial port for console by default, so you're
> > > >> making things quite a bit more difficult that way.  Typically
> > > >> you'll want to provide a disk image (the -hda option is the
> > > >> easiest way to do this), a display (-vga std -vnc :0 is again
> > > >> easiest), and probably something to install from (-cdrom
> > > >> <image.iso>).  You can also add a -boot d to get it to choose the cdrom
> the first time for install.
> > > >> Thanks,
> > > >
> > > > Thanks Avi and Alex, I can see the KVM guest boot prints by adding
> > > > -append
> > > "console=ttyS0"
> > >
> > > Note, once you get to user space you will need a getty specified in
> > > inittab in order to get a login on your serial port.   Something like:
> > >
> > >    T0:23:respawn:/sbin/getty -L ttyS0
> >
> > 1)
> > I tried booting with prebuilt qcow2 then it works for me:
> > qemu-system-x86_64  -enable-kvm  -nographic  -device sga  -m 1024 -hda
> > debian_squeeze_amd64_standard.qcow2
> >
> > Does anyone help on how I can add my kernel to qcow2? Or create a proper
> qcow2?
> >
> > 2)
> > Also I tried as mentioned in section "3.9 Direct Linux Boot":
> http://qemu.weilnetz.de/qemu-doc.html#disk_005fimages :
> >
> > qemu-kvm  -enable-kvm  -nographic -kernel /boot/vmlinuz-3.5.0+ -hda
> > /boot/initramfs-3.5.0+.img  -append "console=ttyS0 root=/dev/sda" -m
> > 1024
> >
> > I get below error :
> > [    1.299225] No filesystem could mount root, tried:  ext3 ext2 ext4 iso9660
> > [    1.303232] Kernel panic - not syncing: VFS: Unable to mount root fs on
> unknown-block(8,0)
> 
> 
> Chances are your root is a partition on /dev/sda, not the disk itself (ex. sda1,
> sda2)... Why exactly are you causing yourself so much pain by doing these direct
> boot, no VGA options instead of starting with an ISO image, installing it, then
> setting up a serial console if you want serial access?  This may be the norm for
> powerpc VMs, but it's not how I think most people setup x86 VMs.  Thanks,

I have a fedora machine to which I do not have direct access (but I can reboot remotely, have a console). So far what I was trying direct booting VM using same initramfs and bzimage as of host,

Alex, How I can create a ISO image with my kernel? Where I should place that on host?

Thanks
-Bharat

> 
> Alex
> 
> > [    1.307683] Pid: 1, comm: swapper/0 Not tainted 3.3.5-2.fc16.x86_64 #1
> > [    1.311201] Call Trace:
> > [    1.312548]  [<ffffffff815eac62>] panic+0xba/0x1cd
> > [    1.315160]  [<ffffffff81cf1075>] mount_block_root+0x258/0x283
> > [    1.318275]  [<ffffffff81cf10f3>] mount_root+0x53/0x57
> > [    1.321047]  [<ffffffff81cf1234>] prepare_namespace+0x13d/0x176
> > [    1.324206]  [<ffffffff81cf0d59>] kernel_init+0x156/0x15b
> > [    1.327114]  [<ffffffff81089587>] ? schedule_tail+0x27/0xb0
> > [    1.330102]  [<ffffffff815fd6a4>] kernel_thread_helper+0x4/0x10
> > [    1.333413]  [<ffffffff81cf0c03>] ? start_kernel+0x3c5/0x3c5
> > [    1.336446]  [<ffffffff815fd6a0>] ? gs_change+0x13/0x13
> >
> > Thanks
> > -Bharat
> >
> 
> 
> 


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] Running KVM guest on X86
  2012-08-09 18:06           ` Bhushan Bharat-R65777
@ 2012-08-09 19:08             ` Alex Williamson
  2012-08-12  9:11             ` Avi Kivity
  1 sibling, 0 replies; 14+ messages in thread
From: Alex Williamson @ 2012-08-09 19:08 UTC (permalink / raw)
  To: Bhushan Bharat-R65777; +Cc: Avi Kivity, qemu-devel, Stuart Yoder

On Thu, 2012-08-09 at 18:06 +0000, Bhushan Bharat-R65777 wrote:
> 
> > -----Original Message-----
> > From: Alex Williamson [mailto:alex.williamson@redhat.com]
> > Sent: Thursday, August 09, 2012 11:25 PM
> > To: Bhushan Bharat-R65777
> > Cc: Stuart Yoder; qemu-devel@nongnu.org; Avi Kivity
> > Subject: Re: [Qemu-devel] Running KVM guest on X86
> > 
> > On Thu, 2012-08-09 at 17:39 +0000, Bhushan Bharat-R65777 wrote:
> > >
> > > > -----Original Message-----
> > > > From: Stuart Yoder [mailto:b08248@gmail.com]
> > > > Sent: Thursday, August 09, 2012 8:28 PM
> > > > To: Bhushan Bharat-R65777
> > > > Cc: Alex Williamson; qemu-devel@nongnu.org; Avi Kivity
> > > > Subject: Re: [Qemu-devel] Running KVM guest on X86
> > > >
> > > > On Tue, Aug 7, 2012 at 1:30 AM, Bhushan Bharat-R65777
> > > > <R65777@freescale.com>
> > > > wrote:
> > > > >
> > > > >
> > > > >> -----Original Message-----
> > > > >> From: Alex Williamson [mailto:alex.williamson@redhat.com]
> > > > >> Sent: Monday, August 06, 2012 9:27 PM
> > > > >> To: Bhushan Bharat-R65777
> > > > >> Cc: qemu-devel@nongnu.org; Avi Kivity
> > > > >> Subject: Re: Running KVM guest on X86
> > > > >>
> > > > >> On Mon, 2012-08-06 at 15:40 +0000, Bhushan Bharat-R65777 wrote:
> > > > >> > Hi Avi/All,
> > > > >> >
> > > > >> > I am facing issue to boot KVM guest on x86 (I used to work on
> > > > >> > PowerPC platform
> > > > >> and do not have enough knowledge of x86). I am working on making
> > > > >> VFIO working on PowerPC Booke, So I have cloned Alex Williamsons
> > > > >> git repository, compiled kernel for x86 on fedora with
> > > > >> virtualization configuration (selected all kernel config options
> > > > >> for same). Run below command to boot Guest (I have not provided vfio
> > device yet):
> > > > >> >
> > > > >> > "qemu-system-x86_64 -enable-kvm -m 1024 -nographic -kernel
> > > > >> arch/x86_64/boot/bzImage -initrd /boot/initramfs-3.5.0-rc4+.img
> > > > >> -serial tcp::4444,server,telnet"
> > > > >> >
> > > > >> > After the I can see qemu command line (able to run various
> > > > >> > commands like "info
> > > > >> registers" etc), while guest does not boot (not even the first print
> > comes).
> > > > >> >
> > > > >> > Can anyone help in what I am missing or doing wrong?
> > > > >>
> > > > >> x86 doesn't use the serial port for console by default, so you're
> > > > >> making things quite a bit more difficult that way.  Typically
> > > > >> you'll want to provide a disk image (the -hda option is the
> > > > >> easiest way to do this), a display (-vga std -vnc :0 is again
> > > > >> easiest), and probably something to install from (-cdrom
> > > > >> <image.iso>).  You can also add a -boot d to get it to choose the cdrom
> > the first time for install.
> > > > >> Thanks,
> > > > >
> > > > > Thanks Avi and Alex, I can see the KVM guest boot prints by adding
> > > > > -append
> > > > "console=ttyS0"
> > > >
> > > > Note, once you get to user space you will need a getty specified in
> > > > inittab in order to get a login on your serial port.   Something like:
> > > >
> > > >    T0:23:respawn:/sbin/getty -L ttyS0
> > >
> > > 1)
> > > I tried booting with prebuilt qcow2 then it works for me:
> > > qemu-system-x86_64  -enable-kvm  -nographic  -device sga  -m 1024 -hda
> > > debian_squeeze_amd64_standard.qcow2
> > >
> > > Does anyone help on how I can add my kernel to qcow2? Or create a proper
> > qcow2?
> > >
> > > 2)
> > > Also I tried as mentioned in section "3.9 Direct Linux Boot":
> > http://qemu.weilnetz.de/qemu-doc.html#disk_005fimages :
> > >
> > > qemu-kvm  -enable-kvm  -nographic -kernel /boot/vmlinuz-3.5.0+ -hda
> > > /boot/initramfs-3.5.0+.img  -append "console=ttyS0 root=/dev/sda" -m
> > > 1024
> > >
> > > I get below error :
> > > [    1.299225] No filesystem could mount root, tried:  ext3 ext2 ext4 iso9660
> > > [    1.303232] Kernel panic - not syncing: VFS: Unable to mount root fs on
> > unknown-block(8,0)
> > 
> > 
> > Chances are your root is a partition on /dev/sda, not the disk itself (ex. sda1,
> > sda2)... Why exactly are you causing yourself so much pain by doing these direct
> > boot, no VGA options instead of starting with an ISO image, installing it, then
> > setting up a serial console if you want serial access?  This may be the norm for
> > powerpc VMs, but it's not how I think most people setup x86 VMs.  Thanks,
> 
> I have a fedora machine to which I do not have direct access (but I can reboot remotely, have a console). So far what I was trying direct booting VM using same initramfs and bzimage as of host,
> 
> Alex, How I can create a ISO image with my kernel? Where I should place that on host?

No, what I'm suggesting is to get an ISO image of the distribution you
want to run on the guest and use the -cdrom <iso image> -boot d options
to boot the VM from the ISO and install onto your disk image.  If you
want to make the process even easier, use something like virt-manager to
install the guest, then use the disk image directly with qemu if you
want.  Thanks,

Alex

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] Running KVM guest on X86
  2012-08-09 17:39       ` Bhushan Bharat-R65777
  2012-08-09 17:54         ` Alex Williamson
@ 2012-08-10  7:24         ` Gleb Natapov
  2012-08-10  8:19           ` Bhushan Bharat-R65777
  1 sibling, 1 reply; 14+ messages in thread
From: Gleb Natapov @ 2012-08-10  7:24 UTC (permalink / raw)
  To: Bhushan Bharat-R65777
  Cc: Avi Kivity, Alex Williamson, qemu-devel, Stuart Yoder

On Thu, Aug 09, 2012 at 05:39:36PM +0000, Bhushan Bharat-R65777 wrote:
> 
> 
> > -----Original Message-----
> > From: Stuart Yoder [mailto:b08248@gmail.com]
> > Sent: Thursday, August 09, 2012 8:28 PM
> > To: Bhushan Bharat-R65777
> > Cc: Alex Williamson; qemu-devel@nongnu.org; Avi Kivity
> > Subject: Re: [Qemu-devel] Running KVM guest on X86
> > 
> > On Tue, Aug 7, 2012 at 1:30 AM, Bhushan Bharat-R65777 <R65777@freescale.com>
> > wrote:
> > >
> > >
> > >> -----Original Message-----
> > >> From: Alex Williamson [mailto:alex.williamson@redhat.com]
> > >> Sent: Monday, August 06, 2012 9:27 PM
> > >> To: Bhushan Bharat-R65777
> > >> Cc: qemu-devel@nongnu.org; Avi Kivity
> > >> Subject: Re: Running KVM guest on X86
> > >>
> > >> On Mon, 2012-08-06 at 15:40 +0000, Bhushan Bharat-R65777 wrote:
> > >> > Hi Avi/All,
> > >> >
> > >> > I am facing issue to boot KVM guest on x86 (I used to work on
> > >> > PowerPC platform
> > >> and do not have enough knowledge of x86). I am working on making VFIO
> > >> working on PowerPC Booke, So I have cloned Alex Williamsons git
> > >> repository, compiled kernel for x86 on fedora with virtualization
> > >> configuration (selected all kernel config options for same). Run
> > >> below command to boot Guest (I have not provided vfio device yet):
> > >> >
> > >> > "qemu-system-x86_64 -enable-kvm -m 1024 -nographic -kernel
> > >> arch/x86_64/boot/bzImage -initrd /boot/initramfs-3.5.0-rc4+.img
> > >> -serial tcp::4444,server,telnet"
> > >> >
> > >> > After the I can see qemu command line (able to run various commands
> > >> > like "info
> > >> registers" etc), while guest does not boot (not even the first print comes).
> > >> >
> > >> > Can anyone help in what I am missing or doing wrong?
> > >>
> > >> x86 doesn't use the serial port for console by default, so you're
> > >> making things quite a bit more difficult that way.  Typically you'll
> > >> want to provide a disk image (the -hda option is the easiest way to
> > >> do this), a display (-vga std -vnc :0 is again easiest), and probably
> > >> something to install from (-cdrom <image.iso>).  You can also add a
> > >> -boot d to get it to choose the cdrom the first time for install.
> > >> Thanks,
> > >
> > > Thanks Avi and Alex, I can see the KVM guest boot prints by adding -append
> > "console=ttyS0"
> > 
> > Note, once you get to user space you will need a getty specified in
> > inittab in order to get a login on your serial port.   Something like:
> > 
> >    T0:23:respawn:/sbin/getty -L ttyS0
> 
> 1)
> I tried booting with prebuilt qcow2 then it works for me:
> qemu-system-x86_64  -enable-kvm  -nographic  -device sga  -m 1024 -hda debian_squeeze_amd64_standard.qcow2
> 
> Does anyone help on how I can add my kernel to qcow2? Or create a proper qcow2?
> 
> 2)
> Also I tried as mentioned in section "3.9 Direct Linux Boot": http://qemu.weilnetz.de/qemu-doc.html#disk_005fimages : 
> 
> qemu-kvm  -enable-kvm  -nographic -kernel /boot/vmlinuz-3.5.0+ -hda /boot/initramfs-3.5.0+.img  -append "console=ttyS0 root=/dev/sda" -m 1024 
> 
-hda  /boot/initramfs-3.5.0+.img is incorrect. Should be -hda
debian_squeeze_amd64_standard.qcow2 -initrd /boot/initramfs-3.5.0+.img
and root=/dev/sda1 probably.

> I get below error :
> [    1.299225] No filesystem could mount root, tried:  ext3 ext2 ext4 iso9660
> [    1.303232] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(8,0)
> [    1.307683] Pid: 1, comm: swapper/0 Not tainted 3.3.5-2.fc16.x86_64 #1
> [    1.311201] Call Trace:
> [    1.312548]  [<ffffffff815eac62>] panic+0xba/0x1cd
> [    1.315160]  [<ffffffff81cf1075>] mount_block_root+0x258/0x283
> [    1.318275]  [<ffffffff81cf10f3>] mount_root+0x53/0x57
> [    1.321047]  [<ffffffff81cf1234>] prepare_namespace+0x13d/0x176
> [    1.324206]  [<ffffffff81cf0d59>] kernel_init+0x156/0x15b
> [    1.327114]  [<ffffffff81089587>] ? schedule_tail+0x27/0xb0
> [    1.330102]  [<ffffffff815fd6a4>] kernel_thread_helper+0x4/0x10
> [    1.333413]  [<ffffffff81cf0c03>] ? start_kernel+0x3c5/0x3c5
> [    1.336446]  [<ffffffff815fd6a0>] ? gs_change+0x13/0x13
> 
> Thanks
> -Bharat
> 

--
			Gleb.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] Running KVM guest on X86
  2012-08-10  7:24         ` Gleb Natapov
@ 2012-08-10  8:19           ` Bhushan Bharat-R65777
  2012-08-10 10:53             ` Gleb Natapov
  0 siblings, 1 reply; 14+ messages in thread
From: Bhushan Bharat-R65777 @ 2012-08-10  8:19 UTC (permalink / raw)
  To: Gleb Natapov; +Cc: Avi Kivity, Alex Williamson, qemu-devel, Stuart Yoder

> > > >> On Mon, 2012-08-06 at 15:40 +0000, Bhushan Bharat-R65777 wrote:
> > > >> > Hi Avi/All,
> > > >> >
> > > >> > I am facing issue to boot KVM guest on x86 (I used to work on
> > > >> > PowerPC platform
> > > >> and do not have enough knowledge of x86). I am working on making
> > > >> VFIO working on PowerPC Booke, So I have cloned Alex Williamsons
> > > >> git repository, compiled kernel for x86 on fedora with
> > > >> virtualization configuration (selected all kernel config options
> > > >> for same). Run below command to boot Guest (I have not provided vfio
> device yet):
> > > >> >
> > > >> > "qemu-system-x86_64 -enable-kvm -m 1024 -nographic -kernel
> > > >> arch/x86_64/boot/bzImage -initrd /boot/initramfs-3.5.0-rc4+.img
> > > >> -serial tcp::4444,server,telnet"
> > > >> >
> > > >> > After the I can see qemu command line (able to run various
> > > >> > commands like "info
> > > >> registers" etc), while guest does not boot (not even the first print
> comes).
> > > >> >
> > > >> > Can anyone help in what I am missing or doing wrong?
> > > >>
> > > >> x86 doesn't use the serial port for console by default, so you're
> > > >> making things quite a bit more difficult that way.  Typically
> > > >> you'll want to provide a disk image (the -hda option is the
> > > >> easiest way to do this), a display (-vga std -vnc :0 is again
> > > >> easiest), and probably something to install from (-cdrom
> > > >> <image.iso>).  You can also add a -boot d to get it to choose the cdrom
> the first time for install.
> > > >> Thanks,
> > > >
> > > > Thanks Avi and Alex, I can see the KVM guest boot prints by adding
> > > > -append
> > > "console=ttyS0"
> > >
> > > Note, once you get to user space you will need a getty specified in
> > > inittab in order to get a login on your serial port.   Something like:
> > >
> > >    T0:23:respawn:/sbin/getty -L ttyS0
> >
> > 1)
> > I tried booting with prebuilt qcow2 then it works for me:
> > qemu-system-x86_64  -enable-kvm  -nographic  -device sga  -m 1024 -hda
> > debian_squeeze_amd64_standard.qcow2
> >
> > Does anyone help on how I can add my kernel to qcow2? Or create a proper
> qcow2?
> >
> > 2)
> > Also I tried as mentioned in section "3.9 Direct Linux Boot":
> http://qemu.weilnetz.de/qemu-doc.html#disk_005fimages :
> >
> > qemu-kvm  -enable-kvm  -nographic -kernel /boot/vmlinuz-3.5.0+ -hda
> > /boot/initramfs-3.5.0+.img  -append "console=ttyS0 root=/dev/sda" -m
> > 1024
> >
> -hda  /boot/initramfs-3.5.0+.img is incorrect. Should be -hda
> debian_squeeze_amd64_standard.qcow2 -initrd /boot/initramfs-3.5.0+.img and
> root=/dev/sda1 probably.

I tried :
qemu-system-x86_64  -enable-kvm  -nographic  -kernel /boot/vmlinuz-3.5.0+  -initrd /boot/initramfs-3.5.0+.img  -append "root=/dev/sda1 rw console=ttyS0" -m 1024 -hda debian_squeeze_amd64_standard.qcow2

With this I get the login prompt, but it is not taking input character from keyboard properly (not able to give login credentials even). Seeing some weird behavior, like sometimes it treat normal character as like ENTER pressed.

Below are some boot prints and it is found that there were some junk characters after "Setting console screen modes".

--------------
Setting console screen modes.
]Rcannot (un)set powersave mode
[9;30][14;30]Skipping font and keymap setup (handled by console-setup).
Setting up console font and keymap...done.
[   11.547904] rc (278) used greatest stack depth: 1760 bytes left
Starting portmap daemon...Already running..
Starting NFS common utilities: statd.
Starting enhanced syslogd: rsyslogd.
Starting deferred execution scheduler: atd.
Starting ACPI services....
Starting periodic command scheduler: cron.
Starting MTA: exim4.

Debian GNU/Linux 6.0 debian-amd64 ttyS0

debian-amd64 login:
------------

Thanks 
-Bharat

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] Running KVM guest on X86
  2012-08-10  8:19           ` Bhushan Bharat-R65777
@ 2012-08-10 10:53             ` Gleb Natapov
  0 siblings, 0 replies; 14+ messages in thread
From: Gleb Natapov @ 2012-08-10 10:53 UTC (permalink / raw)
  To: Bhushan Bharat-R65777
  Cc: Avi Kivity, Alex Williamson, qemu-devel, Stuart Yoder

On Fri, Aug 10, 2012 at 08:19:49AM +0000, Bhushan Bharat-R65777 wrote:
> > > > >> On Mon, 2012-08-06 at 15:40 +0000, Bhushan Bharat-R65777 wrote:
> > > > >> > Hi Avi/All,
> > > > >> >
> > > > >> > I am facing issue to boot KVM guest on x86 (I used to work on
> > > > >> > PowerPC platform
> > > > >> and do not have enough knowledge of x86). I am working on making
> > > > >> VFIO working on PowerPC Booke, So I have cloned Alex Williamsons
> > > > >> git repository, compiled kernel for x86 on fedora with
> > > > >> virtualization configuration (selected all kernel config options
> > > > >> for same). Run below command to boot Guest (I have not provided vfio
> > device yet):
> > > > >> >
> > > > >> > "qemu-system-x86_64 -enable-kvm -m 1024 -nographic -kernel
> > > > >> arch/x86_64/boot/bzImage -initrd /boot/initramfs-3.5.0-rc4+.img
> > > > >> -serial tcp::4444,server,telnet"
> > > > >> >
> > > > >> > After the I can see qemu command line (able to run various
> > > > >> > commands like "info
> > > > >> registers" etc), while guest does not boot (not even the first print
> > comes).
> > > > >> >
> > > > >> > Can anyone help in what I am missing or doing wrong?
> > > > >>
> > > > >> x86 doesn't use the serial port for console by default, so you're
> > > > >> making things quite a bit more difficult that way.  Typically
> > > > >> you'll want to provide a disk image (the -hda option is the
> > > > >> easiest way to do this), a display (-vga std -vnc :0 is again
> > > > >> easiest), and probably something to install from (-cdrom
> > > > >> <image.iso>).  You can also add a -boot d to get it to choose the cdrom
> > the first time for install.
> > > > >> Thanks,
> > > > >
> > > > > Thanks Avi and Alex, I can see the KVM guest boot prints by adding
> > > > > -append
> > > > "console=ttyS0"
> > > >
> > > > Note, once you get to user space you will need a getty specified in
> > > > inittab in order to get a login on your serial port.   Something like:
> > > >
> > > >    T0:23:respawn:/sbin/getty -L ttyS0
> > >
> > > 1)
> > > I tried booting with prebuilt qcow2 then it works for me:
> > > qemu-system-x86_64  -enable-kvm  -nographic  -device sga  -m 1024 -hda
> > > debian_squeeze_amd64_standard.qcow2
> > >
> > > Does anyone help on how I can add my kernel to qcow2? Or create a proper
> > qcow2?
> > >
> > > 2)
> > > Also I tried as mentioned in section "3.9 Direct Linux Boot":
> > http://qemu.weilnetz.de/qemu-doc.html#disk_005fimages :
> > >
> > > qemu-kvm  -enable-kvm  -nographic -kernel /boot/vmlinuz-3.5.0+ -hda
> > > /boot/initramfs-3.5.0+.img  -append "console=ttyS0 root=/dev/sda" -m
> > > 1024
> > >
> > -hda  /boot/initramfs-3.5.0+.img is incorrect. Should be -hda
> > debian_squeeze_amd64_standard.qcow2 -initrd /boot/initramfs-3.5.0+.img and
> > root=/dev/sda1 probably.
> 
> I tried :
> qemu-system-x86_64  -enable-kvm  -nographic  -kernel /boot/vmlinuz-3.5.0+  -initrd /boot/initramfs-3.5.0+.img  -append "root=/dev/sda1 rw console=ttyS0" -m 1024 -hda debian_squeeze_amd64_standard.qcow2
> 
> With this I get the login prompt, but it is not taking input character from keyboard properly (not able to give login credentials even). Seeing some weird behavior, like sometimes it treat normal character as like ENTER pressed.
> 
See other email in this thread about getty config. It would be simple
for you to not use -nographic.

--
			Gleb.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] Running KVM guest on X86
  2012-08-09 18:06           ` Bhushan Bharat-R65777
  2012-08-09 19:08             ` Alex Williamson
@ 2012-08-12  9:11             ` Avi Kivity
  1 sibling, 0 replies; 14+ messages in thread
From: Avi Kivity @ 2012-08-12  9:11 UTC (permalink / raw)
  To: Bhushan Bharat-R65777; +Cc: Alex Williamson, qemu-devel, Stuart Yoder

On 08/09/2012 09:06 PM, Bhushan Bharat-R65777 wrote:

> I have a fedora machine to which I do not have direct access (but I can reboot remotely, have a console). So far what I was trying direct booting VM using same initramfs and bzimage as of host,
> 
> Alex, How I can create a ISO image with my kernel? Where I should place that on host?


Try this:

$ qemu-img create -f qcow2 fedora.img 20G
$ qemu-kvm -m 1G -monitor stdio -drive
file=fedora.img,cache=none,if=virtio -cdrom
http://dl.fedoraproject.org/pub/alt/bfo/bfo.iso -vnc :1

Then connect to vnc port 5901 on your host.  To update the kernel,
simply build and install it in the guest as you would on any other machine.

-- 
error compiling committee.c: too many arguments to function

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2012-08-12  9:11 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-06 15:40 [Qemu-devel] Running KVM guest on X86 Bhushan Bharat-R65777
2012-08-06 15:56 ` Avi Kivity
2012-08-06 15:56 ` Alex Williamson
2012-08-07  6:30   ` Bhushan Bharat-R65777
2012-08-07  7:31     ` Gleb Natapov
2012-08-09 14:58     ` Stuart Yoder
2012-08-09 17:39       ` Bhushan Bharat-R65777
2012-08-09 17:54         ` Alex Williamson
2012-08-09 18:06           ` Bhushan Bharat-R65777
2012-08-09 19:08             ` Alex Williamson
2012-08-12  9:11             ` Avi Kivity
2012-08-10  7:24         ` Gleb Natapov
2012-08-10  8:19           ` Bhushan Bharat-R65777
2012-08-10 10:53             ` Gleb Natapov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.