diff --git a/_layouts/documentation.html b/_layouts/documentation.html index 482bf24cd..2357f5daa 100644 --- a/_layouts/documentation.html +++ b/_layouts/documentation.html @@ -14,6 +14,7 @@
  • Boxes
  • Base Boxes
  • +
  • Systems
  • Rake Integration
  • diff --git a/docs/systems.md b/docs/systems.md new file mode 100644 index 000000000..3e7c5778a --- /dev/null +++ b/docs/systems.md @@ -0,0 +1,56 @@ +--- +layout: documentation +title: Documentation - Systems +--- +# Systems + +Systems are an abstraction within Vagrant which describe how various operating system specific +tasks are to be run. Systems abstract away tasks such as shutting down, mounting folders, etc. +since some operating systems handle this slightly different. This opens the door to supporting +more than unix-like systems. + +
    +

    This topic is for advanced users

    +

    + The following topic is for advanced users. The majority of Vagrant users + will never have to do this. Therefore, only continue if you want to support a non-linux + based operating system. +

    +
    + +## System Tasks + +The following is a list of tasks which are delegated to system classes: + +* **Halting** - Shutting down the machine gracefully +* **Mounting Shared Folders** - Creating, mounting, and setting up the permissions + for shared folders. + +This list will surely grow as Vagrant grows. For now, to implement a custom operating +system implementation, only the above two features need to be implemented. + +## Creating a New System Implementer + +Creating a new system implementer is quite simple: Inherit from `Vagrant::Systems::Base` +and implement the stubbed method on that class. Instead of going over each method here, +I'll point you to the [base source file](http://github.com/mitchellh/vagrant/blob/master/lib/vagrant/systems/base.rb) +which is thoroughly commented to explain each method. + +## Using a New System Implementer + +The new system implementer should be specified as the `config.vm.system` configuration +value. By default, this is `:linux`. A symbol represents a built-in system type. For +your custom types, you should set the value as the class name for your new implementer. +Below is a sample Vagrantfile which does just this: + +{% highlight ruby %} +# An example system: +require 'bsd_system' + +Vagrant::Config.run do |config| + # Set the system to the proper class name: + config.vm.system = BSDSystem +end +{% endhighlight %} + +The configured Vagrant environment will then use the custom system implementation. \ No newline at end of file