[SOLVED] I need a simple way to start/stop a virtualbox vm

Hi,
  I need a very simple way to start a headless virtualbox vm on login, and cleanly save its state on system shutdown/reboot. I can't use solutions like vboxtool because my home directory is encrypted and only available after I login.
  I have written a simple script to do what I need:
#!/bin/bash
if VBoxManage startvm --type headless archdev > /dev/null 2>&1; then
trap "VBoxManage controlvm archdev savestate > /dev/null 2>&1; exit" SIGINT SIGTERM
while true;
do
sleep 10h
done
fi
  When I run this script in a interactive shell, all works as expected: It will successfully start the vm(archdev), and when I send SIGINT (using CTRL+C)  it will cleanly save the vm state. The problem I'm facing is that when I start this script as a background process(sufix it with a '&') it will successfully start, but it will fail to cleanly save state on shutdown, since it seems to  ignore signals send using 'kill' command(unless it is a SIGKILL). I highly appreciate an solution to this problem, by either explaining to me what is happening, or by providing an alternate one(as long it doesn't involve starting the vm with the system).
  Thanks in advance.
Last edited by thiago (2011-09-04 14:54:44)

cybertorture wrote:
vboxmanage startvm --type headless VMNAME
put this to start at login
su -c 'vboxmanage controlvm VMNAME savestate' USERNAME
put this to /etc/rc.local.shutdown
Worked like a charm, thanks.

Similar Messages

  • Need a simple way to view a professionally made DVD.

    I'm new to Macs (2 weeks) after 13 years in Windows. I have a DVD a professional made for me for our 25th Wedding anniversary. I have been able to play it on my Windows notebook but it freezes after about 40 seconds on the Mac.
    It starts with a still photo in which there is a small frame with script running. You click on it and the main series of photos and music start.
    I copied the folders and files from the DVD to a folder on the Mac. There are two folders: AUDIO_TS (which is empty) and VIDEO_TS.
    VIDEO_TS contains the following files: VIDEO_TS.BUP, VIDEO_TS.IFO, VIDEO_TS.VOB, VTS010.BUP, VTS010.IFO, VTS011.VOB, VTS020.BUP, VTS020.IFO, and VTS021.VOB.
    I purchased and installed QuickTime MPEG2. I can view the .VOB files, but there is no music and I can't make it run as a complete video.
    I have absolutely no experience with any video editing and know nothing about handling these types of files.
    I have a DVD that I can view on my Windows laptop and in a standard DVD/TV player. I was just hoping to be able to have it stored on my Mac and be able to view it.
    Is there a simple way to accomplish this?

    I'm new to Macs (2 weeks) after 13 years in Windows. I have a DVD a professional made for me for our 25th Wedding anniversary. I have been able to play it on my Windows notebook but it freezes after about 40 seconds on the Mac.This may be normal. It could be your Mac DVD Player simply doesn't like the disc brand or a dirty lens interrupting the continuous throughput.
    I copied the folders and files from the DVD to a folder on the Mac. There are two folders: AUDIO_TS (which is empty) and VIDEO_TS.This is normal. The AUDIO_TS folder is just there for compatibility with earliest models of DVD players.
    I purchased and installed QuickTime MPEG2. I can view the .VOB files, but there is no music and I can't make it run as a complete video.This is normal also. The QT MPEG-2 Component only supports the video portion of the VOB's MPEG-2 audio/video stream. While your Mac will now support MPEG2/MP2 (.mpeg) playback, your DVD likely contains an AC3 audio data which is not QT supported at all in "muxed" compression formats and only partially supported in "frame-to-frame" compression formats when a third-party component is installed.
    I was just hoping to be able to have it stored on my Mac and be able to view it. Is there a simple way to accomplish this?You have three basic options here:
    1) Since you have already copied the VIDEO_TS folder to your hard drive, you could try opening the Apple DVD Player, use the "Open DVD Media" File command to navigate to/select the VIDEO_TS folder. Then press the controller "Play" button to see if the content plays normally. (Since files are copied using handshaking error correction and data rereads, you may have a good playable copy of you disc saved already.
    2) Since you can view the video in QT, I assume all you need to do is use an MPEG based third-party application to regain the audio. As you already have the QT MPEG-2 component installed, my preference would be MPEG Streamclip (free) here. You can use the "Convert to MPEG" File menu option to change your MPEG2/AC3 main title file to MPEG/MP2 (.mpeg) file which is playable on your Mac. This conversion is very fast since the video is not re-compressed. Alternatively, you can convert the main title to a more efficient codec which is compatible with your Mac and takes up less space. Unfortunately, this requires re-compression which may take much longer to accomplish. In either case, be sure to use the "Fix Timecode Breaks" option before performing either type of conversion.
    3) Lastly, you can use an alternate media player like MPEG Streamclip or VLC for playback. Both will play the VOB AC3 audio, but only VLC has "device encoded" output support to an external decoder/powered speakers if your computer is equipped with such hardware.

  • After duplicating a page, how do I prevent changes to both pages (without having to rename EVERY box for every duplicated page). I need a simple way to edit pages independently after I have duplicated one page several times. Thanks.

    Its a form with 3 work history sections on it. I need to duplicate the page to include my entire work history, however, when I duplicate the page and then edit the new page to put my next 3 jobs in my work history, it edits the previous page as well.
    THERE HAS TO BE  A SIMPLE WAY TO DO THIS!!!!!

    The way to do that is to make a Template object from the first page, which
    allows you to spawn copies of it and to have the fields in those copies
    automatically renamed.
    On Wed, Sep 3, 2014 at 2:40 AM, adobeuser1987 <[email protected]>

  • Is there any way to start/stop OBIEE system components other than OPMN

    We had some issues including OPMN into our watch dog process, does oracle provide start/stop scripts to manage system components or we have to rely on OPMN ?
    Appreciate your help
    ~Srix

    Check this link
    http://www.cool-bi.com/CMDline/Individualservices.php
    You can use ias-component name in the output to stop/start individual service
    ex:
    opmnctl startproc ias-component=coreapplication_obips1
    Hope this helps, pls mark as correct if helps
    Edited by: Srini VEERAVALLI on Jan 10, 2013 2:55 PM
    Edited by: Srini VEERAVALLI on Jan 10, 2013 9:57 PM

  • Having trouble transferring itunes library to an external hard drive.  All of my music is in the main ITUNES library and every site and answer I get says tranfer my library/user name/ da da da da da.... I am not familiar with this-need a simple way-thx

    HELP!   I have looked at video sites, looked on here, to no avail.   Please dont talk negatively about my question (as I have seen some pretty mean responses to topics )   I am trying to copy my itunes music to an external hard drive.  Here is my situation:  All of my music is in the main ITUNES location.  I  have been told to save the "user library".  I really need an elementary step by step way.  I plan to visit the library in town tomorrow to get a book but worried because my computer is having issues  TONIGHT.  Thanks for any help....  This is so helpful to know there may be help out there.

    iTunes: How to move [or copy] your music to a new computer [or another drive] - http://support.apple.com/kb/HT4527
    Quick answer if you let iTunes manage your music:  Copy the entire iTunes folder (and in doing so all its subfolders and files) intact to the other drive.  Start iTunes with the option (shift on Windows) key held down and guide it to the new location of the library.
    To see your iTunes folder click on the Music folder icon in your Finder sidebar.

  • I need some simple examples to start with for Oracle ESB

    Hi All,
    Please share some simple examples to startwith for Oracle ESB.
    I need to understand, what are the files are created, once created an ESB project.
    What is the use of the files how to edit them with out using JDeveloper.
    Iam trying to create a simple example.
    I would like to create a file which has only "HELLO" in that file, simple text file inside a folder "INPUT" in my c:\ drive.
    I wanted to create a ESB service which picks up the file and add a string to it like "HELLO" + "ESB" and drop this file into "OUTPUT" folder in c:\ drive.
    How do i do that. I tried to do it when i deploy the integration server connection is gettting hit badly. I dont see that connection any more and i dont see that connection in my JDeveloper.
    I dont want to start with existing code.
    Please help
    Regards,
    Vijay.B
    Message was edited by:
    Vijay.B
    Message was edited by:
    Vijay.B

    Hi,
    If you want to do it from scratch you can basically do the following:
    Make sure you have created an application server and integration server connection in JDeveloper.
    1) Create a new JDeveloper project of type ESB project.
    2) Possibly add a ESB System/Group (open the esb file and click "Create System/Group") to group ESB projects.
    3) Create an XML schema describing your input XML file. Probably one element of type xsd:string.
    4) Create an example XML file which is well-formed and valid according to the XSD from step 3.
    5) Create a new File adapter (inbound/read). A routing service is automatically created.
    6) Create a new File adapter (outbound/write).
    7) Create a routing rule in the routing service in which you invoke the write method of the outbound file adapter. Possibly add a transformation using the XSL mapper.
    8) Deploy the ESB project to the server.
    9) Drop your XML file (from step 4) in the directory in which the inbound file adapter is polling.
    10) If it is ok, the file should be picked up, transformed and dropped in the outbound directory. A new ESB instance should be visible in the ESB console.
    See what files are generated on the filesystem in each of the above steps.
    Regards, Ronald

  • There must be a simpler way ( from start to finish ). .

    ( I did a search, but the keywords must have been too broad )
    What i describe below worked, but i know a more experienced editor would smile at the unnecessary amount of effort . . .
    At a recent School Centenary I was contracted to spend the whole day collecting stories
    I kept some rough paper notes on the start and stop times of each group interview sessions over 6 tapes
    so
    To reduce wear and tear on the camera transport I captured each tape as low grade clips of about 25 min each ( equated roughly to each interview session )
    from there I:
    a - set up a sequence named as Seq # and dragged only each 1 long clip into it
    b - used the razor tool on THE TIMELINE to cut each clip containing one anecdote per slice
    c - deleted stuff that was obviously unusable
    d - set up a bin titled something like "session #"
    e - dragged the whole of the remaining clips in that sequence # into the bin
    f - repeated the above steps 10 more times .
    so then :
    g - I set up about 20 bins, named to match categorizations that the anecdotes could be "collected" into
    h - took one slice ( from b ) at a time from each Interview session into THE VIEWER
    i - trimmed the in and out points closer to where i wanted them
    j - dropped them back into one of the 'subject' bins set up in (g) according to content
    k - there were some that needed markers to cut away long pauses, flights of irrelevancies etc, and i made a sub-clip of each
    l - spent some time renaming clips, filling text in log note and label fields in case things went awry later
    then for recapture:
    m - I set up a new sequence named for each category to match (g)
    n - dragged the whole contents of each of those bins on to it
    o - did the media manager cut down thing
    p - opened the original bins at (d) and made all the [ now discrete ] clips offline
    q - re-captured that tape.
    at the end of all that ( 11 times over ) I did the final polish and went from there.
    It looks long, and in a sense it was, but I was trying to avoid problems that I usually have with relying too much on Sub-clips.
    Indeed, between steps (p) and (q), some clips had different In/Out points but shared media start and finish, so I manually added offline clips, and with some fancy dancing, got them to replace the disobedient clips that were sending my deck into infinity.
    You'll spot a better way to do things, and no doubt it may involve a different handling of Sub-clips.
    suggestions, anyone?
    thanks
    ~rob v

    sorry not to get back sooner - I've been too flat busy
    Mostly after creating subclips from markers, when time came to recapture, they would run the deck (cam) over and over the same parts of the whole clip for just their little extent to be lifted, even though their defined regions were not overlapping and indeed nowhere near each other. I also remember a tim ewhen they'd recapture the full amount of the parent clip anywaywith the I/O markers set as per prior to recapture.
    In essence, what i've described in a very verbose manner from (a) to (l) above is all the stuff along the way of rough cutting. Admittedly i didn't need to do (m) or (n) and could have done the recapture after Making Clips Offline without the need for setting up sequences in parallel.
    As it was when i did do the deed from the different tapes, they all nicely uprez'd in their positions in the sequences i wanted them - so in that regard i did do it all in one swoop.
    What I choose to do however is always have my work at such a self-explanatory stage so that if my assistant or even i get interrupted for a few weeks on something else and have to return, we dont want to spend any time readjusting our head-space to what we were were doing ( and risk a costly mistake if we interpreted wrongly where the project was at )
    And besides i never trust any machine, code routine or whatever other smarts presented before me. I like things where i can keep track of what the programme is doing in the background, in case i need to snaffle the very thing from the disk cache manually. Its happened! and I didn't lose time or money. I'll pay the price of doing things the long way round.
    however i will take advice if there is a more elegant way of being so-minded.

  • Need a simpler way to answer the phone!

    The iPhone 4s requires 1 of 2 things to answer a phone call, depedning on whether the phone is locked or not.  If the phone is unlocked, I'm presented with a couple of buttons to accept or reject the call.  If the phone is locked, I'm required to swipe a slider on the display to answer the call.
    There are a couple of problems with these UI behaviors.  First, if one has gloves or mittens on, the touch screen doesn't work and one has to take off one's gloves to use the display and answer a call.  The second problems is that in many cases, swiping a slider requires two hands - one to hold the phone and one to swipe the slider.  If the phone isn't locked, the situation is a bit better, since pressing a button on the display can be done one-handed, more easily than moving the slider.  I could set auto-lock to "never" so the slider doesn't come show up, but this also keeps the display on and runs down the battery rather rapidly.  So ideally, I need:
    1.  A way to use the Home button to answer calls.  Our iPhones live in Otter Boxes and it takes intent to actually press this button.  It's not easy to do it by accident.
    -- OR --
    2   A way to auto-dim the display after a set period of time without auto-locking the unit.  This would be a 2nd best solution, since I'd much rather just push the Home button to answer calls.
    Maybe there are some apps that can help with this.  Any solutions will be appreciated.

    fmouse wrote:
    Meg St._Clair wrote:
    Was your old phone a touch screen phone?
    No.  It was an LG flip-phone.  If it rang, I could just flip it open with one hand and mash it to take a call.  Very handy!
    I'm not sure why you expect a touch screen phone to work like a basic flip phone. If that sort of feature is important to you, touch screen phones are not the device for you. It sounds as if you failed to consider what features were important to you and then properly research your phone purchase. While it's possible Apple may add other buttons to the phone in the future, there is no indication that current phones will ever be answerable any other way (the same is true of every Android phone I've used as well, by the way). So, you can either decide that the many other features that an iPhone has that your old LG didn't are worth this small inconvenience or you can return/sell the iPhone and go back to a phone with buttons. You can also try one of the several options for solving your problem that have been offered.

  • How to start, stop and restart task

    Hello Everyone,
    Need advice on what is the correct way to start, stop and restart a Java task?
    I have tried with Executors.newCachedThreadPool() or fixedThreadPool() however I was only able to submit the task once. My program crashed when i tried to resubmit the task again after a shutdownnow command()

    Tasks are designed to be run once. If you want restart functionality, use a service:
    http://docs.oracle.com/javafx/2/api/javafx/concurrent/Service.html
    The sample service I posted in the following thread demonstrates how to do this:
    Multithreading
    Use of Executors is not necessary as a Service encapsulates the execution thread management (though you can set your own executor on the service if you really needed it). All you need to do is make use of the service start, cancel, restart and reset methods as required. If you do use the cancel method, then you need to make sure that your service is properly interrupt aware for the cancel to function as you expect.

  • Manually start/stop cmsdk Agents

    Hi gurus,
    is there a way to start/stop those cmsdk's Agents without the need of Enterprise manager > node configuration ?
    My node configuration page in EM does not submit to the action correctly when i select a Agent and click on EDIT. It just goes up to the top of the page and do not
    show the EM's Edit Agent Configuration Page.
    Thanks in advance.

    Just a thought, but have you got JavaScript enabled?
    as far as I know, you can't start and stop agents without the Enterprise Manager.
    However, why are you clicking on 'Edit' when there are start / stop etc buttons at the top? Are you looking at the right page?

  • Foot Control to Start/Stop Recording??

    Does anyone know if Garageband can be remotely controlled to start and stop recording? Isn't there some sort of midi foot control pedal that allows this? If anyone has any experience with this, I'd love to hear!

    The iControl is a control surface that controls many things in GarageBand. However, I don't think it could be used for a remote control for punching in/out.
    I agree. We need some kind of remote start/stop "peddle" type controller. I just ordered the PowerMate from Griffin. I don't need 50' of cabling, just about 5' or so. Should be perfect for me. I dunno about setting it on the floor and stomping on it though

  • Scripts for starting/stopping managed servers

    All,
    Could someone provide me with some sample scripts for starting/stopping managed Weblogic servers?  I'm specifically looking for ways to start/stop them WITHOUT starting the AdminServer.  I'm running WLS 10.3.6 on Windows Server 2003, and I have NodeManager set to start automatically as a Windows service.
    I know how to set my managed servers up as Windows services so that they will start automatically at boot, but this requires the AdminServer to be running, which I do not want.  I just want a few scripts for starting/stopping the managed servers (and maybe some hints as to how to make them start automatically without starting the AdminServer).
    Thanks in advance,
    Tom

    Hello Puneet,
    Admin console is an web application deployed into AdminServer. Hence if you shutdown AdminServer then you wouldn't able to access Admin console.
    Managed Server would function in MSI mode, however you will not be able to make any configuration or administration activities like deployment , any configuration changes , etc.
    Hello PRISM,
    Can you confirm your requirement about why you don't want AdminServer to be running?
    As I said,  you will loose the administration capability if you don't have admin server running.
    Regards
    Rosario

  • ConnectException after a few times of start/stop

    I've made a serverUI where I want to start/stop my server. It works to start it, stop it and start it again. But when I then want to stop it I get a ConnectionException. Any ideas?
    Here's some code.. (I'm using 1.1.8)
    I do this once at startup:
    try
         Runtime.getRuntime().exec("rmiregistry");
    catch(Exception pException)
         System.out.println(pException);
         pException.printStackTrace();
    I do this to start the server:
    try
         Runtime.getRuntime().exec("java -classpath .;C:\\jdk1.1.8\\lib\\classes.zip;\\jdk1.1.8\\lib\\comm.jar -Djava.rmi.server.codebase=http://"+InetAddress.getLocalHost().getHostAddress()+":8080 -Djava.security.policy=policy bentrix.solarPower.server.SunControlImpl");
         mServer = (SunControl)Naming.lookup("//"+InetAddress.getLocalHost().getHostAddress()+"/SunControlServer");
    catch(Exception pException)
         System.out.println(pException);
         pException.printStackTrace();
    I do this to stop the server (with a delay and then System.exit in the server):
    try
         mServer.terminate();
    catch(Exception pException)
         System.out.println(pException);
         pException.printStackTrace();
    I end up with this exception... I've tried putting in delays but that didn't help. I've watched the processes and the first time mServer.terminate() really removes the server. And it works to start the server again. But when a new try to stop the server is made it fails! It does works to connect from the "real" client even now so nothing is wrong with the last start of the server.
    java.rmi.ConnectException: Connection refused to host: [212.214.64.210:4134]; nested exception is:
    java.net.ConnectException: Connection refused
    java.rmi.ConnectException: Connection refused to host: [212.214.64.210:4134]; nested exception is:
    java.net.ConnectException: Connection refused
    at sun.rmi.transport.tcp.TCPChannel.openSocket(TCPChannel.java:276)
    at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:143)
    at sun.rmi.transport.tcp.TCPChannel.newConnection(Compiled Code)
    at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:60)
    at bentrix.solarPower.server.SunControlImpl_Stub.terminate(SunControlImpl_Stub.java:845)
    at bentrix.solarPower.serverUi.SunControlServerUI.stopServer(Compiled Code)
    at bentrix.solarPower.serverUi.SunControlServerUI.actionPerformed(SunControlServerUI.java:211)
    at java.awt.Button.processActionEvent(Button.java:249)
    at java.awt.Button.processEvent(Button.java:222)
    at java.awt.Component.dispatchEventImpl(Compiled Code)
    at java.awt.Component.dispatchEvent(Compiled Code)
    at java.awt.EventDispatchThread.run(Compiled Code)
    Any better way to start/stop the server please let me know!

    Oops! I fixed this by doing Naming.unbind() in the server when I shut it down. But I still have to watch very careful in the task manager when I do the start/stop by pressing a button in the serverUI because if I do start before the server has been killed I get the same exception! Is there a good way to know that the process has terminated or do I just have to disable the button for a little while?

  • I am going to buy a macbook pro for grade 12, and I need to know wheather I should get a macbook pro or a macbook pro retina. If someone could tell me (in a very simple way) which one is,better for me and why, I would be ever so apprreciative.

    I am going to buy a macbook pro for grade 12, and I need to know wheather I should get a macbook pro or a macbook pro retina. If someone could tell me (in a very simple way) which one is,better for me and why, I would be ever so apprreciative.

    Why do you need a expensive MacBook Pro?
    Your attending high school and unless everyone else is rich also your likely going to be a target by the more poorer students for theft or damage to the machine.
    You could keep it home, but if you need it for class then your exposed again.
    Also at that age your not very careful yet, a MacBook Pro is a expensive and easily damaged machine.
    Unless your made of money and so are others at your school, I would recommned a low profile, just does the job cheap Windows PC.
    If it dies, gets lost, stolen or damaged because of your inexperince handling senstivie electronics then it's no big deal.
    You can buy a Mac later on when your sure you have a need for it, currently there isn't much advantage of owning a Mac compared to a PC, they do just about the same things now, one just looks prettier than the other.
    Since 95% of the world uses Windows PC's your going to have to install Windows on the Mac in order to keep your skills up there or be unemployed, so it's a extra headache and expense.
    good luck

  • I accidentally set up my new ipad in itunes under the name of my existing ipad and need to set it up as a new device. Help. I cannot find a way to start fresh.

    I accidentally set up my new ipad in itunes under the name of my existing ipad and need to set it up as a new device. Help. I cannot find a way to start fresh.

    That's probably not a good idea to try to share apps since you will have to switch ID's each time you update apps and sync apps from iTunes.
    And technically - according to Apple's terms - you cannot share apps using different ID's. You can actually lock yourself out of an ID for 90 days if you switch ID's and if you associate the iPad with another ID.
    The bold type is a copy and paste from the site that I referenced below.
    When you turn on iTunes Match or Automatic Downloads, or when you download past purchases on an iOS device or computer, that device or computer becomes associated with your Apple ID. This article describes how to manage these associations.
    http://support.apple.com/kb/ht4627

Maybe you are looking for

  • How to create a magnifying glass for image details

    hello, i am displaying an image with high resolution,so that the image on the screen has not the real resolution. to look at details i want to move the mousepointer over the image and in an area under the mousepointer there should appear the related

  • How can I get my add-ons to display in "about:addons," and stop add-on installation from hanging upon download?

    I use firefox 9.0, on Ubuntu 10.04 Lucid Lynx. The "uname --all" shell command yields the following output, redacted : Linux ************* 2.6.32-21-generic #32-Ubuntu SMP Fri Apr 16 08:10:02 UTC 2010 i686 GNU/Linux I recently did an update to versio

  • How do I delete a system file from Time Machine?

    After consulting this support document, I tried to delete a Safari cache file that was captured by Sophos's Quarantine Manager as containing a common phishing hook. But it's in Library and Time Machine can't locate it. The Library folder, as you know

  • How to sync PIN #s

    I am really surprised that there aren't more people with this problem...i cannot seem to get my pins to sync with the new DTM with address book on the mac...i couldn't with missing sync either and ended up just not synching at all which is a major dr

  • Multiple Artists for one so

    Hi all, Kapyrna here. I just bought a Zen Vision:M 30GB and I love it, for one exception: I have a lot of video game remixes and such that have more than one artist as filed in Windows Media Player (like this: [artist]; [artist2];...). I'm using ID3