Hot answers tagged

79

Qemu: QEmu is a complete and standalone software of its own. You use it to emulate machines, it is very flexible and portable. Mainly it works by a special 'recompiler' that transforms binary code written for a given processor into another one (say, to run MIPS code on a PPC mac, or ARM in an x86 PC). To emulate more than just the processor, Qemu ...


40

When working together, KVM arbitrates access to the CPU and memory, and QEMU emulates the hardware resources (hard disk, video, USB, etc.). When working alone, QEMU emulates both CPU and hardware.


16

The image will not shrink automatically, since when you delete files, you don't actually delete data (this is why undelete works). Qemu has a facility to shrink qcow2 images back, but what the utility does is really deduplicate the zeroes from the disk, leaving all other information intact. So the idea would be to: Zero-fill the drive (dd if=/dev/zero of=/...


14

You are partially correct. Just be careful, as there can be some confusion. KVM is the name of the virtualization technology in the Linux kernel. KVM is also commonly used as the name of a fork (a more accurate name would be qemu-kvm) of the QEMU project with better support for the hardware virtualization. This claim was confirmed by the QEMU project, but ...


11

How about this (example for vnet13): $ VNET=vnet13; for vm in $(virsh list | grep running | awk '{print $2}'); do virsh dumpxml $vm|grep -q "$VNET" && echo $vm; done Here we use virsh dumpxml to show dynamic properties about the VM, which are not available in the static XML definition of the VM in /etc/libvirt/qemu/foo.xml. Which vnetX interface ...


11

You can't use switch port security on the Cisco since all the VMs will be sharing a physical switch port. And you can't use Linux iptables because the traffic is being bridged, not routed, through the hypervisor machine. But you can emulate switch port security on the hypervisor with Linux ebtables, which is a lesser-known layer 2/3 firewall on the Linux ...


10

It's quite simple really. For homogeneous clusters and single host setups use the host option. For mixed clusters, use the lowest available CPU version, so if one host is Penryn and the other Nehalem, use Penryn on both. If you are using RHEV or oVirt, this is already built in. VMWare have this called "EVC" and position it as a huge feature. Getting back ...


9

First, create a raw image of the required size. I'll assume 10G is enough. Using seek creates a sparse file, which saves space. dd if=/dev/null of=example.img bs=1M seek=10240 Next, create a filesystem on it. mkfs.ext4 -F example.img (Note that you need the -F option for mkfs.ext4 to operate on a file as opposed to a disk partition) Then, mount it. ...


9

You probably need to make a label on the disk first. Try just running parted manually: parted /dev/hda unit GB mklabel msdos mkpartfs primary ext3 0 5


9

When connected to the monitor via telnet, anything that you type will be interpreted as a command by the monitor itself. You can view the full list of commands in the QEMU Emulator User Documentation, one of which is quit (or q for short). To disconnect the telnet session you need to first use the telnet escape key which is Ctrl-] and then you can type quit ...


8

If libvirt doesn't reload VM settings on start/stop, virsh edit command may help. And please write entire XML file and libvirt version Hmm... everything seems OK. Try adding <boot dev='hd'/> <boot dev='cdrom'/> <bootmenu enable='yes'/> to <os> section and look if cdrom appears in boot menu. Also try removing all <boot> records ...


8

Did you try to 'telnet' way? I.e.: Ctrl+] telnet> quit


8

The Windows guests currently have no VirtIO Don't lose more time with tweaking anything. Install the virtIO drivers and come back. The difference is so huge that any enhancement you can find now will have no meaning with virtIO. Just an example with one of our servers: - without virtIO a W2k3 can handle about 10 Terminal Server users - with virtIO, the ...


8

The problem is that the interface has to be set to promiscuous mode through Vagrant, doing it inside the guest operating systems isn't enough. For example, if you add two NICs, and the last NIC you define is the one that will be bridged to the VMs, your Vagrantfile should contain something like: compute1_config.vm.customize ["modifyvm", :id, "--...


8

I believe the tool you're looking for is kpartx. The general procedure is: List partitions in the disk image: kpartx -l /dev/vg0/mylv Add the partitions to device-mapper: kpartx -a /dev/vg0/mylv Mount the partition you're interested in: mount -o ro /dev/mapper/loop0p5 /mnt


8

This is for google guys like me. Those answers are pretty useless, this is not a distro problem but a bug in Windows: http://keyliner.blogspot.se/2009/11/windows-7-slow-keyboard-response.html (second clause) That is what helped me: a. Start, Run, "Regedit" If the RUN command is not visible, see this link. b. Tunnel to this key: Hkey_LocalMachine/System/...


7

This issue was caused by the way libvirt uses apparmor. The default behavior is to provide some protection for the host against the guest by restricting which files the virtualization process on the host is allowed to access. libvirt knows that the virtualization process (kvm in this case) needs the disk image in order to operate properly, so it creates an ...


7

I will give very rough idea/explanation. In OP situation, besides measuring within the VM, the host should be look at too. In this case, we can assume the following are correct In all the test, the host I/O(disk) bandwidth is not max out. As VM("monitoring") I/O increases with more CPUs allocated to it. If host I/O was already max out, there should be no ...


6

Storing QEMU-images in a database is on many levels very impractical. Using an ordinary filesystem for the storage itself, and referencing the files from the database is a lot simpler - and will probably grant you what you're trying to achieve. If this doesn't work for you, I'd like to know more about what you're trying to achieve.


6

virt-sparsify can do all this with less hassle on your part: http://libguestfs.org/virt-sparsify.1.html


6

Add conv=notrunc: dd if=/dev/zero of=YOUR_IMAGE_FILE bs=512 count=1 conv=notrunc


6

Try using dd with conv=notrunc dd if=/dev/zero of=myserver.img bs=512 count=1 conv=notrunc From the dd man page notrunc do not truncate the output file e.g. ls -l myserver.img -rw-r--r-- 1 iain users 1536 Mar 27 12:31 myserver.img dd if=/dev/zero of=myserver.img bs=512 count=1 conv=notrunc ls -l myserver.img -rw-r--r-- 1 iain users ...


6

KVM is a kernel module that allows, through virtualization specific CPU extensions, to schedule a VMs CPU request directly in the host CPU and RAM, with minimal amount of overhead. QEMU provides the rest of the emulated hardware, because a machine, even virtual, is not just a CPU - it's a lot of additional hardware. QEMU can also emulate the CPU, but ...


6

Qemu doesn't work in the same way many other hypervisors do. For starters, it can provide full emulation. That means you can run x86 code on an ARM processor, for example. When in KVM mode, as you're using it, it doesn't actually do that... the processor is exposed no matter what, but what is reported to the OS will be changed by the -cpu flag. If you want ...


6

Noop conversion (qcow2-to-qcow2) removes sparse space: qemu-img convert -O qcow2 source.qcow2 shrunk.qcow2 You can also try add compression (-c) to the output image: qemu-img convert -c -O qcow2 source.qcow2 shrunk.qcow2 Before running above command be sure to shutdown the VM. After you are satisfied with the result, you can rename shrunk.qcow2 to ...


6

Changes made to a network take place the next time the network is started. You need to perform this series of operations. virsh net-edit somenet virsh net-destroy somenet virsh net-start somenet For confirmation of this, see functionality of virsh net-edit Note that restarting a network like this will terminate network connectivity for any VMs using this ...


6

For your specific use case (base image + qcow2 overlay), the RAW format should be preferred: It's faster: as it has no metadata associated, it is as fast as possible. On the other hand, Qcow2 has two layer of indirection that must be crossed before to hit the actual data As the overlay layer must be a Qcow2 file, you don't lose the ever-useful snapshot ...


6

Most current hypervisors that run on Intel hardware use CPUID leaves 0x40000000 et seq. to pass information about the hypervisor from host to guest. KVM, Xen, VMware and Hyper-V all use this method. This is in addition to the hypervisor feature flag set in CPUID leaf 0x1, which indicates that the machine is a virtual machine. It's therefore trivial for a ...


5

As recommend in one of the comments (thanks cperrin88), Ubuntu 12.04 brought the solution. Some parameters: Kernel 3.2 80 cores (40 physical, 80 because of Intel HT) kvm 1:84+dfsg-0ubuntu16+1.0+noroms+0ubuntu13 kvm-ipxe 1.0.0+git-3.55f6c88-0ubuntu1 qemu-kvm 1.0+noroms-0ubuntu13 libvirt 0.9.8-2ubuntu17.1 The Windows guest now shows a boot bar during the ...



Only top voted, non community-wiki answers of a minimum length are eligible