Giter VIP home page Giter VIP logo

vagrant-linuxdesktop's Introduction

Vagrant's Linux Desktop Environment for Windows & Mac

By: Pablo Carranza | vDevices

This Project's Purpose

To provide a simple (while not the only) way for Windows & Mac users to launch a virtual machine ("VM") with a Linux Desktop environment – sandboxed on their local computer.

Contributing

Contributions are more than welcome:

If you are new to the wonderful world of git (version control) – and/or are uncomfortable with the command line – download GitHub for Windows or GitHub for Mac.

  1. Fork this repo. See Fork A Repo | GitHub Help.
  2. Create a branch (git checkout -b my_feature_branch).
  3. Commit your changes (git commit -am "Added a sweet feature").
  4. Push to the branch (git push origin my_feature_branch).
  5. Create a Pull Request from your branch into the master branch of this repo (please be sure to provide enough detail, so I can decipher your proposed changes). See Collaborating | GitHub Help.

Introduction

For many years, there were barriers surrounding the many unsatisfied Microsoft Windows users yearning for more and some Mac OS X users that developed an itch for tinkering with open-source tools. Namely, they did not have:

  • the cash-flow or desire to pick up a dedicated Linux box; or
  • the technical expertise to create a dual-boot environment – that is, a partition on their local hard drive from which to boot a Linux environment, side-by-side with Windows.
    • Besides, dual-boot environments carry the inconvenience of having to reboot your computer every time you want to work with the other OS (so much for multitasking!).

Well, ladies 'n gentlemen ... drum roll, please ...

Meet VirtualBox

VirtualBox is a cross-platform, open-source "virtualization product for enterprise as well as home use." VirtualBox is installed on an existing host operating system ("OS") – such as Windows or Mac OS X – as an application, i.e. a VM. While running as an application/VM on your computer, VirtualBox then allows a guest OS to be loaded and run, within its own virtual environment. Thus, VirtualBox can be used to run a virtual Linux computer inside your Mac or Windows PC, as opposed to next to it (such as in a dual-boot configuration).

To deploy a VM on one's computer, the user must first create a VM within VirtualBox and properly configure the slew of possible options. While this is really not as difficult as it sounds, the prospect can seem daunting to non-computer-geeks. Such unfortunates are in luck, however.

Meet Vagrant

Vagrant is also a cross-platform, open-source tool. After you install VirtualBox on your computer, Vagrant itself makes it so you do not need to deal with VirtualBox directly. Vagrant was created for software developers, so they could build and share computing environments with other developers. It works with virtualization software such as VirtualBox to provide a virtual machine (on your local Mac or Windows PC) that is sandboxed, or sectioned-off, from your local environment.

A Match Made in Heaven

Many users run a guest OS inside of VirtualBox without Vagrant. However,

  • Vagrant saves you the trouble of having to build a guest OS from scratch;
  • By simply downloading a pre-packaged virtual machine running a particular guest OS, named a vagrant box;
  • While supporting customization via the Vagrantfile. The primary function of the Vagrantfile is to describe the type of VM required for a project and how to configure and provision the machine.

Other possible VirtualBox configurations (although, outside the scope of this project) are:

  • Run a Windows 7, or Windows XP, VM on a Windows 8 machine;
  • Run Max OS X on Windows;
  • Run Windows programs and, consequently, the Windows OS, on a Mac;
  • And more!

How to Deploy

  1. Start with any operating system ("OS").

  2. Install the most recent release of VirtualBox, for your OS.

    Once VirtualBox is installed, also install the corresponding VirtualBox Extension Pack.

  3. Install the most recent release of Vagrant, for your OS.

    • vagrant will now be available as a command in your terminal or Windows Command Prompt.

      • Microsoft Windows users: Can open a command prompt by pressing (on the keyboard) the Windows key followed by the R key, which will open the Run dialog box, and typing:

          cmd
        

        and pressing Enter.

    • Note: If Vagrant is already installed, use vagrant -v to check the version. You may want to consider upgrading if a much older version is in use.

  4. Clone or extract the project's repository into a local directory, e.g.

    • git clone git://github.com/vDevices/Vagrant-LinuxDesktop.git vagrant-desktop
    • OR use GitHub for Windows or GitHub for Mac by clicking on the Clone in Desktop button
    • OR download and extract the repository master zip file
  5. Change into the new directory with cd vagrant-desktop

    The First vagrant up

  6. Start the Vagrant environment by executing the command: vagrant up

    • Be patient as the magic happens. This could take a while on the first run as your local machine downloads the required files & updates.

What Did That Do?

The first time you run vagrant up, a packaged box from the Ubuntu Cloud Images repository, containing a basic virtual machine, is downloaded to your local computer and cached for future use. The default Vagrantfile used by Vagrant's Linux Desktop Environment for Windows & Mac contains an installation of Ubuntu 12.04 LTS 32-bit.

After this box is downloaded, it begins to boot as a sandboxed virtual machine using VirtualBox. Once booted, it runs the included provisioning script, to install the Ubuntu desktop environment.

  • Note: Ubuntu's default desktop environment ("DE") is Unity. Feel free to modify the provisioning script (bootstrap.sh), if you would prefer a different DE, such as GNOME.

The time for all of this to happen depends a lot on the speed of your Internet connection. If you are on a fast cable connection, it will likely only take several minutes.

On future runs of vagrant up, the packaged box will be cached on your local machine and Vagrant will again apply the provisioning script, only if specifically requested.

  • Preferred: If the virtual machine has been powered off with vagrant halt, vagrant up will quickly power on the machine without provisioning.
  • Rare: If you would like to reapply the provisioning script with vagrant up --provision or vagrant provision, some time will be taken to check for updates and packages that have not been installed.
  • Very Rare: If the virtual machine has been destroyed with vagrant destroy, it will need to download the full package data on the next vagrant up.

How to Use

Now that you're up and running, start poking around and modifying things.

  1. Your Windows or Mac desktop should now be substituted by a full-screen Linux desktop environment. Log in with the username vagrant and password vagrant.
  2. You can also access the VM via the command line with the vagrant ssh command from your local Vagrant-LinuxDesktop directory. You can do almost anything you would do with a standard Ubuntu installation.
    • MS Windows users: An SSH client is generally not distributed with Windows PCs, by default. However, a terminal emulator such as PuTTY will provide access immediately. For detailed instructions on connecting with PuTTY, consult the Vagrant-LinuxDesktop wiki.
  3. Power off the VM with vagrant halt and turn it back on with vagrant up.
  4. Suspend the VM's state in memory with vagrant suspend and bring it right back with vagrant resume.
  5. Reapply provisioning to a running VM with vagrant provision.
  6. Destroy the VM and start from scratch with vagrant destroy.

Vagrant box

One concept to be mindful of is Vagrant's use of boxes. Vagrant uses .box files as templates from which to spin up a new VM. Instead of building a VM from scratch – which would be a slow and tedious process because you would first have to create a VM in VirtualBox and configure the proper settings – Vagrant uses a base, combined image of both a properly-configured VirtualBox VM with a guest OS already installed, to quickly clone a VM.

Such an individual base image is referred to as a box. Feel free to swap-out the URL in the config.vm.box_url directive of this project's Vagrantfile – that provides the default Ubuntu box – with the URL of either of the official Vagrant boxes:

or with a box URL from either of the following repositories hosting VM, or guest OS, images:

  • Ubuntu Cloud Images (pre-installed disk images that have been customized by Ubuntu engineering to run in the Vagrant local-virtualizaition environment).
  • Vagrantbox.es (a list of Vagrant boxes people have been nice enough to make publicly available).

Need Help?

Credits

A HUGE Thank You is in order to:

vagrant-linuxdesktop's People

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.