From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mxh7x-0000eI-6R for qemu-devel@nongnu.org; Tue, 13 Oct 2009 09:09:21 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mxh7s-0000de-UD for qemu-devel@nongnu.org; Tue, 13 Oct 2009 09:09:20 -0400 Received: from [199.232.76.173] (port=46451 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mxh7s-0000da-JK for qemu-devel@nongnu.org; Tue, 13 Oct 2009 09:09:16 -0400 Received: from smtp2-g21.free.fr ([212.27.42.2]:41528) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mxh7r-0005bZ-QS for qemu-devel@nongnu.org; Tue, 13 Oct 2009 09:09:16 -0400 Received: from smtp2-g21.free.fr (localhost [127.0.0.1]) by smtp2-g21.free.fr (Postfix) with ESMTP id 136A44B01A4 for ; Tue, 13 Oct 2009 15:09:11 +0200 (CEST) Received: from laptop (vaf26-2-82-244-111-82.fbx.proxad.net [82.244.111.82]) by smtp2-g21.free.fr (Postfix) with ESMTP id 1A34B4B007A for ; Tue, 13 Oct 2009 15:09:09 +0200 (CEST) In-Reply-To: Subject: Re: [Qemu-devel] Starting QEMU by PHP/Apache From: "=?utf-8?q?Fran=C3=A7ois?= Revol" Date: Tue, 13 Oct 2009 15:12:14 +0200 CEST Message-Id: <1387050533-BeMail@laptop> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Hi, > Did anybody had success to start a QEMU instance by a PHP > script under the Apache web server =3F see http://dev.haiku-os.org/browser/haiku/trunk/3rdparty/mmu=5Fman/onlinedemo/haiku.php > > I allow the Apache user with the help of sudoers to start > the QEMU binary as root. I've hacked the "qemu-socket.c" > to set the access mode to allow communication for the > monitor socket (only add "chmod(path, bits>)"). Though I never neeeded to start it as root. It's probably a bad idea anyway. You might also ask the Free Live OS Zoo team, though I think they use perl: http://www.oszoo.org/wiki/index.php/Free=5FLive=5FOS=5FZoo > > I'm able to successfully start the QEMU instance from a > PHP CLI script as the user under which Apache is running > like "sudo -u sudo ". But when > I run the same script by the web server, QEMU starts up to > the BIOS, telling me to press F12 for a start device. The > "info cpus" tells "CPU #0: pc=3D0x000f08b5 (halted)". > > The full command executed by PHP is: > /usr/bin/sudo /usr/bin/qemu -L /usr/share/qemu -M isapc -m > 16 -hda -net none -serial none > -parallel none -vnc :0,password -monitor > unix:,server,nowait -name "QEMU > TEST" -pidfile -chroot > -runas > /dev/null & > > Any idea about where to look for more information =3F You might want to use a wrapper script instead... Fran=C3=A7ois.