0

I am trying to run Qemu on my Mac and I have some difficulties. I am using OS X 10.8.2 and installed Qemu 1.2.50 via their repository.

Update: Just upgraded to Qemu 1.3.50 and the problem is still the same.

When I run

qemu-system-i386

from the command line everything works well and I can terminate execution using Ctrl-C. As soon as I add -vnc :0 however I am no longer able to terminate without killing the process from the Activity Monitor.

My problem is, that I am not just starting Qemu manually from time to time but that I have a Java program that requieres Qemu to perform some task via the vnc protocol, so manual shutdown is not an option.

So basically at some point in my program I start a thread that does:

Runtime rt = Runtime.getRuntime();
process = rt.exec("/usr/local/bin/qemu-system-i386 -vnc :0");
// Some stuff via vnc protocol

At some later point from my main thread I call:

process.destroy();

This does not terminate Qemu on OS X. The same code works with Qemu 1.2.0 on Ubuntu 12.10

So I guess my question is how to properly shutdown Qemu with vnc enabled on OS X.

Or maybe I could just try to force-quit the Qemu process like the Activity Manager does?

migrated from stackoverflow.com Dec 15 '12 at 8:03

This question came from our site for professional and enthusiast programmers.

0

Update on August 18th, 2017: The issue appears to be resolved with QEMU version 2.9.0


I filed a bug report at Qemu and got a response:

Interesting -- my experience is that control-C doesn't work at all, even if using the cocoa UI frontend. It's a bug of some kind related to signal handling but I haven't been able to track it down. As far as I could tell with a debugger QEMU never received the SIGTERM at all, which makes no sense to me.

As a workaround you can send QEMU a SIGKILL, which will abruptly terminate QEMU (NB that if you have a writable disk image you may find it is corrupt since this is a long way from a clean shutdown). The best approach would be to make the guest cleanly power down the VM, which should cause QEMU to exit automatically.

From: Qemu Bug tracker

  • on 2017-04-07: He asked you if the issue is still reproducible with the latest version of QEMU (version 2.9)? on 2017-06-07 [Expired for QEMU because there has been no activity for 60 days.] – Rida Jul 23 '17 at 12:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.