QEMU User mode emulation

1

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?

anurag.student

Posted 2018-09-04T10:37:06.947

Reputation: 13

Answers

4

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.

Austin Hemmelgarn

Posted 2018-09-04T10:37:06.947

Reputation: 4 345

Okay. I will try with WSL environment. Let's see whether it works. Thank you – anurag.student – 2018-09-05T04:26:23.573

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. – anurag.student – 2018-09-27T11:04:02.913

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..? – anurag.student – 2018-09-27T11:07:55.417

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. – Austin Hemmelgarn – 2018-09-27T19:18:19.507

okay I will check. – anurag.student – 2018-09-28T03:56:59.670