4

I am a student and trying to compile QEMU on MINGW32 in user emulation mode. I read in certain document that, the following OS are supported in user space emulation: 1. Linux (referred as qemu-linux-user) 2. Mac OS X/Darwin (referred as qemu-darwin-user) 3. BSD (referred as qemu-bsd-user)

I want to know whether Windows OS(through mingw or cygwin) is supported in QEMU user space emulation? Has anyone tried to use it?

2 Answers 2

5

As far as I know, QEMU's user mode emulation only works if the host OS matches with what you're trying to emulate. THis is based on my own experience trying to get the BSD and Darwin emulation working on a Linux host with no luck whatsoever.

Explaining why is a bit complicated, but it largely comes down to the fact that QEMU's user mode emulation is, at its core, a machine code translator that also properly maps system call numbers and converts data structures as appropriate (bit-width and bit-order conversions). MingW provides a UNIX-like environment on Windows, but does not implement any of the full ABI's that QEMU's user mode emulation can translate to.

You may, however, have some luck running it inside a WSL environment (at least, for the Linux emulation), as that provides a (mostly) complete Linux userspace ABI.

5
  • Okay. I will try with WSL environment. Let's see whether it works. Thank you Sep 5, 2018 at 4:26
  • I tried to compile Qemu in WSL environment and it was successfully built. I am able to execute qemu in WSL now. Thanks alot Austin for your help. Sep 27, 2018 at 11:04
  • But, my concern is to run qemu directly on windows without using WSL. Is it possible to run the qemu executable generated in WSL directly on windows (either in command prompt or power shell)? Or is there any other way to do so..? Sep 27, 2018 at 11:07
  • I'm not quite sure. I've heard that there are ways you can set up WSL to let you invoke Windows executables directly from the shell prompt inside the WSL environment, so I would assume the reverse is also possible, I'm just not sure how. Sep 27, 2018 at 19:18
  • okay I will check. Sep 28, 2018 at 3:56
0

If you want linux in windows, look for coLinux. Note : coLinux is now maintained by the linux kernel devs. So just download the kernel from kernel.org and run "make menuconfig ARCH=colinux" then "make"

If you want another CPU, just combine coLinux with your favorite linux distribution such as debian. You may install qemu-user-static and binfmt. https://wiki.debian.org/QemuUserEmulation

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .