Qemu-kvm guest virtio networking halts

Hi,
I recently switched from Debian to Archlinux, but seems to have stumbled on a bug that has made the transition a bit painfull since i rely on virtualization.
Overview:
qemu-kvm guests network interface dies after "some"  traffic over nfs via virtio interface.
Using e1000 instead of virtio network seems to solve the problem som far... but at a cost of performance.
Any suggestions on how to resolve the issue or how to work around the problem without sacrificing performance?
How to reproduce:
Configure the guest to use virtio as network driver and attach the interface to a bridge that the hosts has a configured interface on.
Export a share with a large amount of data over nfs from the host and read that data over nfs from the guest.
( what is funny/strange is that i could not get nuttcp to force the problem... )
Detail:
My guest are connected via tap interfaces to a bridge on my host and they are using virtio.
After retreiving "some" network traffic from the host over nfs the guests interface stops receiving traffic and logs "page allocation failure. order:0, mode:0x20" ( Log included below )
- tshark on guest verifies guest sending arp requests but not receiving arp reply
- tshark on host show that the host is both receiving arp request and sending arp reply
Guests are running with the following parameters:
%sudo /usr/bin/qemu-system-x86_64 -M pc-0.11 -enable-kvm -m 512 -smp 1 -name myguest -boot c -drive file=/mnt/myguest.img,if=virtio,index=0,boot=on -net nic,vlan=0,model=virtio,name=virtio.0 -net tap,vlan=0,name=tap.0,ifname=tap0 -serial pty -parallel none -usb -vnc 0.0.0.0:10 -k sv -vga std
host is currently running:
qemu-kvm 0.11.0-1
testing/kernel26 2.6.32-1
testing/kernel26-firmware 2.6.32-1
guest is currently running
testing/kernel26 2.6.32-1
testing/kernel26-firmware 2.6.32-1
kernel from testing on both host/guest was a attempt to work around a potential issue in 2.6.30 but the fault is present with both kernels.
I don't belive that the problem lies on the archlinux guest since a Debian(Lenny) guest experiances the same problem.
The same guest on the same hardare running on Debian(Lenny) as a host works fine.
from /var/log/messages
2009-12-14T00:10:58.160723+01:00 myguest kernel: tar: page allocation failure. order:0, mode:0x20
2009-12-14T00:10:58.160809+01:00 myguest kernel: Pid: 31303, comm: tar Not tainted 2.6.32-ARCH #7
2009-12-14T00:10:58.160821+01:00 myguest kernel: Call Trace:
2009-12-14T00:10:58.160859+01:00 myguest kernel: <IRQ> [<ffffffff810d5778>] ? __alloc_pages_nodemask+0x6b8/0x700
2009-12-14T00:10:58.160864+01:00 myguest kernel: [<ffffffffa019cb4b>] ? try_fill_recv+0x8b/0x1c0 [virtio_net]
2009-12-14T00:10:58.160869+01:00 myguest kernel: [<ffffffffa019d57d>] ? virtnet_poll+0x3ad/0x6e0 [virtio_net]
2009-12-14T00:10:58.160872+01:00 myguest kernel: [<ffffffff8129146a>] ? net_rx_action+0x15a/0x2a0
2009-12-14T00:10:58.160876+01:00 myguest kernel: [<ffffffffa019c2b5>] ? skb_recv_done+0x25/0x40 [virtio_net]
2009-12-14T00:10:58.160884+01:00 myguest kernel: [<ffffffff8105d177>] ? __do_softirq+0xd7/0x240
2009-12-14T00:10:58.160887+01:00 myguest kernel: [<ffffffff810131dc>] ? call_softirq+0x1c/0x30
2009-12-14T00:10:58.160891+01:00 myguest kernel: <EOI> [<ffffffff81015315>] ? do_softirq+0x65/0xa0
2009-12-14T00:10:58.160894+01:00 myguest kernel: [<ffffffff8105d07e>] ? local_bh_enable+0xae/0xb0
2009-12-14T00:10:58.160901+01:00 myguest kernel: [<ffffffff81291f44>] ? dev_queue_xmit+0x144/0x4e0
2009-12-14T00:10:58.160905+01:00 myguest kernel: [<ffffffff812c1b36>] ? ip_queue_xmit+0x196/0x440
2009-12-14T00:10:58.160908+01:00 myguest kernel: [<ffffffff812a82de>] ? sch_direct_xmit+0x6e/0x1e0
2009-12-14T00:10:58.160912+01:00 myguest kernel: [<ffffffff812d61c8>] ? tcp_transmit_skb+0x3a8/0x750
2009-12-14T00:10:58.160915+01:00 myguest kernel: [<ffffffff812d875c>] ? tcp_write_xmit+0x1ec/0xa10
2009-12-14T00:10:58.160923+01:00 myguest kernel: [<ffffffff812890bf>] ? __alloc_skb+0x6f/0x180
2009-12-14T00:10:58.160926+01:00 myguest kernel: [<ffffffff812d8fe3>] ? __tcp_push_pending_frames+0x23/0x90
2009-12-14T00:10:58.160930+01:00 myguest kernel: [<ffffffff812cb9e9>] ? tcp_sendmsg+0x8b9/0xbb0
2009-12-14T00:10:58.160933+01:00 myguest kernel: [<ffffffff8127f95e>] ? sock_sendmsg+0x12e/0x150
2009-12-14T00:10:58.160940+01:00 myguest kernel: [<ffffffff81074040>] ? autoremove_wake_function+0x0/0x30
2009-12-14T00:10:58.160944+01:00 myguest kernel: [<ffffffff8127fd79>] ? kernel_sendmsg+0x39/0x50
2009-12-14T00:10:58.160947+01:00 myguest kernel: [<ffffffffa0291292>] ? xs_send_kvec+0x82/0x90 [sunrpc]
2009-12-14T00:10:58.160951+01:00 myguest kernel: [<ffffffffa02912f4>] ? xs_sendpages+0x54/0x200 [sunrpc]
2009-12-14T00:10:58.160955+01:00 myguest kernel: [<ffffffffa02915d8>] ? xs_tcp_send_request+0x58/0x190 [sunrpc]
2009-12-14T00:10:58.160962+01:00 myguest kernel: [<ffffffffa028ee3c>] ? xprt_transmit+0x7c/0x300 [sunrpc]
2009-12-14T00:10:58.160966+01:00 myguest kernel: [<ffffffffa028bf3f>] ? call_transmit+0x18f/0x2b0 [sunrpc]
2009-12-14T00:10:58.160969+01:00 myguest kernel: [<ffffffffa029437a>] ? __rpc_execute+0xaa/0x2b0 [sunrpc]
2009-12-14T00:10:58.160973+01:00 myguest kernel: [<ffffffffa028cae1>] ? rpc_run_task+0x31/0x80 [sunrpc]
2009-12-14T00:10:58.160980+01:00 myguest kernel: [<ffffffffa0323d1e>] ? nfs_read_rpcsetup+0x17e/0x1e0 [nfs]
2009-12-14T00:10:58.160984+01:00 myguest kernel: [<ffffffffa03238b0>] ? readpage_async_filler+0x0/0x190 [nfs]
2009-12-14T00:10:58.160988+01:00 myguest kernel: [<ffffffffa03238b0>] ? readpage_async_filler+0x0/0x190 [nfs]
2009-12-14T00:10:58.160991+01:00 myguest kernel: [<ffffffffa032158a>] ? nfs_pageio_doio+0x2a/0x70 [nfs]
2009-12-14T00:10:58.160995+01:00 myguest kernel: [<ffffffffa032161b>] ? nfs_pageio_add_request+0x4b/0xf0 [nfs]
2009-12-14T00:10:58.161003+01:00 myguest kernel: [<ffffffffa03239aa>] ? readpage_async_filler+0xfa/0x190 [nfs]
2009-12-14T00:10:58.161007+01:00 myguest kernel: [<ffffffffa03238b0>] ? readpage_async_filler+0x0/0x190 [nfs]
2009-12-14T00:10:58.161010+01:00 myguest kernel: [<ffffffff810d7dc1>] ? read_cache_pages+0xa1/0x100
2009-12-14T00:10:58.161014+01:00 myguest kernel: [<ffffffffa03234bd>] ? nfs_readpages+0x19d/0x2b0 [nfs]
2009-12-14T00:10:58.161021+01:00 myguest kernel: [<ffffffffa0324230>] ? nfs_pagein_one+0x0/0xe0 [nfs]
2009-12-14T00:10:58.161024+01:00 myguest kernel: [<ffffffff810d7709>] ? __do_page_cache_readahead+0x1c9/0x280
2009-12-14T00:10:58.161028+01:00 myguest kernel: [<ffffffff810d77dc>] ? ra_submit+0x1c/0x30
2009-12-14T00:10:58.161031+01:00 myguest kernel: [<ffffffff810d0629>] ? generic_file_aio_read+0x339/0x600
2009-12-14T00:10:58.161035+01:00 myguest kernel: [<ffffffff8110edb2>] ? do_sync_read+0xe2/0x120
2009-12-14T00:10:58.161042+01:00 myguest kernel: [<ffffffff81074040>] ? autoremove_wake_function+0x0/0x30
2009-12-14T00:10:58.161045+01:00 myguest kernel: [<ffffffff81331212>] ? preempt_schedule_irq+0x42/0x70
2009-12-14T00:10:58.161049+01:00 myguest kernel: [<ffffffff8104ad02>] ? finish_task_switch+0x42/0xc0
2009-12-14T00:10:58.161052+01:00 myguest kernel: [<ffffffff8110fb65>] ? vfs_read+0xb5/0x1a0
2009-12-14T00:10:58.161059+01:00 myguest kernel: [<ffffffff8110fd3e>] ? sys_read+0x4e/0x90
2009-12-14T00:10:58.161063+01:00 myguest kernel: [<ffffffff81012e8b>] ? device_not_available+0x1b/0x20
2009-12-14T00:10:58.161066+01:00 myguest kernel: [<ffffffff81012042>] ? system_call_fastpath+0x16/0x1b
2009-12-14T00:10:58.161068+01:00 myguest kernel: Mem-Info:
2009-12-14T00:10:58.161071+01:00 myguest kernel: DMA per-cpu:
2009-12-14T00:10:58.161077+01:00 myguest kernel: CPU 0: hi: 0, btch: 1 usd: 0
2009-12-14T00:10:58.161080+01:00 myguest kernel: DMA32 per-cpu:
2009-12-14T00:10:58.161083+01:00 myguest kernel: CPU 0: hi: 186, btch: 31 usd: 137
2009-12-14T00:10:58.161086+01:00 myguest kernel: active_anon:887 inactive_anon:896 isolated_anon:0
2009-12-14T00:10:58.161089+01:00 myguest kernel: active_file:4740 inactive_file:112288 isolated_file:0
2009-12-14T00:10:58.161092+01:00 myguest kernel: unevictable:0 dirty:8 writeback:0 unstable:0
2009-12-14T00:10:58.161099+01:00 myguest kernel: free:728 slab_reclaimable:1589 slab_unreclaimable:1798
2009-12-14T00:10:58.161102+01:00 myguest kernel: mapped:1605 shmem:17 pagetables:332 bounce:0
2009-12-14T00:10:58.161111+01:00 myguest kernel: DMA free:1988kB min:84kB low:104kB high:124kB active_anon:0kB inactive_anon:0kB active_file:0kB inactive_file:13860kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:15352kB mlocked:0kB dirty:0kB writeback:0kB mapped:0kB shmem:0kB slab_reclaimable:16kB slab_unreclaimable:56kB kernel_stack:0kB pagetables:0kB unstable:0kB bounce:0kB writeback_tmp:0kB pages_scanned:0 all_unreclaimable? no
2009-12-14T00:10:58.161119+01:00 myguest kernel: lowmem_reserve[]: 0 489 489 489
2009-12-14T00:10:58.161162+01:00 myguest kernel: DMA32 free:924kB min:2784kB low:3480kB high:4176kB active_anon:3548kB inactive_anon:3584kB active_file:18960kB inactive_file:435292kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:500896kB mlocked:0kB dirty:32kB writeback:0kB mapped:6420kB shmem:68kB slab_reclaimable:6340kB slab_unreclaimable:7136kB kernel_stack:1104kB pagetables:1328kB unstable:0kB bounce:0kB writeback_tmp:0kB pages_scanned:0 all_unreclaimable? no
2009-12-14T00:10:58.161167+01:00 myguest kernel: lowmem_reserve[]: 0 0 0 0
2009-12-14T00:10:58.161171+01:00 myguest kernel: DMA: 1*4kB 0*8kB 0*16kB 2*32kB 2*64kB 2*128kB 2*256kB 0*512kB 1*1024kB 0*2048kB 0*4096kB = 1988kB
2009-12-14T00:10:58.161179+01:00 myguest kernel: DMA32: 93*4kB 1*8kB 2*16kB 0*32kB 2*64kB 3*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 924kB
2009-12-14T00:10:58.161182+01:00 myguest kernel: 117053 total pagecache pages
2009-12-14T00:10:58.161184+01:00 myguest kernel: 0 pages in swap cache
2009-12-14T00:10:58.161187+01:00 myguest kernel: Swap cache stats: add 0, delete 0, find 0/0
2009-12-14T00:10:58.161194+01:00 myguest kernel: Free swap = 0kB
2009-12-14T00:10:58.161196+01:00 myguest kernel: Total swap = 0kB
2009-12-14T00:10:58.161199+01:00 myguest kernel: 131056 pages RAM
2009-12-14T00:10:58.161201+01:00 myguest kernel: 4443 pages reserved
2009-12-14T00:10:58.161204+01:00 myguest kernel: 8899 pages shared
2009-12-14T00:10:58.161210+01:00 myguest kernel: 120326 pages non-shared
Last edited by nlights (2009-12-17 22:10:20)

Mr.Elendig wrote:Bridging is the best way todo it, so you should give us some more info on your atempt at it, so that we can help you fix it.
Ok, I've followed the instructions from the wiki.
One problem is that I'm on a laptop. eth0 is wireless and eth1 is wired. I chose to use eth1 since I thought it'd be easier to get working on one device before trying to make it work on both.
1. bridge and tun modules are loaded from rc.conf
2. In /etc/conf.d/bridges I have this:
bridge_br0="eth1"
BRIDGE_INTERFACES=(br0)
3. In /etc/rc.conf I changed my networking portion to this:
eth1="eth1 up"
br0="dhcp"
INTERFACES=(eth1 br0)
4. In /etc/udev/rules.d/65-kvm.rules I have this:
KERNEL=="tun", NAME="net/%k", GROUP="kvm", MODE="0660"
5. My user is part of the kvm group, although I have also tried running qemu-kvm as root.
6. In /etc/qemu-ifup I put:
#!/bin/sh
echo "Executing /etc/qemu-ifup"
echo "Bringing up $1 for bridged mode..."
sudo /sbin/ifconfig $1 0.0.0.0 promisc up
echo "Adding $1 to br0..."
sudo /usr/sbin/brctl addif br0 $1
sleep 2
7. Using visudo I added this to the bottom:
Cmnd_Alias QEMU=/sbin/ifconfig,/sbin/modprobe,/usr/sbin/brctl,/usr/bin/tunctl
%kvm ALL=NOPASSWD: QEMU
8. I launch qemu-kvm with the following script:
USERID=`whoami`
IFACE=`sudo tunctl -b -u $USERID`
qemu-kvm -net nic -net tap,ifname="$IFACE" -vga std -m 1024 -k en-us -usbdevice tablet -localtime /dev/sda
sudo tunctl -d $IFACE &> /dev/null
My system starts with br0 getting the dhcp IP on boot, so that part is working.
When I run the qemu-kvm start script I get this error (running as user or root):
/etc/qemu-ifup: could not launch network script
Could not initialize device 'tap'
/etc/qemu-ifup is executable
Last edited by shakin (2009-06-05 19:13:14)

Similar Messages

  • Qemu-kvm: network access from host to guest

    I need ssh and http access from my host (Arch) to the guest (other Linux). I've failed at setting up Tap networking as described in the wiki. I don't need to have the whole LAN access the guest, so is there another way the host can access the guest? Using the guest's IP of 10.0.2.15 doesn't work, but I'm hoping there is a way to do it.
    Thanks.

    Mr.Elendig wrote:Bridging is the best way todo it, so you should give us some more info on your atempt at it, so that we can help you fix it.
    Ok, I've followed the instructions from the wiki.
    One problem is that I'm on a laptop. eth0 is wireless and eth1 is wired. I chose to use eth1 since I thought it'd be easier to get working on one device before trying to make it work on both.
    1. bridge and tun modules are loaded from rc.conf
    2. In /etc/conf.d/bridges I have this:
    bridge_br0="eth1"
    BRIDGE_INTERFACES=(br0)
    3. In /etc/rc.conf I changed my networking portion to this:
    eth1="eth1 up"
    br0="dhcp"
    INTERFACES=(eth1 br0)
    4. In /etc/udev/rules.d/65-kvm.rules I have this:
    KERNEL=="tun", NAME="net/%k", GROUP="kvm", MODE="0660"
    5. My user is part of the kvm group, although I have also tried running qemu-kvm as root.
    6. In /etc/qemu-ifup I put:
    #!/bin/sh
    echo "Executing /etc/qemu-ifup"
    echo "Bringing up $1 for bridged mode..."
    sudo /sbin/ifconfig $1 0.0.0.0 promisc up
    echo "Adding $1 to br0..."
    sudo /usr/sbin/brctl addif br0 $1
    sleep 2
    7. Using visudo I added this to the bottom:
    Cmnd_Alias QEMU=/sbin/ifconfig,/sbin/modprobe,/usr/sbin/brctl,/usr/bin/tunctl
    %kvm ALL=NOPASSWD: QEMU
    8. I launch qemu-kvm with the following script:
    USERID=`whoami`
    IFACE=`sudo tunctl -b -u $USERID`
    qemu-kvm -net nic -net tap,ifname="$IFACE" -vga std -m 1024 -k en-us -usbdevice tablet -localtime /dev/sda
    sudo tunctl -d $IFACE &> /dev/null
    My system starts with br0 getting the dhcp IP on boot, so that part is working.
    When I run the qemu-kvm start script I get this error (running as user or root):
    /etc/qemu-ifup: could not launch network script
    Could not initialize device 'tap'
    /etc/qemu-ifup is executable
    Last edited by shakin (2009-06-05 19:13:14)

  • QEMU/KVM bridge networking howto

    Hello all,
    I had a dialog here:  https://bbs.archlinux.org/viewtopic.php?id=145177  but I inadvertently hijacked the OP thread, for that I deeply apologize and decided to start my own thread.
    I've been struggling with getting my bridge networking working with QEMU/KVM.  I would love to get my KVM Windows 7 install working with bridge network so I can access my internal lan, but so far I am out of luck.  When I follow the Wiki's I completely hose my network settings and can't get online with my Arch host.
    I've followed the wiki's here:
    https://wiki.archlinux.org/index.php/QE … al_network
    should I be using this wiki instead:
    https://wiki.archlinux.org/index.php/KV … Networking
    I'm kinda confused on how to approach this since there are separate wikis for QEMU and KVM.
    I have a couple of confusing questions, that I hope someone can answer, or lead me in a direction to help me find a solution.  Free internet beer for helping. 
    From a vanilla install of Arch, if I would like to run Windows 7 64-bit in a VM, should I use QEMU or KVM?  I did get the windows 7 up and running, not sure how, but it's not on my internet LAN, the VM can only access the internet.
    Can someone help me out step by step or pointing me in a direction that can help get a bridge network set up between my host, which will need a static IP address, and my VM, which I would prefer to have another static IP address on my network.
    I've tried using virtualbox but the performance was slower than using QEMU/KVM.
    BTW, what's the difference between QEMU and KVM?  I'm confused by that as well.  I would even be willing to write up a "beginners guide" if I can get help getting mine set up.
    any help is greatly appreciated.
    --nixIT

    I do things manually on my system so, for two VM:
    ip tuntap add dev tap0 mode tap user djgera
    ip tuntap add dev tap1 mode tap user djgera
    brctl addbr br0
    brctl setfd br0 0.0
    brctl addif br0 eth0
    brctl addif br0 tap0
    brctl addif br0 tap1
    ip link set dev br0 up
    ip link set dev tap0 up
    ip link set dev tap1 up
    ip addr del 192.168.0.77/24 dev eth0
    ip addr add 192.168.0.77/24 broadcast + dev br0
    ip route add default via 192.168.0.1
    then each qemu-kvm instance that I lauch add:
    -device virtio-net-pci,netdev=net0,mac=52:54:00:12:34:00 -netdev type=tap,id=net0,ifname=tap0,script=no,downscript=no
    -device virtio-net-pci,netdev=net1,mac=52:54:00:12:34:01 -netdev type=tap,id=net1,ifname=tap1,script=no,downscript=no

  • [solved]qemu-kvm, cant start all guests with latest qemu-kvm

    Hi there!
    I have a problem when I updated qemu-kvm package from 1.0.1-3 to 1.1.0-1
    Some Linux guests can get started without problems but other will die after grub tries to load the kernel.
    In my messages log i can find the following error when starting a affected guets:
    qemu-kvm[2026]: segfault at 10 ip 00007f2845549d0e sp 00007f283d024c00 error 4 in qemu-system-x86_64[7f2845419000+308000]
    After downgrading to the previous version i could start the guests again.
    Did anyone had similar problems with the current qemu?
    Kind regards
    Edit: Upgrade to 1.1.1.1 solves the issue
    Last edited by nonsens (2012-07-20 08:17:31)

    After some reading I found a workaround:
    Edit the VM configuration with
    #virsh edit <VM NAME>
    and replace 'pc-0.15' with "pc-1.1'
    <os>
    <type arch='x86_64' machine='pc-1.1'>hvm</type>
    <boot dev='hd'/>
    </os>
    The diff output of the changed /etc/libvirt/qemu/<VM_Name>.xml file with the saved one should look like:
    #diff test.xml test.xml.sav
    15c15
    < <type arch='x86_64' machine='pc-1.1'>hvm</type>
    > <type arch='x86_64' machine='pc-0.15'>hvm</type>
    Now the changed VM start successful

  • Abysmal I/O with KVM guest

    Setting up my home server with KVM so I can replace several machines with it. All has been going well. I have three guests with root partitions set up on qcow2 image files. One machine I want to run a 500GB samba share on. I would rather the files be stored on a partition directly on the hard drive rather than in a qcow2 image. I've set up a partition as a linear raid array as described here.
    This works well and I'm able to mount it correctly. The problem comes when I try to transfer files on the guest. The transfer rate is terrible. I have this set up on an encrypted disk with RAID 1 (hardware), so I'm not expecting it to be blazingly fast, but it's still terrible even by those standards.
    Here's rsyncing a 1GB file inside the guest on the 500GB partition:
    sending incremental file list
    test.img
    1048576000 100% 3.33MB/s 0:05:00 (xfer#1, to-check=0/1)
    sent 1048704084 bytes received 31 bytes 3478288.94 bytes/sec
    total size is 1048576000 speedup is 1.00
    This is transferring a 1GB file on the qcow2 image (root) of the guest:
    qcow2
    sending incremental file list
    test.img
    1048576000 100% 30.50MB/s 0:00:32 (xfer#1, to-check=0/1)
    sent 1048704084 bytes received 31 bytes 32267818.92 bytes/sec
    total size is 1048576000 speedup is 1.00
    5GB file on the host (unencrypted):
    Host on root partition
    sending incremental file list
    test.img
    5242880000 100% 29.62MB/s 0:02:48 (xfer#1, to-check=0/1)
    sent 5243520085 bytes received 31 bytes 30935221.92 bytes/sec
    total size is 5242880000 speedup is 1.00
    Mounted the same 500GB partition on the host:
    sending incremental file list
    test.img
    1048576000 100% 32.87MB/s 0:00:30 (xfer#1, to-check=0/1)
    sent 1048704084 bytes received 31 bytes 33292194.13 bytes/sec
    total size is 1048576000 speedup is 1.00
    Here's how I start the guest:
    qemu-kvm -drive file=guest1.img,if=virtio,cache=none -drive file=/dev/md0,if=virtio -drive file=/dev/md1,if=virtio -net nic,model=virtio,macaddr=00:00:00:00:00:00 -net tap,ifname=tap0,script=no,downscript=no -m 2048 -smp 4 -cpu host -vnc :50000 &
    How the RAID is created (used the defaults from the guide):
    mdadm --build --verbose /dev/md0 --chunk=16 --level=linear --raid-devices=2 /dev/loop0 /dev/mapper/vg-network

    The point of this was to keep the partition on the disk intact, while letting the guest access it. I first tried sharing the whole disk with the guest (`-drive file=/dev/sda,if=virtio`) and mounting the partition, but this was less than ideal as the disk is encrypted, so I'd have to type in my passphrase twice. Once on the host and once on the guest. With a software RAID, a small file is created to act as the MBR, then the RAID is aligned so that the partition on the RAID matches with the partition on the disk (so you can deactivated the RAID and still mount the partition).
    I haven't used libguestfs and kpartx yet, but from what I've read, those are for accessing disk images, correct? What I'm trying to avoid is using a 500GB .img file.
    I guess I could set up an NFS mount on the host, but then I might as well use that for my network storage. The idea here was to strip down the host so it's only doing one thing: KVM. Then the guests would replace the machines I have running now. One of those is running a samba share I use as network storage.

  • [SOLVED] KVM and Bridged Networking

    I've got KVM working and a Windows 2008 server installed on a image now, but it's only getting a NAT ip address. I need to get this server onto my main network, on Windows I'd use Virtual Box and Bridged Networking, but I thought I'd give KVM a try out.
    I've followed the setup at https://wiki.archlinux.org/index.php/KV … Networking
    Using Netcfg
    Bridged networking is used when you want your VM to be on the same network as your host machine. This will allow it to get a static or DHCP IP address on your network, and then you can access it using that IP address from anywhere on your LAN. The preferred method for setting up bridged networking for KVM is to use the netcfg package. You will also need to install bridge-utils.
    Netcfg#Configuring_a_bridge_for_use_with_virtual_machines_.28VMs.29
    And this page https://wiki.archlinux.org/index.php/Ne … _.28VMs.29
    I've got a bridge working I believe (all my stuff is DHCP by the way)
    Output of ifconfig
    br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 metric 1
    inet 192.168.1.52 netmask 255.255.255.0 broadcast 192.168.1.255
    inet6 fe80::21d:7dff:fea9:bb2f prefixlen 64 scopeid 0x20<link>
    ether 00:1d:7d:a9:bb:2f txqueuelen 0 (Ethernet)
    RX packets 2966 bytes 520670 (508.4 KiB)
    RX errors 0 dropped 0 overruns 0 frame 0
    TX packets 2351 bytes 1874150 (1.7 MiB)
    TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
    eth0: flags=4419<UP,BROADCAST,RUNNING,PROMISC,MULTICAST> mtu 1500 metric 1
    ether 00:1d:7d:a9:bb:2f txqueuelen 1000 (Ethernet)
    RX packets 2977 bytes 570261 (556.8 KiB)
    RX errors 0 dropped 0 overruns 0 frame 0
    TX packets 2364 bytes 1875202 (1.7 MiB)
    TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
    device interrupt 45 base 0xc000
    lo: flags=73<UP,LOOPBACK,RUNNING> mtu 16436 metric 1
    inet 127.0.0.1 netmask 255.0.0.0
    inet6 ::1 prefixlen 128 scopeid 0x10<host>
    loop txqueuelen 0 (Local Loopback)
    RX packets 72 bytes 7056 (6.8 KiB)
    RX errors 0 dropped 0 overruns 0 frame 0
    TX packets 72 bytes 7056 (6.8 KiB)
    TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
    I've got "bridge" added to my rc.conf as a MODULE which is loaded. (I saw reference to this somewhere else on the forum that this might be needed)
    I'm starting my VM with the following command
    qemu-kvm -vnc 192.168.1.52:0 -hda Nekomi -m 2048 -smp 2 -net nic
    Yet I still can't get an IP outside of the 10.0.0.0 range on the VM.
    The VNC line above is because the HOST has not VGA output at all, completely headless.
    I'm trying to get this working and trying to learn at the same time. KVM is new to me, as is bridged networking on linux.
    Any ideas? Thanks
    Last edited by Naijeru (2012-09-18 16:28:20)

    Sorry for the delay, bit a PC rebuild occurred :-(
    Anyway, I managed to get this working with steps #1-#7 from the linked section. Thanks for that. I did have a few minor issues in getting a DHCP on the host machine itself, turns out I'd missed a single ) from the daemons section of rc.conf. A human error, but difficult to fix as the machine was rendered off the network and without a VGA card... fun!
    I diverge, I have this script to bring up a bridge when the qemu-kvm starts
    #!/bin/sh
    echo "Executing /etc/qemu-ifup"
    echo "Bringing up $1 for bridged mode..."
    sudo /sbin/ifconfig $1 0.0.0.0 promisc up
    echo "Adding $1 to br0..."
    sudo /usr/sbin/brctl addif br0 $1
    sleep 2
    But when the kvm shutdowns it complains it can't find qemu-ifdown script. So I'm thinking of making one but just want to check it over first.
    #!/bin/sh
    echo "Executing /etc/qemu-ifdown"
    echo "Removing $1 from br0..."
    sudo /usr/sbin/brctl delif br0 $1
    echo "Taking down $1 from bridged mode..."
    sudo /sbin/ifconfig $1 0.0.0.0 promisc down
    sleep 2
    I've reversed the logic here, is the above the correct way to bring down the guest interface?

  • Problems in starting windows using qemu-kvm from arch

    Hello,
    I am facing problems in launching windows XP & 7 using qemu-kvm / qemu from arch. I have arch 2010.05 installed (kernel 2.6.33.4) which has kvm.ko, intel & amd modules. System is Intel Core 2 Duo 3.0GHz. Windows XP is installed on partition 0 (real) and i am trying to start windows from that real partition using qemu-kvm.
    I installed qemu-kvm using pacman -S qemu-kvm. I am running modprobe kvm and modprobe kvm-intel. Also, i have added username to kvm group.
    Command -
    qemu-kvm /dev/sda - I have grub menu.lst which gives me list and i am selecting windows to boot but windows does not start. I can see startup but then fails.
    qemu-kvm /dev/sda1 - sda1 has windows. With this qemu-kvm just hangs at Booting from Hard-disk...
    qemu-kvm -no-kvm /dev/sda - Selecting windows but this time get Windows XP activation error however i can boot same windows XP directly without any error.
    For Windows 7 - I have another HDD with Windows 7 installed on partition 0 and Arch. Everytime when i try to start Windows 7 using qemu-kvm (with kvm or without kvm) it gives blue screen with STOP: 0x... If i start Windows 7 directly it works fine.
    Also, i downloaded kernel 2.6.35 and built with KVM but still facing same problems. I also tried with qemu.
    Can anyone help me in resolving this issue? I want to qemu-kvm Windows from real partition. Let me know if it is not possible.
    Am i missing any installation/configuration steps?
    I searched on google and on arch forum/wiki but was not able to resolve this issue. Let me know if you need more details.
    Thank you,
    Satish.
    Last edited by satishk (2010-10-18 15:21:06)

    satishk wrote:Hi,
    Do i need to create two hardware profiles in Windows or Linux?
    the hardware profiles are only needed for windows , linux guest doesn't need it (unless you have compiled your own kernel without more then 1 HDD controller..  specifically for the guest)
    satishk wrote:1. Can i run qemu-kvm from linux kernel with only command support. No desktop environment installed (X11)? If yes, what is the procedure?
    qemu-KVM uses SDL, NOT X11 .
    added : SDL can be installed seperately, it doesn't require X11 .
    you can run qemu-kvm without SDL by using a special startup parameter, -nodisplay
    you have to connect with a serial connection to get to the console of the VM.
    satishk wrote:2. If i restart/shutdown from quest OS that is windows in my case, is it possible to restart/shutdown the complete system (i.e. host OS
    too)?
    you can do that by using a bash script to start the VM, that script can also be used to stop the host.
    satishk wrote:3. Whether Windows would be able to detect USB drivers and other devices by default or i need to do anything special in qemu-kvm?
    USB devices are normally detected, although you have to test how well they work.
    You may have to use udev rules to prevent the host from using those devices, they can't be used by both host and guest at the same time.
    Network cards will not be detected, but you can link a physical network device with qemu-kvm virtual network devices.
    search for qemu documentation, it also applies to qemu-kvm.
    Last edited by Lone_Wolf (2010-10-22 18:35:13)

  • Qemu-kvm for ppc emulation

    hi,
       in my arch64 I have installed qemu-kvm, and it works very well
    but I dont view command for emulate ppc system
    is this possible?
    p.s.
    in qemu package, there is a command: qemu-system-ppc
    thank you
    Last edited by sacarde (2011-02-05 13:04:55)

    Use vmware drivers:
    cur_work$ cat ~/temp/vm-start
    #!/bin/bash
    qemu-kvm -hda $1 -net nic,model=virtio \
    -net user,hostfwd=tcp:127.0.0.1:15000-:22 -vga vmware \
    -usbdevice tablet -device intel-hda -device hda-duplex -m 512
    But be sure that appropriate drivers are present in the guest OS.
    EDIT: Off-topic: Out of curiosity, how many threads does qemu-kvm create when running with virtio_blk? For me it's ~150, which I hits my ulimit settings...
    Last edited by Leonid.I (2011-10-23 22:18:20)

  • [QEMU/KVM] Use KVM switch to switch mouse/kayboard between host and VM

    I finally have my QEMU/KVM setup running and working as I want it, except for one thing. I have a KVM switch (a piece of hardware not the hypervisor ) to switch audio and video. It also offers the feature to switch mouse/keyboard between to Computers. Here is the relevant excerpt from my lsusb:
    Bus 002 Device 048: ID 046d:c52b Logitech, Inc. Unifying Receiver
    Bus 002 Device 047: ID 0557:8021 ATEN International Co., Ltd CS1764A [CubiQ DVI KVMP Switch]
    Bus 002 Device 046: ID 046d:c52b Logitech, Inc. Unifying Receiver
    Bus 002 Device 045: ID 0557:8021 ATEN International Co., Ltd CS1764A [CubiQ DVI KVMP Switch]
    The device named "Logitech, Inc. Unifying Receiver" is the dongle for my mouse and keyboard. The first problem is that both devices (in both states of the switch they both appear) have the same device id 046d:c52b. This can be solved by telling qemu to identify the device by #bus.#device instead of the id. The problem is that after each switching the device number increases. This makes sense as for the system the switching process is as if the device was unplugged and plugged in in a different usb port. Therefore the device would probably be disconnected from the VM when it was assigned on the VM's startup (is there a way to add usb devices on the fly to a vm without typing an add_usb command in the qemu shell). Do you have any ideas what I could do?
    EDIT: Just found about QMP. Would it be possible to save an initial condition (mouse/keyboard is on host) and fetch new devices busses after switching (udev?) and switch the saved sate? If the state is now "m/k should be on the vm" one could send qemu an adequate add command.
    EDIT2: I found out that my mainboard's usb is organized using 3 usb controllers (2x2.0, 1x3.0 each with 4 ports). I want to pass one of those PCI controllers to the VM but all I get is a black screen.
    EDIT3: I tried the other usb controller and it worked. Well, kind of. I moved the mouse in a circle and made a right click. Than I was not able to use the mouse or the keyboard anymore. Should I consider buying a PCI USB2.0 controller as that might be easier to forward?
    Last edited by fkoehler (2015-04-29 23:50:07)

    This article has someinteresting information in the comments. You don't have to use a kvm switch neccessarily. I for one prefer a software solution.
    Okay, so to make things clear: I do not switch keyboard/mouse. I keep them shared between both OS, using Synergy. The host OS runs a web server, and the guest OS runs a client – they exchange mouse position information, so that at any time only one of them receives ‘clicks’. This is great for both multi- and single-monitor setups.
    Another story is that I have two video outputs connected to a single monitor, and I would like to switch between them without using the buttons on the monitor itself. For this, I use the I2C that is embedded within HDMI or DP.
    Almost all monitors support DDC, but there are scarce apps that can make us of it. There is DDCcontrol for linux, but it is completely outdated, and failed to work with my particular monitor. So I ended up getting to know the VESA DDC standard, reading the source of that tool and several similar ones, and created a simple C program (source) that works in case of my setup. Most likely it will not work elsewhere, but it should give you a nice starting point for communicating with the monitor. The fragile spots are line 41 – you may need to change the i2c bus number the the one correct for your system, and you may need to prepare other data to send to the monitor (68 and 71) if you want to switch between other outputs than I do. Refer to the standard in order to prepare them.
    As for how to change his source code to help you, I am not of much help right now as I do not know the DDC protocol. Hope that helps.
    Last edited by noctlos (2015-04-30 16:01:45)

  • [solved] Libvirt "No accelerator found!" but aqemu and qemu-kvm works.

    After the latest update to libvirt I have been getting a weird error message when I try to run or install a new VM on multiple machines.
    Unable to complete install: 'internal error process exited while connecting to monitor: char device redirected to /dev/pts/1
    Could not access KVM kernel module: Permission denied
    failed to initialize KVM: Permission denied
    No accelerator found!
    Traceback (most recent call last):
    File "/usr/share/virt-manager/virtManager/asyncjob.py", line 96, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
    File "/usr/share/virt-manager/virtManager/create.py", line 1943, in do_install
    guest.start_install(False, meter=meter)
    File "/usr/lib/python2.7/site-packages/virtinst/Guest.py", line 1249, in start_install
    noboot)
    File "/usr/lib/python2.7/site-packages/virtinst/Guest.py", line 1317, in _create_guest
    dom = self.conn.createLinux(start_xml or final_xml, 0)
    File "/usr/lib/python2.7/site-packages/libvirt.py", line 2722, in createLinux
    if ret is None:raise libvirtError('virDomainCreateLinux() failed', conn=self)
    I have hardware virtulization enabled in the BIOS on my machines, as well as the the required kernel modules loaded:
    > lscpu
    Architecture: x86_64
    CPU op-mode(s): 32-bit, 64-bit
    Byte Order: Little Endian
    CPU(s): 2
    On-line CPU(s) list: 0,1
    Thread(s) per core: 1
    Core(s) per socket: 2
    Socket(s): 1
    NUMA node(s): 1
    Vendor ID: AuthenticAMD
    CPU family: 16
    Model: 6
    Stepping: 3
    CPU MHz: 800.000
    BogoMIPS: 4989.39
    Virtualization: AMD-V
    L1d cache: 64K
    L1i cache: 64K
    L2 cache: 1024K
    NUMA node0 CPU(s): 0,1
    > grep -E "(vmx|svm)" /proc/cpuinfo
    flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt nodeid_msr hw_pstate npt lbrv svm_lock nrip_save
    flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt nodeid_msr hw_pstate npt lbrv svm_lock nrip_save
    > lsmod | ack 'kvm*'
    kvm_amd 52055 0
    kvm 384721 1 kvm_amd
    I am able to create and run VMs using qemu-kvm directly and with using aqemu-git without any issues.  I am not sure if the direct cause is with Libvirt or if I am using qemu-kvm-spice from AUR (has not caused an issue before).
    Last edited by vendion (2013-02-16 20:15:15)

    I had the same problem, however the fix did not work for me.
    Tried replacing kvm user and group with qemu (since it exists), same problem.
    Reverted and created a kvm user (which did not exist and qemu-kvm package did not create), then the problem changes to
    error: Unable to read from monitor: Connection reset by peer
    I do not know if it is relevant but when run as root I get:
    # qemu-kvm
    Could not initialize SDL(No available video device) - exiting
    However as the user of the current login a qemu-kvm starts with no problems.
    maybe it indicates a systemd/polkit qxl/SDL driver problem or cgroups problem?
    my libvirtd.conf I had set the permissions to polkit but commenting it out to get the defaults changes nothing.
    a stab in the dark would predict that since systemd/polkit only allows programmes to run on the login session/seat, it is preventing the kvm/qemu user to run a programme since that user has not logged in?
    so I changed the user and group in qemu.conf again but this time to root then the following error :
    connecting to monitor: chardev: opening backend "pty" failed
    changing it to the current session/seat login username and group:
    success
    On the other hand maybe it is as result of a messed up passwd or groups file causing polkit not to work correctly?
    UPDATE: the problem also goes away when I remove a SDL display and then use the trusty old(archaic) VNC. so as I said, my guess is the qxl framebuffer and/or SDL is not being granted permission to use the display by polkit or PAM or systemd or whatever is supposed to be granting it permission.  it can probably be fixed with a rule....
    Last edited by hawkinstw (2013-03-13 23:16:18)

  • [SOLVED] KVM Broken After Switch from KVM to Qemu-KVM

    Since I made the switch from KVM 88-1 to Qemu-KVM 0.11.0-1 yesterday, my virtual Win XP64 guest OS will not load; I just get a black screen. When I try safe mode, I can see that it is getting stuck on "acpitabl.dat."
    Here's the line I've always used to start it up,
    qemu-kvm -boot c -m 512 -hda win_xp.img -net nic,vlan=1 -net user,vlan=1 -localtime -k en-us -soundhw ac97 -vga std
    Does anyone have any ideas? Thanks in advance.
    Last edited by tony5429 (2009-11-27 05:03:43)

    I see that my user was not on 'kvm' group after the switch.
    When I added my user to de kvm group Qemu-KVM works like a charm.

  • [CLOSED] install windows 7 in qemu/kvm??

    Hello all,
    I've been trying to install windows 7 (tried 64 and 32 bit, same results).  My processor supports KVM, ran that check and it passed.
    I followed the guides and wiki, but it seems that my windows 7 install stalls  on the "Starting Windows Installation" screen.  I left it alone for over 12 hours and nothing changed.
    In my research, I've found posts that state you should run the virtio drivers with windows 7 or it will just crawl.  However, the guides I've seen only show how to install the virtio drivers after windows 7 is installed, I'm not sure how to get windows 7 installed.
    Can anyone help out, or point me in the right direction?  I'm at a standstill, and I hate to keep rebooting into windows just so I can VPN into work (vpn client is windows based and won't run in wine, tried it.). 
    Any and all help is appreciated.
    --nixIT
    Last edited by nixIT (2012-03-17 14:20:19)

    teekay wrote:
    You boot with both images attached. Not Sure what the kvm command is. With virt-inst you just specify --cdrom twice.
    Maybe something like this works in qemu-kvm, to?
    qemu-kvm -drive file=/images/windos.iso,index=1,media=cdrom -drive file=/images/virtiodrivers.iso,index=2,media=cdrom ...
    thanx for the line, I was glad to see it wasn't erroring out, however, the install sticks on the "Windows is loading files..." screen with the progress indicator all the way completed.
    any ideas?
    --nixIT

  • [SOLVED] qemu-kvm update breaks libvirt

    I just recently upgraded to qemu-kvm 0.12.1.2-1
    Once I did this I was unable to start my VM's I received:
    error: Failed to start domain dns
    error: internal error unable to start guest: char device redirected to /dev/pts/1
    qemu: '' invalid format
    I just rolled back the package using the packages in
    /var/cache/pacman/pkg by pacman -U qemu-kvm-0.11.0-1-x86_64.pkg.tar.gz
    Last edited by papertigers (2010-02-25 16:01:15)

    After deciding to upgrade to the new one and actually figure out what the problem was I discovered it was a simple fix.
    To fix the problem I was getting I went into virt-manager and all you have to do is remove the machines hard drive and then reattach it.
    I was then able to boot the VM's.

  • Qemu-kvm on real partition

    Hello,
    I am a new user of Archlinux coming from  Gentoo. I know also a little bit FreeBSD  and I am appreciating Archlinux that has the flexibility of Gentoo and the cleaning of FreeBsd structure.
    After a successufull Archlinux install, I am trying to run with qemu-kvm a Linux distro (Gentoo) installed on another partition of my hard-disk as explained in Qemu page in Archlinux wiki (paragraph "Using any real partition as the single primary partition of a hard disk image"), but the virtualizer Qemu starts and hangs.
    I am not sure about the command used to create the raid device and format it.
    There is anyone that has already tried this configuration and can post the exact command line used to format the raid device and create also the bootloader ?
    Take into account that qemu-kvm is rightly installed because it is working with a Windows7, Wxp and Ubuntu guests.
    Thanks for your help, fabio

    IT'S WORKING |||
    I have some problem with assignment of right /dev/sdx in grub entry because Gentoo inverted hw-disk /dev/sda with /dev/sdb, but this method it's perfectly working with Ubuntu and Windows-XP.
    Someone should amend the Qemu wiki pages inserting the method suggested by Odysseus that, by the way, it seems to me closer to archlinux-style-of-life (kiss) instead of the complicated md-array.
    Thanks a lot, Odysseus; I will continuiing to explore Archlinux.
    fabio

  • [SOLVED] qemu-kvm high cpu usage when using pulseaudio alsa-plugin

    My Arch system is configured to use pulseaudio. When an application connects to the sound server it will use either a native pulseaudio driver, or the pulseaudio alsa-plugin if it using a alsa driver.
    qemu-kvm in 'extra' is not compiled with native pulseaudio support. When running guests with sound hardware support, qemu-kvm connects to the sound server using the pulseaudio alsa-plugin.
    The problem I'm seeing is high cpu usage on the Arch host even though cpu usage on the guest is low. Also, the guest is often unresponsive for a period of time when opening sound applications like the mixer or playing audio.
    My solution is to recompile qemu-kvm with native pulseaudio support. This eliminates the use of the pulseaudio alsa-plugin on the Arch host and fixes the above problems.
    An easy was to do this is run:
    yaourt -S qemu-kvm --build
    And edit the PKGBUILD changing the line:
    --audio-drv-list=alsa,sdl,oss,esd \
    To:
    --audio-drv-list=pa,alsa,sdl,oss,esd \
    Finish building and install. Don't forget to add yourself to the kvm group.
    Last edited by bytesize (2010-08-16 02:34:08)

    Problem disappeared.
    I'm not sure, but i think installing xf86-video-modesetting helped to fix this issue.
    I had an error messages in /var/log/Xorg.0.log like this:
    (EE) Failed to load module "modesetting" (module does not exist, 0)

Maybe you are looking for

  • Printing to specific printer and displaying report

    Hi, In Forms 10g via AS10g, I need to generate a report and print the output to a specific printer. How do I do this given that the AS Linus box cannot be mapped to various printers. The printer is also not necessarily the Client machine's default pr

  • How to build a DLL that has Pascal calling conventions with application builder?

    Hi, I'm researching for possible solution to one of our problems. In one case, solution would be to build a DLL from LabView code. This should be simple task, but the application that is going to load the DLL requires that the functions in the librar

  • CHARGED TIME AND MONEY FOR BEING MISINFORMED-COMPLAINT

    Today I received my Verizon Wireless bill and I noticed that I was being charge overage for data usage of $45.00 (3 X $15.00 per 250mb over). Now I've been with Verizon for over 10yrs and always loved the service and plans that they've provided until

  • Web Services of SAP CRM ABAP 7.0 not show up

    Hello Experts, We are testing SAP CRM 7.0. In T-cd:sproxy in CRM system, the Software Component Version SAP CRM ABAP 7.0 doesn't show up. We'd like to see the web service definitions for CRM Service Processing, but can't find them such as "ServiceOrd

  • Converting PR to Schedule Line

    Dear all:         How can I converting PRs which assigned source with Outline Agreement to Schedule Lines? I can convert just one PR to Schedule Line in MD04, but I hav no ideal about a lot PRs converting in the same time like converting PRs to POs w