Page 1 of 6 123 ... LastLast
Results 1 to 10 of 60

Thread: VBox as a service in Lucid

  1. #1
    Join Date
    Dec 2007
    Location
    The last place I look
    Beans
    Hidden!
    Distro
    Ubuntu 10.04 Lucid Lynx

    VBox as a service in Lucid

    I have an ubuntu Desktop server that I run semi-headless and connect to remotely. upon it I have a Virtual box instance, running an ubuntu server edition server (rsyslogd server).
    When I reboot I have to login to the box over freenx to start the log server (and to shut it down prior to shutdown).

    I would like to run the logserver instance as a service, and I have investigated several init.d scripts to integrate it, but none of them have worked right for me. I notice that this topic has changed a great deal over the years.

    Can anyone point me to an autostart tutorial/script for VBox VMs that is sure to work with lucid x64 hosts?

    Thanks
    Things are rarely just crazy enough to work, but they're frequently just crazy enough to fail hilariously.

  2. #2
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: VBox as a service in Lucid

    Hi,

    Have you checked my startup/shutdown script here?

    I have it set to run a loop, but if you are starting just one VM, you can modify the script to do that instead.
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  3. #3
    Join Date
    Dec 2007
    Location
    The last place I look
    Beans
    Hidden!
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: VBox as a service in Lucid

    Quote Originally Posted by CharlesA View Post
    Hi,

    Have you checked my startup/shutdown script here?

    I have it set to run a loop, but if you are starting just one VM, you can modify the script to do that instead.
    Rock On! I'll give em a try!
    Things are rarely just crazy enough to work, but they're frequently just crazy enough to fail hilariously.

  4. #4
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: VBox as a service in Lucid

    Let me know if you run into any problems. I tested it on my Lucid box with VBox 4 without any problems, but nothing is perfect.
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  5. #5
    Join Date
    Dec 2007
    Location
    The last place I look
    Beans
    Hidden!
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: VBox as a service in Lucid

    ok, almost there methinks.

    on start the script exits with:
    Code:
    Host:/$ sudo service vmboot start
    No Saved VMs to start!
    Host:/$ sudo service vmboot status
    No VMs Currently Running!
    so I started going after the vboxmanage list calls:
    Code:
    Host:/$ vboxmanage list vms | sed -e 's/^".*".*{\(.*\)}/\1/'
    b1f339e8-6351-45fb-9edd-5c8A84d346cf
    Host:/$ v=`vboxmanage list vms | sed -e 's/^".*".*{\(.*\)}/\1/'`; vboxmanage showvminfo $v | grep saved
    Host:/$ v=`vboxmanage list vms | sed -e 's/^".*".*{\(.*\)}/\1/'`; vboxmanage showvminfo $v
    Name:            LogServer_Lucid32
    Guest OS:        Ubuntu
    UUID:            b1f339e8-6351-45fb-9edd-5c81b4d346cf
    <snip />
    I removed the grep and:
    Code:
    Host:/$ sudo service vmboot start
    Waiting for VM "LogServer_Lucid32" to power on...
    VM "LogServer_Lucid32" has been successfully started.
    so is there any danger to this mod? it seems reasonable, but...

    Thanks for your help Charles,
    Franklin
    Last edited by doas777; September 16th, 2011 at 05:00 AM.
    Things are rarely just crazy enough to work, but they're frequently just crazy enough to fail hilariously.

  6. #6
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: VBox as a service in Lucid

    Nah no danger. The script was designed to start any vm that was in a saved state, which is why it runs grep.

    Were you trying to start a vm from a powered off state?

    Also, how were you able to get it to run via service? I recall trying that and it not working.
    Last edited by CharlesA; September 16th, 2011 at 02:28 PM.
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  7. #7
    Join Date
    Dec 2007
    Location
    The last place I look
    Beans
    Hidden!
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: VBox as a service in Lucid

    yeah, I shut down teh vm before I started playing around with services, just to be on the safe side.

    as for installing as a service, I used a varient of your update-rc.d:
    Code:
    sudo chmod 755 /etc/init.d/vmboot
    sudo update-rc.d vmboot defaults 99 01
    worked like a charm!

    Thanks sir! I'm going to try the shutdown side of it tonight; I'll let you know how it works out.
    Things are rarely just crazy enough to work, but they're frequently just crazy enough to fail hilariously.

  8. #8
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: VBox as a service in Lucid

    Quote Originally Posted by doas777 View Post
    yeah, I shut down teh vm before I started playing around with services, just to be on the safe side.

    as for installing as a service, I used a varient of your update-rc.d:
    Code:
    sudo chmod 755 /etc/init.d/vmboot
    sudo update-rc.d vmboot defaults 99 01
    worked like a charm!

    Thanks sir! I'm going to try the shutdown side of it tonight; I'll let you know how it works out.
    Thanks for that. I'll try it on my lucid box and see what happens.

    As a sidenote: What does the 99 01 do at the end?

    EDIT: service worked. Nice - no more typing /etc/init.d/blahblah.
    Last edited by CharlesA; September 16th, 2011 at 04:49 PM.
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  9. #9
    Join Date
    Dec 2007
    Location
    The last place I look
    Beans
    Hidden!
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: VBox as a service in Lucid

    appearently the numbers set the order in which it will he started and killed. from what I understand 99 indicates that it is the last thing to load, and 01 indicates that it is the first thing to unload.

    I remember in the old days, you had to put numbers in front of your init scripts names to control the order in which they execute within each runlevel, but I havent had to do that in like 5 years. I think it changed with upstart, but i am no expert with services. I just found those params while googling around last night, trying to get some of the failed scripts to work.
    Things are rarely just crazy enough to work, but they're frequently just crazy enough to fail hilariously.

  10. #10
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: VBox as a service in Lucid

    Ah gotcha. Thanks. I just used the defaults and it seemed to work fine for me. If I coded the thing right, it would wait until vboxdrv was loaded before running on boot, but I'm kinda new to the whole init script stuff.
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

Page 1 of 6 123 ... LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •