Jump to content





Photo

The tail of VirtualBox and the rc

Posted by Chris Kurlinski , 16 October 2015 · 1865 views

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.
Fuck!!!!

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.

Attached Files






Photo
Chris Kurlinski
Oct 16 2015 04:57 PM

Update :

Just created a git repo.

 

https://github.com/ckurlinski/vm.d

 

Also realised that I can do other VM formats, kvm xen qemu.

  • Report

April 2017

S M T W T F S
      1
2345678
9101112131415
16171819202122
232425 26 272829
30      

Recent Entries

Recent Comments