The tail of VirtualBox and the rc
Well, I wanted to play with VirtualBox on Funtoo again.
Setup metro to create a custom stage3, added my stuff I use.
All went well, chrooted into the new install, did all the normal setup stuff.
Rebooted into the new install. all was fine in the world.
Adjusted my VM's to use VirtualBox, and even finally got OS X to work right virtualised.
Then the bullshit. How the fuck do you autostart vm's on boot.
Went down the google rabbit hole, all the info was based on other Distros or outdated info.
So I did what any self respecting person would do. I built a rc startup script.
Well (4) actually.
So here they are.
1) vbox.example - this is the /etc/conf.d file - set options there. rename file to the name of the service - vbox.myvm
2) vbox.tmpl - this is the rc script that goes in to /etc/init.d, then create symbolic link to the vm name, use like netif.tmpl
# ln -s /etc/init.d/vbox.tmpl /etc/init.d/vbox.myvm
3) vboxd.start - goes into the /etc/vboxd dir - starts the vm. The correct vm config is passed to the script by init script
4) vboxd.stop - goes into the /etc/vboxd dir - stops the vm. The correct vm config is passed to the script by init script
And that's it.
I can run as any user, VirtualBox segments the available vm's according to user, so a VM under ckurlinski will not show up under root.
Nice for some things, suck for writing a init script.
All VM's will run under created user, and can be set to start / stop with different parameters: headless , saved state.
Sends info to dmesg also.
The last thing I would like to do is create a portage package.... Not even sure where to start on that .....
Thanks for sharing.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!Register a new account
Already have an account? Sign in here.Sign In Now