How to use microphone and webcam in Qemu? - linux

I'm running Artix Linux and using Qemu & KVM to emulate Windows 10. I need to enable the support of my microphone and usb webcam. I've tried to first to pass the webcam via Virtmanager, my VM sees the webcam, but I can not get any video feed from. Also I can not get any sound input in my VM. I've tried launching it from the console:
sudo qemu-system-x86_64 -enable-kvm -m 4096 -rtc base=localtime -hda /path/win10.qcow2 -cpu host -device hda-duplex -device usb-host, hostbus=<n>, hostaddr=<m>, id=<id>
But I get this error:
drive with bus=0, unit=0 (index=0) exists
Please, help, I don't know what to do.

Related

How to make audio work in raspbian on qemu

Does anybody know how to enable audio support in raspbian running in qemu ?
lsmod shows nothing.
aplay -l shows no sound cards.
Tried with qemu ac97 and hda intel, running qemu inside ubuntu box.
Thanks in advance.

raspbian with qemu won't boot up

I tried to create a vm for raspbian in ubuntu. I made a few changes in the raspbian to test if it works in other machines or not. After that i copied the edited image into my computer. Now i try to boot it with qemu but each time qemu opens, i can't see the raspbian. Here is my work
qemu-system-arm -kernel /usr/share/qemu_vms/kernel-qemu -cpu arm1176 -m 256 -M versatilepb -serial stdio -append "root=/dev/sda2 panic=1 rootfstype=ext4 rw" -hda /usr/share/raspi-image.img
So my kernel image is in the /usr/share/qemu_vms and my image is in /usr/share.
I tried to increase the ram amount but in that case even qemu didn't start up. Also i was following this tutorial(which is almost the same with other tutorials and my /etc/ld.so.preload is missing(i can't edit it at all).
I deleted -no-reboot option so it is in a loop for rebooting everytime but it seems that it can't find the image to start.
Any help would be very appreciated.
Sorry to add another thing but i guess i need to edit the question a bit.
All the problem seems to be with the root path. I fixed that problem with adding rootfstype=ext4 rw into the root section.
Now it is entering emergency mode. I tried to change the kernel from wheezy to jessie but it is still the same problem. What is going on?

Can KVM work without libvirt?

I am sorry for silly question, but could you please tell: can KVM work without
libvirt?
From my poor experience I have seen KVM functionality which based on libvirt.
Thanks for your reply in advance.
I've used KVM without libvirt. libvirt is just a group that you assign a user to so that you are not rooted when you execute the virtual machine. You have to have qemu installed.
sudo apt-get install qemu
Then you would use the qemu package that supports the type of iso you are trying to install. Then you would write something like this
qemu-system-x86_64 -m 2048 -cdrom /path/to/Windows10.iso -enable-kvm
If you already have windows extracted onto the hard drive then you would write it like this
qemu-system-x86_64 -m 2048 -hda /path/to/Windows10.iso -enable-kvm
You can find out the different kinds of qemu packages that you have just typing in qemu in the terminal, and this will tell you the types of OSes that can be run inside of KVM using the specified package.

Linux qemu reset the register

I program assembly under Linux, compile it and put it in a virtual flash:
dd if=myProgramm.bin of=flash.bin bs=4096 conv=notrunc
dd if=myProgramm.bin of=myProgramm.bin bs=4096 conv=notrunc
Now I load the flash into the qemu emulator:
qemu-system-arm -M connex -pflash flash.bin -nographic -serial /dev/null
Here i can see the registers via
info registers
The problem is, when I now create a new flash, the old flash still is in the qemu emulator until i restart the emulator with
exit
and the Linux command qemu-system
How can I reload the flash without complete restart the whole emulator?
As for my understanding once you flashed the image in qemu you cannot update image.
suppose when you run any system using qemu which contains linux kernel zImage and rootfs with
qemu-system-arm .... args. If u want to reboot it . the qemu quits and once again you have to laod with arguments.
So in qemu as for my knowledge u cannot reload the flash without complete restart the qemu.

Mini2440 Emulation Procedure : please, how to?

I want to emulate the friendlyARM board, the Mini2440 or the mini6410, so I can get to practice the embedded programming, the QT programming and this due to some financial difficulties and strange import policy in my country.
Anyway, the problem is that I can't seem to understand what's the first step to proceed the emulation: Am running ubuntu 12.04 on VirtualBox then, I installed the qemu-kvn-extras then what ?
Do I need a new kernel for qemu and the emulation process ? What's its specifications ?
In the other hand, when I read all of the tutorials in the net, I can't see the hardware specification part : I mean where is the part in the "qemu-i386 command" that refers to the fact that I'm using Mini2440 ?
After a long period of research, I don't know whether I can emulate the board so I can get used to the u-boot and cross compiling, etc.. or it's just a dream I can't reach ..
(Sorry for reviving an old thread but I had similar issues, so this might be useful for some other people, too)
To run my tests I used (see also man qemu-system-arm):
$ qemu-system-arm -machine versatilepb -cpu arm1176 -m 128M -nographic -kernel kernel.img
You might not want the -nographic here when you are testing Qt and need to replace kernel.img with the image you want to run. However, note that you need the ARM version of qemu qemu-system-arm. It will not work with the Intel version qemu-i386 as the mini6410 runs an ARM processor (the ARM1176JZF-S).
For me, connecting with gdb was also useful (-S halts the CPU at start, -s starts a gdbserver on port 1234):
$ qemu-system-arm -machine versatilepb -cpu arm1176 -S -s -m 128M -nographic -kernel kernel.img
And then:
$ arm-none-eabi-gdb
(gdb) target remote localhost:1234
By the way, host system can be any Linux distribution, so you do not need VirtualBox if your host is already Linux.
Another remark: I am currently struggling to get the interrupts to run on qemu (see also ARM Interrupt Handling in QEMU), so not sure if everything will work for you though.
Good luck! ;)
The closest thing I know about emulating the Mini2440 is that it's emulated on MAME.
The only problem is that you're not only stuck with the 3 pre installed OSes (Windows Mobile, old version Android and a Linux distro) but it's also slow and you can't connect to anything outside of the device itself.
You'll probably need a beefy computer if you want to run this, the beefier the PC is, the faster you can run it.
Plus, you can't use your mouse as a touch screen. You'll need to map out the touch screen controls that are already present in MAME if you want something like that.

Resources