SlideShare a Scribd company logo
Building your own
Desktop Cloud Environment

Gautham Pai, Founder
jnaapti
The problems we face as developers
Our development environments accumulate lots of
applications and libraries over a period of months.

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

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

We forget that a multi-machine deployment is different
from 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 the
production environment as possible.

Replicable deployment - verify everything before
deploying to staging or production.

Containerising functionality.

"Don't panic" environment for experimentation

Ease of provisioning for new employees.


                     http://jnaapti.com/
Virtualization or Cloud?
What I am talking about is closer to virtualization than
cloud computing.

For example, we are not dealing with transparent
scaling, spike load handling etc.




                     http://jnaapti.com/
Why QEMU-KVM and not Virtualbox?
KVM is part of the Linux Kernel

Virtualbox is from Oracle

KVM provides better performance




                    http://jnaapti.com/
What we want to try out
Create a development environment with functionalities
partitioned over separate VMs.

Ensure that setting up this environment is not more
than a few hours job.

Ensure that bringing up the environment does not take
more than a few minutes if not seconds.

Ensure that the environment can run in a laptop with
standard 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 space

This will help us run as many as 5 VM images in parallel

                      http://jnaapti.com/
Demo




http://jnaapti.com/
The Approach
In this demo, I will take you through the steps to
create a multi-VM development environment

In addition to our dev environment (dev-server), we
will have a separate code-server, a web-server and a
db-server setup.

We then run it end-to-end – write some code, check it
in, pull it into the web server, deploy the code and
then test the new version of the app.

                     http://jnaapti.com/
First, a look at a few terminologies
QEMU is a generic and open source machine emulator
and virtualizer.

KVM (for Kernel-based Virtual Machine) is a full
virtualization solution for Linux on x86 hardware.

The Virtual Machine Manager application (virt-
manager for short package name) is a desktop user
interface for managing virtual machines.



                     http://jnaapti.com/
Demo




http://jnaapti.com/
The Approach
We first create a base VM and install the OS in it, using
the standard Ubuntu 10.04.2 Server ISO image

We then install a SSH server and setup passwordless
SSH access

We then clone this system to as many systems as we
need 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 Requirements
Every VM should have its own IP address.

Every VM should be accessible from every other VM
and 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 Installation
Login to the Base VM

Install the latest updates

Make sure you can connect to the host from guest and
vice-versa

Setup password-less SSH access

(Update interface identifier)



                     http://jnaapti.com/
Cloning the Base VM
Add the DNS server that we use for guest IP allocation
to resolv.conf, so that you can address VMs using their
hostnames

Use virt-clone to clone the base VM

Start the new VM

Change the hostname of the new VM

Reboot 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 destroy
dbserver && virsh destroy codeserver




                       http://jnaapti.com/
Where to go from here?
Setting up package mirrors

Snapshot creation on the fly

You can mimic things like S3, EBS etc




                     http://jnaapti.com/
Resources
More detailed notes here

Code is over at Github

KVM

Virtual Machine Manager

KVM Networking

QEMU Networking

QEMU Images

                    http://jnaapti.com/
Courtesy
 Server image from OpenClipArt

 CD image from pr0gr4mm3r.com



Thanks 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/

More Related Content

PPTX
Vagrant
PPTX
Vagrant
DOCX
Krenel Based Virtual Machine In Centos7
PDF
Vagrant + Docker provider [+Puppet]
KEY
PPTX
Vagrant + Docker
PDF
Vagrant for Virtualized Development
PDF
Introduction to Vagrant
Vagrant
Vagrant
Krenel Based Virtual Machine In Centos7
Vagrant + Docker provider [+Puppet]
Vagrant + Docker
Vagrant for Virtualized Development
Introduction to Vagrant

What's hot (20)

PDF
Puppet and Vagrant in development
PPTX
Docker workshop
PDF
Automated Amazon EC2 Cloud deployments with openQRM
ODT
openQRM how-to: Setup UEC and openQRM cloud
PDF
Vagrant for real
PDF
Vagrant for real (codemotion rome 2016)
PDF
Automated everything - Setting up an openQRM Cloud
PPTX
How To Set a Vagrant Development System
PPTX
Vagrant crash course
PDF
Create your very own Development Environment with Vagrant and Packer
PPTX
A Docker-based Development Environment Even I Can Understand
ODP
Building (localized) Vagrant boxes with Packer
ODP
Forget MAMP and WAMP, Use Virtual Box to Have a Real Ubuntu Server
PDF
Virtual Infrastructure
PPTX
6 Years of Docker: The Good, the Bad and Python Packaging at PyCon.DE&PyData ...
PDF
Dave Gilbert - KVM and QEMU
PDF
KVM tools and enterprise usage
PDF
Build a private cloud – prototype and test with open nebula
PDF
Vagrant for real codemotion (moar tips! ;-))
PPTX
Virtual Machine LAMP on Windows
Puppet and Vagrant in development
Docker workshop
Automated Amazon EC2 Cloud deployments with openQRM
openQRM how-to: Setup UEC and openQRM cloud
Vagrant for real
Vagrant for real (codemotion rome 2016)
Automated everything - Setting up an openQRM Cloud
How To Set a Vagrant Development System
Vagrant crash course
Create your very own Development Environment with Vagrant and Packer
A Docker-based Development Environment Even I Can Understand
Building (localized) Vagrant boxes with Packer
Forget MAMP and WAMP, Use Virtual Box to Have a Real Ubuntu Server
Virtual Infrastructure
6 Years of Docker: The Good, the Bad and Python Packaging at PyCon.DE&PyData ...
Dave Gilbert - KVM and QEMU
KVM tools and enterprise usage
Build a private cloud – prototype and test with open nebula
Vagrant for real codemotion (moar tips! ;-))
Virtual Machine LAMP on Windows
Ad

Similar to Building your own Desktop Cloud Environment (20)

PDF
High availability virtualization with proxmox
PDF
Aplura virtualization slides
PPTX
Virtualization, A Concept Implementation of Cloud
PPTX
Virtualization 101
PPTX
virtual-machine-ppt 18030 cloud computing.pptx
PDF
Rmll Virtualization As Is Tool 20090707 V1.0
PDF
RMLL / LSM 2009
PDF
How to Create a Windows Server 2008 Virtual Lab Using VirtualBox
KEY
Linux beginner's Workshop
PPTX
Virtualization-Presentation-with-History
ODP
A Xen Case Study
PDF
Oracle virtualbox basic to rac attack
PPT
Getting Started With Virtualization
PPTX
week 3 cloud computing northumbria foudation
PDF
An introduction into Oracle VM V3.x
PPTX
Cloud Computing Distributed-On-Demand Self-Service
PDF
Installation vm
PDF
Xen Virtualization 2008
PPTX
Virtual Machine
ODP
open source virtualization
High availability virtualization with proxmox
Aplura virtualization slides
Virtualization, A Concept Implementation of Cloud
Virtualization 101
virtual-machine-ppt 18030 cloud computing.pptx
Rmll Virtualization As Is Tool 20090707 V1.0
RMLL / LSM 2009
How to Create a Windows Server 2008 Virtual Lab Using VirtualBox
Linux beginner's Workshop
Virtualization-Presentation-with-History
A Xen Case Study
Oracle virtualbox basic to rac attack
Getting Started With Virtualization
week 3 cloud computing northumbria foudation
An introduction into Oracle VM V3.x
Cloud Computing Distributed-On-Demand Self-Service
Installation vm
Xen Virtualization 2008
Virtual Machine
open source virtualization
Ad

More from Jnaapti (7)

PDF
Jnaapti - Who we are and What we do
PDF
The Virtual Coach Platform - powered by jnaapti
PDF
Jnaapti Training Process
PDF
The Jnaapti Virtual Coach Platform
PDF
I AM STARTING UP - HOW DO I START CODING?
PDF
jnaapti's Pitch at Startup Saturday - Apr 12th 2014
PDF
Dealing with web scale data
Jnaapti - Who we are and What we do
The Virtual Coach Platform - powered by jnaapti
Jnaapti Training Process
The Jnaapti Virtual Coach Platform
I AM STARTING UP - HOW DO I START CODING?
jnaapti's Pitch at Startup Saturday - Apr 12th 2014
Dealing with web scale data

Recently uploaded (20)

PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
cuic standard and advanced reporting.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Electronic commerce courselecture one. Pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
Programs and apps: productivity, graphics, security and other tools
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Advanced methodologies resolving dimensionality complications for autism neur...
MIND Revenue Release Quarter 2 2025 Press Release
The Rise and Fall of 3GPP – Time for a Sabbatical?
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Building Integrated photovoltaic BIPV_UPV.pdf
Spectral efficient network and resource selection model in 5G networks
The AUB Centre for AI in Media Proposal.docx
NewMind AI Weekly Chronicles - August'25 Week I
cuic standard and advanced reporting.pdf
Chapter 3 Spatial Domain Image Processing.pdf
Electronic commerce courselecture one. Pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Programs and apps: productivity, graphics, security and other tools

Building your own Desktop Cloud Environment

  • 1. Building your own Desktop Cloud Environment Gautham Pai, Founder jnaapti
  • 2. The problems we face as developers Our development environments accumulate lots of applications and libraries over a period of months. We fear that we may screw up our development environment and that means unproductive man-hours. We are usually in the habit of installing everything in one machine. We forget that a multi-machine deployment is different from a single machine deployment. http://jnaapti.com/
  • 3. Solution? How about Desktop Virtualization? http://jnaapti.com/
  • 4. Why Desktop Virtualization? Bringing our development environment as close to the production environment as possible. Replicable deployment - verify everything before deploying to staging or production. Containerising functionality. "Don't panic" environment for experimentation Ease of provisioning for new employees. http://jnaapti.com/
  • 5. Virtualization or Cloud? What I am talking about is closer to virtualization than cloud computing. For example, we are not dealing with transparent scaling, spike load handling etc. http://jnaapti.com/
  • 6. Why QEMU-KVM and not Virtualbox? KVM is part of the Linux Kernel Virtualbox is from Oracle KVM provides better performance http://jnaapti.com/
  • 7. What we want to try out Create a development environment with functionalities partitioned over separate VMs. Ensure that setting up this environment is not more than a few hours job. Ensure that bringing up the environment does not take more than a few minutes if not seconds. Ensure that the environment can run in a laptop with standard configuration. http://jnaapti.com/
  • 8. 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 space This will help us run as many as 5 VM images in parallel http://jnaapti.com/
  • 10. The Approach In this demo, I will take you through the steps to create a multi-VM development environment In addition to our dev environment (dev-server), we will have a separate code-server, a web-server and a db-server setup. We then run it end-to-end – write some code, check it in, pull it into the web server, deploy the code and then test the new version of the app. http://jnaapti.com/
  • 11. First, a look at a few terminologies QEMU is a generic and open source machine emulator and virtualizer. KVM (for Kernel-based Virtual Machine) is a full virtualization solution for Linux on x86 hardware. The Virtual Machine Manager application (virt- manager for short package name) is a desktop user interface for managing virtual machines. http://jnaapti.com/
  • 13. The Approach We first create a base VM and install the OS in it, using the standard Ubuntu 10.04.2 Server ISO image We then install a SSH server and setup passwordless SSH access We then clone this system to as many systems as we need and setup various servers (code/caching/web/etc) on them http://jnaapti.com/
  • 14. Installing Pre-requisites $ sudo apt-get install virt-manager qemu-kvm http://jnaapti.com/
  • 15. Starting Virt Manager $ sudo virt-manager http://jnaapti.com/
  • 16. Networking Requirements Every VM should have its own IP address. Every VM should be accessible from every other VM and that includes host. Every VM must be able to connect to the Internet. Solution? Bridged Networking. http://jnaapti.com/
  • 17. Setting up the Bridge Network http://jnaapti.com/
  • 18. Name your Virtual Network http://jnaapti.com/
  • 19. Choose an IPv4 Address Space http://jnaapti.com/
  • 20. Select DHCP Range http://jnaapti.com/
  • 21. Setup NAT forwarding http://jnaapti.com/
  • 22. Review and finish the wizard http://jnaapti.com/
  • 23. Create the Base VM http://jnaapti.com/
  • 24. Choose the Distribution to Install http://jnaapti.com/
  • 25. Set RAM and CPUs http://jnaapti.com/
  • 26. Set the Disk Space http://jnaapti.com/
  • 27. Finalize the VM Creation http://jnaapti.com/
  • 28. Install the OS in the Base VM http://jnaapti.com/
  • 29. Select Hostname http://jnaapti.com/
  • 31. Confirm Disk Format http://jnaapti.com/
  • 32. Installation Progress http://jnaapti.com/
  • 33. Installation Progress http://jnaapti.com/
  • 35. Set Username http://jnaapti.com/
  • 36. Configure APT http://jnaapti.com/
  • 37. Set Automatic Upgrades http://jnaapti.com/
  • 38. Install Additional Software http://jnaapti.com/
  • 39. Install Pre-defined Collections http://jnaapti.com/
  • 40. Installation Progress http://jnaapti.com/
  • 41. Install GRUB http://jnaapti.com/
  • 42. Install GRUB http://jnaapti.com/
  • 43. Installation Complete http://jnaapti.com/
  • 44. Installation Complete http://jnaapti.com/
  • 45. Verifying the Base VM Installation Login to the Base VM Install the latest updates Make sure you can connect to the host from guest and vice-versa Setup password-less SSH access (Update interface identifier) http://jnaapti.com/
  • 46. Cloning the Base VM Add the DNS server that we use for guest IP allocation to resolv.conf, so that you can address VMs using their hostnames Use virt-clone to clone the base VM Start the new VM Change the hostname of the new VM Reboot the new VM http://jnaapti.com/
  • 47. Starting and Stopping the VMs $ #Start the domains $ virsh start webserver && virsh start dbserver && virsh start codeserver $ #Destroy the domains $ virsh destroy webserver && virsh destroy dbserver && virsh destroy codeserver http://jnaapti.com/
  • 48. Where to go from here? Setting up package mirrors Snapshot creation on the fly You can mimic things like S3, EBS etc http://jnaapti.com/
  • 49. Resources More detailed notes here Code is over at Github KVM Virtual Machine Manager KVM Networking QEMU Networking QEMU Images http://jnaapti.com/
  • 50. Courtesy Server image from OpenClipArt CD image from pr0gr4mm3r.com Thanks 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/
  • 51. The Jnaapti development environment is based on this setup http://jnaapti.com/
  • 52. This talk was first delivered in the “PHP Cloud” event organized by HasGeek http://jnaapti.com/
  • 53. Thank you! Email: gautham@jnaapti.com http://jnaapti.com/
  • 54. Happy Hacking http://jnaapti.com/