• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Building your own Desktop Cloud Environment

Building your own Desktop Cloud Environment



As developers we have seen these problems: ...

As developers we have seen these problems:

Our development environments accumulate lots of applications and libraries over a period of months.

We are usually in the habit of installing everything in one machine.

We fear that we may screw up our development environment and that means unproductive man-hours.

We forget that a multi-machine deployment is different from a single machine deployment.

How about virtualization in the desktop?

In this demo, I will take you through the steps to create a multi-VM development environment.

This demo will make use of QEMU, KVM and Virt Manager and show you how you can create a VM image, and then start servers with a set of commands, deploy your app, test everything and tear down the environment once you are happy - all this in the cosy comforts of your laptop or desktop.

The Jnaapti development environment is based on this setup.



Total Views
Views on SlideShare
Embed Views



6 Embeds 297

http://jnaapti.com 261
http://localhost 21
http://www.linkedin.com 10
https://si0.twimg.com 2
https://www.linkedin.com 2
https://twitter.com 1



Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment

    Building your own Desktop Cloud Environment Building your own Desktop Cloud Environment Presentation Transcript

    • Building your ownDesktop Cloud EnvironmentGautham Pai, Founderjnaapti
    • The problems we face as developersOur development environments accumulate lots ofapplications and libraries over a period of months.We fear that we may screw up our developmentenvironment and that means unproductive man-hours.We are usually in the habit of installing everything inone machine.We forget that a multi-machine deployment is differentfrom a single machine deployment. http://jnaapti.com/
    • Solution?How about Desktop Virtualization? http://jnaapti.com/
    • Why Desktop Virtualization?Bringing our development environment as close to theproduction environment as possible.Replicable deployment - verify everything beforedeploying to staging or production.Containerising functionality."Dont panic" environment for experimentationEase of provisioning for new employees. http://jnaapti.com/
    • Virtualization or Cloud?What I am talking about is closer to virtualization thancloud computing.For example, we are not dealing with transparentscaling, spike load handling etc. http://jnaapti.com/
    • Why QEMU-KVM and not Virtualbox?KVM is part of the Linux KernelVirtualbox is from OracleKVM provides better performance http://jnaapti.com/
    • What we want to try outCreate a development environment with functionalitiespartitioned over separate VMs.Ensure that setting up this environment is not morethan a few hours job.Ensure that bringing up the environment does not takemore than a few minutes if not seconds.Ensure that the environment can run in a laptop withstandard configuration. http://jnaapti.com/
    • System Requirements A laptop/desktop with a processor that supports virtulization technology to use KVM a Debian Linux environment atleast 2GB of free RAM atleast 10G of free disk spaceThis will help us run as many as 5 VM images in parallel http://jnaapti.com/
    • Demohttp://jnaapti.com/
    • The ApproachIn this demo, I will take you through the steps tocreate a multi-VM development environmentIn addition to our dev environment (dev-server), wewill have a separate code-server, a web-server and adb-server setup.We then run it end-to-end – write some code, check itin, pull it into the web server, deploy the code andthen test the new version of the app. http://jnaapti.com/
    • First, a look at a few terminologiesQEMU is a generic and open source machine emulatorand virtualizer.KVM (for Kernel-based Virtual Machine) is a fullvirtualization solution for Linux on x86 hardware.The Virtual Machine Manager application (virt-manager for short package name) is a desktop userinterface for managing virtual machines. http://jnaapti.com/
    • Demohttp://jnaapti.com/
    • The ApproachWe first create a base VM and install the OS in it, usingthe standard Ubuntu 10.04.2 Server ISO imageWe then install a SSH server and setup passwordlessSSH accessWe then clone this system to as many systems as weneed and setup various servers(code/caching/web/etc) on them http://jnaapti.com/
    • Installing Pre-requisites$ sudo apt-get install virt-manager qemu-kvm http://jnaapti.com/
    • Starting Virt Manager$ sudo virt-manager http://jnaapti.com/
    • Networking RequirementsEvery VM should have its own IP address.Every VM should be accessible from every other VMand that includes host.Every VM must be able to connect to the Internet.Solution? Bridged Networking. http://jnaapti.com/
    • Setting up the Bridge Network http://jnaapti.com/
    • Name your Virtual Network http://jnaapti.com/
    • Choose an IPv4 Address Space http://jnaapti.com/
    • Select DHCP Range http://jnaapti.com/
    • Setup NAT forwarding http://jnaapti.com/
    • Review and finish the wizard http://jnaapti.com/
    • Create the Base VM http://jnaapti.com/
    • Choose the Distribution to Install http://jnaapti.com/
    • Set RAM and CPUs http://jnaapti.com/
    • Set the Disk Space http://jnaapti.com/
    • Finalize the VM Creation http://jnaapti.com/
    • Install the OS in the Base VM http://jnaapti.com/
    • Select Hostname http://jnaapti.com/
    • Select Disk http://jnaapti.com/
    • Confirm Disk Format http://jnaapti.com/
    • Installation Progress http://jnaapti.com/
    • Installation Progress http://jnaapti.com/
    • Create User http://jnaapti.com/
    • Set Username http://jnaapti.com/
    • Configure APT http://jnaapti.com/
    • Set Automatic Upgrades http://jnaapti.com/
    • Install Additional Software http://jnaapti.com/
    • Install Pre-defined Collections http://jnaapti.com/
    • Installation Progress http://jnaapti.com/
    • Install GRUB http://jnaapti.com/
    • Install GRUB http://jnaapti.com/
    • Installation Complete http://jnaapti.com/
    • Installation Complete http://jnaapti.com/
    • Verifying the Base VM InstallationLogin to the Base VMInstall the latest updatesMake sure you can connect to the host from guest andvice-versaSetup password-less SSH access(Update interface identifier) http://jnaapti.com/
    • Cloning the Base VMAdd the DNS server that we use for guest IP allocationto resolv.conf, so that you can address VMs using theirhostnamesUse virt-clone to clone the base VMStart the new VMChange the hostname of the new VMReboot the new VM http://jnaapti.com/
    • Starting and Stopping the VMs$ #Start the domains$ virsh start webserver && virsh start dbserver &&virsh start codeserver$ #Destroy the domains$ virsh destroy webserver && virsh destroydbserver && virsh destroy codeserver http://jnaapti.com/
    • Where to go from here?Setting up package mirrorsSnapshot creation on the flyYou can mimic things like S3, EBS etc http://jnaapti.com/
    • ResourcesMore detailed notes hereCode is over at GithubKVMVirtual Machine ManagerKVM NetworkingQEMU NetworkingQEMU Images http://jnaapti.com/
    • Courtesy Server image from OpenClipArt CD image from pr0gr4mm3r.comThanks to Pradeep Kumar, Ananth M, Kiran S, Ananda M,Madhukar Pai and Shrinivas S Kulkarni for reviewing the slides and providing valuable feedback http://jnaapti.com/
    • The Jnaapti development environment is based on this setup http://jnaapti.com/
    • This talk was first delivered in the “PHP Cloud” event organized by HasGeek http://jnaapti.com/
    • Thank you!Email: gautham@jnaapti.com http://jnaapti.com/
    • Happy Hacking http://jnaapti.com/