Giter VIP home page Giter VIP logo

vm's Introduction

VirtualBox bash helper scripts

First use:

cd
git clone https://github.com/hilbix/vm
cd vm
cp .vm.conf.dist .vm.conf
vi .vm.conf
./.setup

If my personal settings do not fit for you, fork the repo at GitHub and add a .vm.conf

You might consider to keep .vm.conf secret.

About:

Getting started with VirtualBox is easy. However if you use the virtualbox GUI often on your server you will notice that certain settings do not fit your needs, or are tedious to enter. Also you want to run your Guests headless usually.

To do this from commandline on the Host I do a checkout of this repo into $HOME/vm/. Note that I am used to set export LC_ALL=C in .bashrc such that all the dot-files are sorted on top of the directory, leaving the auxiliary files on bottom to easily view everything with ls.

There are 4 classes of files:

  • Auxiliary (Aux) files which are created and not managed with GIT.

  • Helpers which you won't call yourself, starting with .vm.. The configuration .vm.conf is a helper, too, which you can edit using vi or text editors.

  • Scripts, which will run without arguments.

  • Scripts, which require a list of VMs on the commandline.

The Aux files are named after the port number on which the VRDE server will run. In the Aux files the first line is the name of the VM. All remaining lines are not yet defined (later will contain settings).

Scripts without args:

./.setup Automatically setup everything, can be rerun if new VMs show up

./.list List all available VMs

./.port Re-assign port numbers from the accessory files

./.autostart Call .run with the VM name taken from the filename. Link this to your convenience script like ln -s ../vm/.autostart ~/autostart/"My VM Name" With http://www.scylla-charybdis.com/tool.php/ptybuffer you then can call ~/bin/autostart.sh to start the VMs on boot.

Scripts with VM arg:

The argument can be the VM name or the port number. Usually the port is quicker thanks to Bash file completion. (Is there a bash-completion for VirtualBox?)

./.desk VM Start rdesktop-vrdp for the given VM

./.run VM Start the VM in FOREGROUND in headless mode. This basically is thought for controlled shell usage, like sending out eMail when the VM crashes.

./.start VM Start the VM in BACKGROUND in headless mode. Afterwards you can call .desk

./.show VM .start and .desk combined

./.hide VM Kills background .desk processes for given VM (keeps the VM running)

./.fix VM Fix certain settings of a VM (according to .vm.conf)

Scripts with VM arg and confirmation:

./.cad VM Send a Ctrl-Alt-Del to the VM

./.stop VM Stop the VM. This is: Short press of the power button.

./.kill VM Poweroff the VM, unconditionally. This is: Long press of the power button.

Scripts with various args:

These commands show a short the Usage if called without arguments.

./.list h List all registered harddisk images

./.list m List all registered media files (including harddisk images)

./.list i List all virtual network interfaces. ./.list n is the same.

./.list o Overview of all ostypes

./.mk-hd-fixed SIZE:[PATH/]NAME... SIZE is in MB. Create harddisk images (VDI), which are completely preallocated. This is highly recommended on servers, such that the resulting VDI-files are "defragmented". Also I recommend to use EXT4 with it (however I did no speed tests yet). In the SIZE:NAME case the Disk created is /VM/$USER/NAME/NAME.vdi, else it is /VM/$USER/PATH/NAME.vdi or PATH/NAME.vdi, in case that PATH is relative or absolute (starting with ./, ../ or /).

./.mk-hd-dyn SIZE:[PATH/]NAME... Like ./.mk-hd-fixed, but instead creates an empty dynamically allocated VDI file. Note that all disks are registered with VirtualBox, so you can list them using ./.list h

vm's People

Contributors

hilbix avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.