From owner-freebsd-emulation@FreeBSD.ORG Tue Feb 4 23:38:09 2014 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C4DD69AE for ; Tue, 4 Feb 2014 23:38:09 +0000 (UTC) Received: from mail-yh0-x232.google.com (mail-yh0-x232.google.com [IPv6:2607:f8b0:4002:c01::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7E43B1A74 for ; Tue, 4 Feb 2014 23:38:09 +0000 (UTC) Received: by mail-yh0-f50.google.com with SMTP id 29so112351yhl.23 for ; Tue, 04 Feb 2014 15:38:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsd.com.br; s=capeta; h=date:from:to:subject:message-id:organization:mime-version :content-type:content-transfer-encoding; bh=VJYQQ2VQkHSP0gPW6ExIU++7mor5XtvRQ0Vo6j+H5Cs=; b=DuzwDRyP2vOLqWYMgEJO6Guofh9C+3Oj3XvLd220Z1wpdLRPyG4kWgHTSpYvMCF3Fd +R6gqrojKwYx3jjWFHHftbXx+W/Symtw9CU0g1jk+6cx73OIlOCqaFSw+CrELU7ghid4 ggBeNCSPQSgDMMVoGVVJKWEEXOqfe2WKCEbZY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:subject:message-id:organization :mime-version:content-type:content-transfer-encoding; bh=VJYQQ2VQkHSP0gPW6ExIU++7mor5XtvRQ0Vo6j+H5Cs=; b=GQIzAkuFhwC0OzLy7whdxGvKmsuUmHORcq9I01GlX/FoZCB/vK8aJIQt+dW47ZGlym 4s3SqvxDgnuZ0IJfHzFtevMTJ2ChCTXMJOEjw9Ymar7hBX6XuO+AhY/Da2awoDl0eIhC Wo/1vDkZSydmlLJtZlfGF1CVmnNvJ1dGUwgghLIMxwEANepJfvvx4SW5tDphl/i4Tgs3 Vu9/KITQPZcekqHriq8A+6sxwgYTAdvT9s75edoAyeoEBdMkTrq5C1+iKvfz3SdAkPOJ g+15T6Td9Y6++zKC66klddv3XB3xWJ1wtGHBmYEiBC8v72EpKLEmbiVaGYwwOf5A4xR3 MjBw== X-Gm-Message-State: ALoCoQmUMG/1vK0cDBlgoBEP/d8EJ26RnXnP91rbFhf1evAfvWQ1+BDF4dj6p4b3SZoUorhntzEu X-Received: by 10.236.162.132 with SMTP id y4mr41783829yhk.16.1391557088689; Tue, 04 Feb 2014 15:38:08 -0800 (PST) Received: from Papi ([186.215.0.67]) by mx.google.com with ESMTPSA id 48sm88935114yhq.11.2014.02.04.15.38.07 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 04 Feb 2014 15:38:08 -0800 (PST) Date: Tue, 4 Feb 2014 20:39:26 -0300 From: Mario Lobo To: freebsd-emulation@freebsd.org Subject: Fw: VirtualBox 4.3.6 headless startup script (WAS:keyboard repeats keystrokes) Message-ID: <20140204203926.45115b26@Papi> Organization: BSD X-Mailer: Claws Mail 3.9.3 (GTK+ 2.24.22; amd64-portbld-freebsd9.2) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2014 23:38:09 -0000 FYI Sorry! Forgot to reply to the list. My bad. -- Mario Lobo http://www.mallavoodoo.com.br FreeBSD since 2.2.8 [not Pro-Audio.... YET!!] (99% winblows FREE) "UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things." Begin forwarded message: Date: Tue, 4 Feb 2014 20:26:16 -0300 From: Mario Lobo To: Aryeh Friedman Subject: Re: VirtualBox 4.3.6 headless startup script (WAS:keyboard repeats keystrokes) On Tue, 4 Feb 2014 17:30:07 -0500 Aryeh Friedman wrote: > On Tue, Feb 4, 2014 at 5:24 PM, Mario Lobo wrote: > > > On Tue, 4 Feb 2014 04:58:28 -0500 > > Aryeh Friedman wrote: > > > > [snip..] > > > > > > > >... the > > > other option is vbox but I simply can't figure out how to run it > > > headless (from a boot script specifically) this combined with the > > > fact that unclear from Oracle's documentation if such a mode is > > > possible > > > > Aryeh; > > > > Could you elaborate more on that?. I ask this because I've been > > running different windows vbox vms on a freeBSD host, no X installed > > (initially) , and they boot headless whenever the server boots. I > > created service scripts to start/stop them from /usr/local/etc/rc.d. > > > > I said initially because I wasn't too akin to creating VMs from > > command line, and opted for the vbox qt GUI to create them. > > > > Last summer when I was attempting to do a ground up install of open > stack (something that later provided impossible due to outright > errors and missing information in the openstack manuals and that and > the testing requirements of an other project lead to petitecloud) I > did so (at least for the first few attempts) use vbox and every time > I tried to run a client headless after I installed it with -gui it > refused to start (windows much more often linux but both did the > same)... I was never able to get a full working fbsd boot->vbox > boot->vm box sequence working automatically (I also knew a lot less > about virtualization then so it might be just confused memory that > makes me believe this is not possible)... either way if you can > either send me the scripts or post them and I can intergrate them > into petitecloud I will be asking about how to send you $50. Sure thing, Aryeh ! I'll share to the list so everyone can benefit from it, if useful. I created the script x-vms (bellow) and placed it in /usr/local/etc/rc.d. Added the line "vms_anable=YES" to /etc/rc.conf In our environment, the script starts (after network REQUIRE) 4 different VMs: W2008, PfSense, W7 and W2012. For the shutdown, the VM OSes must "respect" the ACPI command. These four do, but I've come across some that didn't. 3 of the VMs have RDP/VNC disabled so the only way to access them is via the OS mechanisms (RDP/web interface) The win7 VM, I enabled VBOX vnc interface on the host, by running these: VBoxManage setproperty vrdeextpack VNC VBoxManage modifyvm Win7 --vrdeproperty VNCPassword=whatever VBoxManage modifyvm Win7 --vrdeproperty VNCAddress4=172.16.3.1 VBoxManage modifyvm Win7 --vrdeproperty VNCPort4=5901 VBoxManage modifyvm Win7 --vrdeauthlibrary null which actually adds this to the VM config file: I did this because a needed to access the VM from outside its internal interface methods. There is one thing that I should mention, which probably has more to do with X-forwarding in ssh than with Vbox. When all the VMs are running and I ssh to the FBSD host, I start up the qt GUI (VirtualBox). It comes up fine. I can create and do everything from it EXCEPT start any machine. If I try to start (to see/test if it comes up fine), it complains tha it could no allocate an X session for it. But if I close VirtualBox GUI and start the machine from VBoxSDL, it comes up fine !! Well, there you have it. As for the $50, if what I posted proves useful to you, please save it! If we ever meet some day, a nice cold beer for both of us will be on you :) ! Best wishes, -- Mario Lobo http://www.mallavoodoo.com.br FreeBSD since 2.2.8 [not Pro-Audio.... YET!!] (99% winblows FREE) "UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things." [ script x-vms ]================================== #!/bin/sh # # # PROVIDE: vms # REQUIRE: DAEMON pf # KEYWORD: shutdown . /etc/rc.subr name="vms" rcvar=${name}_enable start_cmd="vms_start" stop_cmd="vms_stop" vms_start() { echo "Starting VMs." /usr/X11R6/bin/VBoxHeadless -startvm vrecallen24 --vrde off & /usr/X11R6/bin/VBoxHeadless -startvm pfSense --vrde off & /usr/X11R6/bin/VBoxHeadless -startvm Win7 & /usr/X11R6/bin/VBoxHeadless -startvm Win2012 --vrde off& } vms_stop() { echo "Shutdown VMs." /usr/X11R6/bin/VBoxManage controlvm vrecallen24 acpipowerbutton /usr/X11R6/bin/VBoxManage controlvm pfSense acpipowerbutton /usr/X11R6/bin/VBoxManage controlvm Win7 acpipowerbutton /usr/X11R6/bin/VBoxManage controlvm Win2012 acpipowerbutton } load_rc_config $name run_rc_command "$1" =========================================================