Virtio not working in Hardy 64bit
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_
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...
Changed in kvm: | |
importance: | Undecided → Medium |
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 8.04.2- desktop- amd64.iso from ubuntu website on the host 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
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-
Configure bridge and tap0 interface, enslave tap0 to the bridge
First boot is like this:
kvm -m 2000 -boot d -drive file=vmhd.
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: 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
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.
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.