Hot answers tagged

13

qemu-kvm -hdb <device>, where <device> is the USB stick (e.g. /dev/sdb), should do it (tested with Ubuntu 12.04 on an USB stick and it works). You will need write permission to the device (i.e. be root or change its permissions).


13

QEMU's -kernel, -boot, and -initrd are BIOS only. They are completely incompatible with EFI (currently). Update: OVMF supports -boot since r13683, and supports -kernel -append -initrd since r13923. Download OVMF-0.1+r14071-1.1.x86_64.rpm or newer version. Extract bios.bin from the rpm: rpm2cpio OVMF-0.1+r14071-1.1.x86_64.rpm | cpio -idmv Specify firmware ...


13

I could reproduce the problem on my system. Your main problem are the ACL restrictions of your host. For this reason change the ACL attributes of the libvirt-qemu user : sudo setfacl -R -m u:libvirt-qemu:rwx /media/cl Change the Mode settings for Filesystem /host from Passthrough to Mapped. Why? That's the reason why: Your guest system runs as ...


11

You cannot chroot into different architecture. By chrooting, you are executing the binaries (from the chroot) on your architecture. Executing ARM binaries on x86 (and x86_64 in that matter) would lead to "Exec format error". If you want to run binaries from different architecture you will need an Emulator. Qemu is a good candidate for this, but you will ...


10

From qemu's help: Linux/Multiboot boot specific: -kernel bzImage use 'bzImage' as kernel image -append cmdline use 'cmdline' as kernel command line -initrd file use 'file' as initial ram disk -dtb file use 'file' as device tree image A quick test here using Arch's kernel/initrd (qemu -kernel /boot/vmlinuz-linux -initrd /boot/initramfs-linux.img) ...


10

Keyboard method You can release focus using the Left Ctrl+ Left Alt. Notice you have to use the left keys! Focus free method See my question I posted on this exact thing on ServerFault. The Q&A is titled: Any way to release focus on a KVM guest in virt-manager without having to click Ctrl_L + Alt_L?. This will allow you to no longer have to use the ...


9

It did work out. The kernel booted fine. The error is: Unable to mount root fs on unknown-block(0.0) The kernel is looking for a root filesystem. You need to provide one. You can't interact with a kernel without running processes on it, and the initial process has to be loaded from somewhere: when the kernel starts, it mounts a filesystem (the root ...


9

Try this on when launching qemu -redir tcp:2222::22 $ ssh -p 2222 localhost The tcp:2222::22 flag in the qemu launch command maps the 2222 port of the host machine to port 22 (the default ssh port) on the virtual machine. Then, simply sshing to the 2222 port on your localhost (the host machine) will redirect any traffic into the ssh 22 port in the ...


8

There's no need to background the application with the ampersand when it has a built-in option for doing so. Such is the case with qemu (unless you've removed it): % qemu-kvm --help | grep daemon -daemonize daemonize QEMU after initializing


8

You can do that in the console with virsh domif-setlink domain interface-device state and check it with virsh domifstat domain interface-device Have a look at the man page for details.


8

KVM is a kernel API for virtualisation. It doesn't deal with serial ports. qemu is a machine (PC and other) emulator which can use kvm for improving virtualisation performance. It can emulate a standard 8250 UART serial port (isa-serial) or paravirtualised serial port (virtio-serial). In qemu, you define your machine with command-line arguments that specify ...


7

Copy kvm virtual machines is not complicated: First, you need to shutdown the virtual machine, then you need to find the disk image where the virtual machine is stored and finally copy it to another place (cp /path/to/disk_image /new_path/). If the virtual machine is stored on its own partition, use dd if=/dev/PARTITION of=/path/to/backup/backup.img bs=1M ...


7

I don't know why exactly, but Renan's answer didn't quite work for me. KVM said to me it couldn't find a bootable drive (despite the usb partition being marked as such). However I've found another solution. Get the USB device VendorID:ProductID with lsusb. Example: $ lsusb ... Bus 002 Device 007: ID 0781:5406 SanDisk Corp. Cruzer Micro U3 Pass that to ...


6

Afaik, libvirt doesn't know what "fully booted" means (neither do I). You could make a service that connect to your host (or another machine) during boot. Or you could try connecting in a loop to your guest, for example with ssh. Another solution would be to rely on an exisiting service that communicate with the host, such as vdagent. You could easily write ...


6

I think the problem is that you should not copy qemu-arm but qemu-arm-static. This is a static compiled executable able to run from inside the chroot without any libraries. You can also look in /proc/sys/fs/binfmt_misc if there exists a file qemu-arm. If not restart the service binfmt_support.


6

As it happens, it looks like a bug in debian's package of grub. The -kernel grub.img approach works if I only include the grub modules I need upon grub-mkimage. The -bios grub.bin works with the newer grub package from experimental (2.00-7). However, the grub.bin that comes with it is not very useful. It comes with a memdisk that comes with the grub.cfg. ...


6

The kernel is telling you, that it doesn't know which device holds the root file system. Your loop mount isn't necessary. (Unmount it before continuing). Try a command like qemu -kernel bzImage -hda disk.img -append root=/dev/sda The -hda disk.img parameter tells qemu to simulate a disk device based on your disk.img. The -append root=/dev/sda switch is ...


6

I think that the error does not come from the -net statement, but from: -chardev socket,host=localhost,port=7777,server,nowait,id=port1-char The statement uses already the port 7777. For the port forwarding, with -net user,hostfwd=tcp::7777-:8001 it works fine when not setting up the virtio serial channel. If I understand right, you want to set up a ...


6

In your shell, before you run qemu, run "stty intr ^]" to change the interrupt key from ^c to ctrl-] That way, ctrl-c will be passed through to qemu, but you can still interrupt qemu itself by pressing ctrl-]


5

Seems my question is answered in the libvirt manual. One needs to specifically ensure that the same IP is handed out via DHCP each time. Here's how this can be specified: <network> … <ip address="192.0.2.1" netmask="255.255.255.0"> <dhcp> <range start="192.0.2.128" end="192.0.2.254"> <host ...


5

QEMU comes with the qemu-img program to convert between image formats. qemu-img convert -f qcow2 -O raw my-qcow2.img /dev/sdb


5

libvirt knows how to handle this. If you don't mind installing libvirtd and virsh, then you can use: virsh list to show the name(s) of the guest(s). And, to shutdown gracefully the guest with name guest_001, use the command: virsh shutdown guest_001


5

First of all, I had to use another kernel, kernel-qemu that I found here. Then, I could make it work using QEMU 1.7.1: With Raspbian: ./qemu-system-arm -kernel /path/to/kernel-qemu -cpu arm1176 -m 256 -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1 rootfstype=ext4 rw" -hda /path/to/2013-12-20-wheezy-raspbian.img With Arch ...


5

A qcow2 file will generally be more space efficient than an equivalent image file. While it is possible to create "sparse" image files, these are difficult to transfer in an efficient manner. A qcow2 relies on mechanisms other than sparse allocation to achieve "thin provisioning" and is thus easier to move around. A qcow2 file can be defined as a ...


4

virt-install ... --disk [path to your existing image] --import ... --import Skip the OS installation process, and build a guest around an existing disk image. The device used for booting is the first device specified via "--disk" or "--file". --disk [path] path - A path to some storage media to use, existing or not. Existing media can be a file or block ...


4

Not sure what more you can do; according to http://www.claunia.com/qemu/objectManager.php?sClass=version&iId=305 AIX 6.1 will not install under QEMU.


4

Qemu is not the right tool for the job. Qemu emulates a whole computer, including the CPU. This is useful to run a virtual machine on where the virtual hardware is different from the host hardware, but this is not required here. Furthermore, emulating an amd64 CPU is likely to be slower than emulating an i386 CPU. This alone might explain the difference ...


4

qemu-kvm has disappeared. use the hint in start qemu by giving it a path to a linux root instead. this means qemu-system-x86_64 -usb -usbdevice disk:/dev/sdb where /dev/sdb is your raw device (not partition) of the usb stick that you want to boot. (however, as of 12/2014, it's been flaky for me. booting ubuntu-gnome 14.10 results eventually in a ...


4

To get this to work I installed qemu-static-arm and binfmt-support from AUR. Read the comments for qemu-user-static. I had to update the PKGBUILD with the most recent download URL and hashes for makepkg to finish. (To install from AUR, download the tarball, untar, cd, run makepkg -i) Christian Wolf's answer is important. update-binfmts is not executed ...



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