Virtio not working in Hardy 64bit

Bug #316861 reported by geppz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kvm (Ubuntu)
Fix Released
Medium
Dustin Kirkland 
Hardy
Fix Released
Medium
Dustin Kirkland 
Intrepid
Fix Released
Medium
Dustin Kirkland 

Bug Description

Binary package hint: kvm

Hi there
I am having problems with KVM in Ubuntu Hardy 8.04 64-bit (both host and guest) with virtio.
Virtio currently does not work either as disk or as net.

Hardware is HP xw6600 10GB ram, 2 x E5420
Kernel image is 2.6.24-23-server both on host and on guest (also tried -19-generic) kvm is kvm-62 1:62+dfsg-0ubuntu8
I made a bridge br0 for eth0 and tap0
I made a 170GB file as hard disk image (raw)
I installed Ubuntu with kvm non-virtio (network was 1000e) because it seemed not recognizing virtio devices at install time.

Everything was working without virtio. In the next boots I tried to introduce virtio but it would not work.
Here is the command line:

kvm -m 9000 -boot c -drive file=login_server,index=0,media=disk -net nic,macaddr=52:54:00:94:91:31,model=e1000 -net tap,ifname=tap0 -smp 8

This one works.

If I put model=virtio for network, it stops working. Nothing passes, not even ping, arping, ssh, nothing. Tried even with user mode instead of tap. Virtio modules are loaded correctly in the guest. Tried unloading and reloading virtio modules, no good. Tried removing -smp option, no good.

If I make two nics, one with e1000 and one with virtio with different MACs, NONE of the two works. Now if I unload the virtio modules, the virtio ethX interface correctly disappears, but the other one STILL does not work.

No errors are shown in the dmesg.

If I use only one e1000, that works.

For the disk: virtio prevents boot. No /dev/vda appears nor /dev/disk/by-uuid. The directory /sys/block/dev/vda exists though, but I'm not sure how to use it and I don't seem to be able to mount to /root any of the entries. The root filesystem cannot be found because the by-uuid directory does not exist. I am positive that the virtio_blk, virtio_pci and virtio modules are loaded when I am dropped to the shell. I also tried rootdelay=10, no good.
Only one message regarding the disk appears in the boot messages, probably meaningless:
vda:<4>Driver 'sr' needs updating - please use bus_type methods

Any idea?

Thank you

PS: I am not sure if the correct package for the bug is kvm or linux...

Revision history for this message
geppz (no-carrier) wrote :

I have finally narrowed this problem.
The key thing is the memory given to the virtual guest.
The problem seems to be in Ubuntu's kvm.
Please follow these instructions to reproduce: (might not be the shortest instructions to achieve the bug, sorry for that)

Hardware with intel CPU and at least 4GB physical memory
Host with ubuntu 8.04 64bit and Ubuntu's native KVM
Make guest HD image like this:
 dd if=/dev/zero of=vmhd.raw count=0 seek=200000000
Download ubuntu-8.04.2-desktop-amd64.iso from ubuntu website on the host
Configure bridge and tap0 interface, enslave tap0 to the bridge
First boot is like this:
 kvm -m 2000 -boot d -drive file=vmhd.raw,index=0,media=disk -cdrom ubuntu-8.04.2-desktop-amd64.iso -net nic,macaddr=52:54:00:94:91:31 -net tap,ifname=tap0,script=no
This will boot the VM with the ubuntu live CD
 open bash
  sudo su
  gparted
   make two ext3 partitions: 1) one for /boot filesystem, 1000MB aligned to cylinders, 2) another ext3 partition filling the rest of the disk for the / filesystem
   format and exit
 doubleclick on the installer, follow the steps, manual partitioning, assign /boot and / filesystems to the partitions. Assign machine name, login, password etc. Install everything then shutdown the VM.

Now your test VM is installed. The next steps are:
Boot the VM with this line: (I suggest to boot the recovery mode ubuntu kernel or anyway remove the "quiet splash" so to see the messages)
 kvm -m 2000 -boot d -drive file=vmhd.raw,index=0,media=disk,if=virtio,boot=on -net nic,macaddr=52:54:00:94:91:31,model=virtio -net tap,ifname=tap0,script=no
Everything works, right?
Now reboot changing the memory amount (-m option), the results should be like this:
 -m <= 3590: everything works
 -m 3592<-->3690: kvm crashes at boot, error message: "kvm: Guest sent invalid pointer"
 -m >=3691: hangs at boot because it cant find disks vda1 and vda2.
If you remove virtio from the disk commandline and leave it only on the network, it will boot if memory is higher than approx 4000 (I didn't investigate for the exact number, anyway it is higher than 3691) but once booted networking will not work, no ping, nothing.

kvm-83 compiled from source does not appear to have these problems.

Changed in kvm:
importance: Undecided → Medium
Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Hi, thanks for the bug report.

A couple of questions for you... You tried with kvm-83 compiled from source... What about on kvm-84 as included in Jaunty? We believe that this issue has been fixed by upstream.

Also, do you experience this problem if you give only a single CPU to the guest? SMP in kvm-62 is dreadfully inadequate.

:-Dustin

Changed in kvm:
status: New → Incomplete
Revision history for this message
geppz (no-carrier) wrote :

Hi there,
even removing -smp option wouldn't fix the problem in kvm/hardy, as I mentioned in my first post.

I have not tried KVM from jaunty, I don't have a jaunty machine. I have tried kvm-84 compiled from source and it does not exhibit the problem, same as kvm-83 from source.

Thanks

Revision history for this message
Dustin Kirkland  (kirkland) wrote : Re: [Bug 316861] Re: Virtio not working in Hardy 64bit

Okay, that's great information!

Here's one more thing to try. I have a kvm-84 compiled for Hardy
available in this PPA:
 * https://launchpad.net/~ubuntu-virt/+archive/ppa

Could you, perhaps, test that kvm-84 to see if your problem manifests there?

:-Dustin

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Marking 'Fix Released', since Jaunty's kvm does not exhibit this issue. I'm going to propose it for release against Hardy and Jaunty, to be solved by the kvm-84 backport.

:-Dustin

Changed in kvm (Ubuntu):
assignee: nobody → Dustin Kirkland (kirkland)
status: Incomplete → Fix Released
Changed in kvm (Ubuntu Hardy):
assignee: nobody → Dustin Kirkland (kirkland)
importance: Undecided → Medium
milestone: none → ubuntu-8.04.3
status: New → In Progress
Changed in kvm (Ubuntu Intrepid):
assignee: nobody → Dustin Kirkland (kirkland)
importance: Undecided → Medium
milestone: none → intrepid-updates
status: New → In Progress
Revision history for this message
Steve Langasek (vorlon) wrote :

If this is being handled via hardy-backports, this hardy task should be closed.

Changed in kvm (Ubuntu Hardy):
milestone: ubuntu-8.04.3 → none
status: In Progress → Won't Fix
Revision history for this message
Dustin Kirkland  (kirkland) wrote :

On Thu, Jul 16, 2009 at 5:28 AM, Steve
Langasek<email address hidden> wrote:
> If this is being handled via hardy-backports, this hardy task should be
> closed.

Correct. Anyone experiencing this issue should try the packages
available for testing in the ~ubuntu-virt PPA, and eventually in
hardy-backports.

:-Dustin

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

This bug was fixed in kvm-84 as published to hardy-backports and intrepid-backports. If you're suffering from this bug, please try that package.

:-Dustin

Changed in kvm (Ubuntu Intrepid):
milestone: intrepid-updates → none
status: In Progress → Fix Released
Changed in kvm (Ubuntu Hardy):
status: Won't Fix → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.