Building your own Desktop Cloud Environment

Jnaapti
JnaaptiJnaapti
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/
1 of 54

Recommended

Vagrant by
Vagrant Vagrant
Vagrant Akshay Siwal
702 views27 slides
Vagrant by
VagrantVagrant
VagrantEvans Ye
2.3K views23 slides
Krenel Based Virtual Machine In Centos7 by
Krenel Based Virtual Machine In Centos7Krenel Based Virtual Machine In Centos7
Krenel Based Virtual Machine In Centos7a_ratra
112 views14 slides
Vagrant + Docker provider [+Puppet] by
Vagrant + Docker provider [+Puppet]Vagrant + Docker provider [+Puppet]
Vagrant + Docker provider [+Puppet]Nicolas Poggi
17.1K views29 slides
Vagrant by
VagrantVagrant
VagrantMichael Peacock
2K views114 slides
Vagrant + Docker by
Vagrant + DockerVagrant + Docker
Vagrant + DockerDavid Giordano
7.7K views18 slides

More Related Content

What's hot

Puppet and Vagrant in development by
Puppet and Vagrant in developmentPuppet and Vagrant in development
Puppet and Vagrant in developmentAdam Culp
6.8K views29 slides
Docker workshop by
Docker workshopDocker workshop
Docker workshopEvans Ye
2K views66 slides
Automated Amazon EC2 Cloud deployments with openQRM by
Automated Amazon EC2 Cloud deployments with openQRMAutomated Amazon EC2 Cloud deployments with openQRM
Automated Amazon EC2 Cloud deployments with openQRMopenQRM Enterprise GmbH
2.7K views27 slides
openQRM how-to: Setup UEC and openQRM cloud by
openQRM how-to: Setup UEC and openQRM cloudopenQRM how-to: Setup UEC and openQRM cloud
openQRM how-to: Setup UEC and openQRM cloudopenQRM Enterprise GmbH
1.8K views83 slides
Vagrant for real by
Vagrant for realVagrant for real
Vagrant for realMichele Orselli
1.6K views81 slides
Vagrant for real (codemotion rome 2016) by
Vagrant for real (codemotion rome 2016)Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)Michele Orselli
43.9K views99 slides

What's hot(20)

Puppet and Vagrant in development by Adam Culp
Puppet and Vagrant in developmentPuppet and Vagrant in development
Puppet and Vagrant in development
Adam Culp6.8K views
Docker workshop by Evans Ye
Docker workshopDocker workshop
Docker workshop
Evans Ye2K views
Vagrant for real (codemotion rome 2016) by Michele Orselli
Vagrant for real (codemotion rome 2016)Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)
Michele Orselli43.9K views
How To Set a Vagrant Development System by Paul Bearne
How To Set a Vagrant Development SystemHow To Set a Vagrant Development System
How To Set a Vagrant Development System
Paul Bearne17.8K views
Create your very own Development Environment with Vagrant and Packer by frastel
Create your very own Development Environment with Vagrant and PackerCreate your very own Development Environment with Vagrant and Packer
Create your very own Development Environment with Vagrant and Packer
frastel3.6K views
A Docker-based Development Environment Even I Can Understand by Jeremy Gimbel
A Docker-based Development Environment Even I Can UnderstandA Docker-based Development Environment Even I Can Understand
A Docker-based Development Environment Even I Can Understand
Jeremy Gimbel203 views
Forget MAMP and WAMP, Use Virtual Box to Have a Real Ubuntu Server by aaroncouch
Forget MAMP and WAMP, Use Virtual Box to Have a Real Ubuntu ServerForget MAMP and WAMP, Use Virtual Box to Have a Real Ubuntu Server
Forget MAMP and WAMP, Use Virtual Box to Have a Real Ubuntu Server
aaroncouch4.6K views
6 Years of Docker: The Good, the Bad and Python Packaging at PyCon.DE&PyData ... by Sebastian Neubauer
6 Years of Docker: The Good, the Bad and Python Packaging at PyCon.DE&PyData ...6 Years of Docker: The Good, the Bad and Python Packaging at PyCon.DE&PyData ...
6 Years of Docker: The Good, the Bad and Python Packaging at PyCon.DE&PyData ...
Sebastian Neubauer453 views
Dave Gilbert - KVM and QEMU by Danny Abukalam
Dave Gilbert - KVM and QEMUDave Gilbert - KVM and QEMU
Dave Gilbert - KVM and QEMU
Danny Abukalam1.2K views
KVM tools and enterprise usage by vincentvdk
KVM tools and enterprise usageKVM tools and enterprise usage
KVM tools and enterprise usage
vincentvdk5K views
Build a private cloud – prototype and test with open nebula by A B M Moniruzzaman
Build a private cloud – prototype and test with open nebulaBuild a private cloud – prototype and test with open nebula
Build a private cloud – prototype and test with open nebula
A B M Moniruzzaman5.5K views
Vagrant for real codemotion (moar tips! ;-)) by Michele Orselli
Vagrant for real codemotion (moar tips! ;-))Vagrant for real codemotion (moar tips! ;-))
Vagrant for real codemotion (moar tips! ;-))
Michele Orselli1K views
Virtual Machine LAMP on Windows by mikehie
Virtual Machine LAMP on WindowsVirtual Machine LAMP on Windows
Virtual Machine LAMP on Windows
mikehie628 views

Similar to Building your own Desktop Cloud Environment

Tech X Virtualization Tips by
Tech X Virtualization TipsTech X Virtualization Tips
Tech X Virtualization TipsYoussef EL HADJ
602 views57 slides
Virtualization technology "comparison vmware 9 vs virtualbox 4.2" by
Virtualization  technology "comparison vmware 9 vs virtualbox 4.2"Virtualization  technology "comparison vmware 9 vs virtualbox 4.2"
Virtualization technology "comparison vmware 9 vs virtualbox 4.2"Lagendary Sheeva
938 views69 slides
Ws80 using VMware by
Ws80 using VMwareWs80 using VMware
Ws80 using VMwareUmesh Gupta
61 views198 slides
Vagrant Up in 5 Easy Steps by
Vagrant Up in 5 Easy StepsVagrant Up in 5 Easy Steps
Vagrant Up in 5 Easy StepsTrevor Roberts Jr.
2.4K views15 slides
Vagrant by
VagrantVagrant
VagrantProfessionalVMware
6.9K views15 slides
Virtualization using VMWare Workstation by
Virtualization using VMWare WorkstationVirtualization using VMWare Workstation
Virtualization using VMWare WorkstationHitesh Gupta
4.9K views44 slides

Similar to Building your own Desktop Cloud Environment(20)

Virtualization technology "comparison vmware 9 vs virtualbox 4.2" by Lagendary Sheeva
Virtualization  technology "comparison vmware 9 vs virtualbox 4.2"Virtualization  technology "comparison vmware 9 vs virtualbox 4.2"
Virtualization technology "comparison vmware 9 vs virtualbox 4.2"
Lagendary Sheeva938 views
Virtualization using VMWare Workstation by Hitesh Gupta
Virtualization using VMWare WorkstationVirtualization using VMWare Workstation
Virtualization using VMWare Workstation
Hitesh Gupta4.9K views
Sdwest2008 V101 F Dpowerpoint Final by Stephen Rose
Sdwest2008 V101 F Dpowerpoint FinalSdwest2008 V101 F Dpowerpoint Final
Sdwest2008 V101 F Dpowerpoint Final
Stephen Rose493 views
Practical Introduction To Linux by Zeeshan Rizvi
Practical Introduction To LinuxPractical Introduction To Linux
Practical Introduction To Linux
Zeeshan Rizvi365 views
DevOps Camp 2017 NYC Local Development using Vagrant by Anthony Alvarez by Anthony Alvarez
DevOps Camp 2017 NYC Local Development using Vagrant by Anthony AlvarezDevOps Camp 2017 NYC Local Development using Vagrant by Anthony Alvarez
DevOps Camp 2017 NYC Local Development using Vagrant by Anthony Alvarez
Anthony Alvarez59 views
Vagrant - Version control your dev environment by bocribbz
Vagrant - Version control your dev environmentVagrant - Version control your dev environment
Vagrant - Version control your dev environment
bocribbz3.7K views
Managing VMware with PowerShell - VMworld 2008 by Carter Shanklin
Managing VMware with PowerShell - VMworld 2008Managing VMware with PowerShell - VMworld 2008
Managing VMware with PowerShell - VMworld 2008
Carter Shanklin1.4K views
Rohit yadav cloud stack internals by ShapeBlue
Rohit yadav   cloud stack internalsRohit yadav   cloud stack internals
Rohit yadav cloud stack internals
ShapeBlue1.3K views
VM201 - IdoSphere by Carl Tyler
VM201 - IdoSphereVM201 - IdoSphere
VM201 - IdoSphere
Carl Tyler681 views
Storage and hyper v - the choices you can make and the things you need to kno... by Louis Göhl
Storage and hyper v - the choices you can make and the things you need to kno...Storage and hyper v - the choices you can make and the things you need to kno...
Storage and hyper v - the choices you can make and the things you need to kno...
Louis Göhl2.4K views

More from Jnaapti

Jnaapti - Who we are and What we do by
Jnaapti - Who we are and What we doJnaapti - Who we are and What we do
Jnaapti - Who we are and What we doJnaapti
187 views12 slides
The Virtual Coach Platform - powered by jnaapti by
The Virtual Coach Platform - powered by jnaaptiThe Virtual Coach Platform - powered by jnaapti
The Virtual Coach Platform - powered by jnaaptiJnaapti
329 views23 slides
Jnaapti Training Process by
Jnaapti Training ProcessJnaapti Training Process
Jnaapti Training ProcessJnaapti
271 views10 slides
The Jnaapti Virtual Coach Platform by
The Jnaapti Virtual Coach PlatformThe Jnaapti Virtual Coach Platform
The Jnaapti Virtual Coach PlatformJnaapti
379 views12 slides
I AM STARTING UP - HOW DO I START CODING? by
I AM STARTING UP - HOW DO I START CODING?I AM STARTING UP - HOW DO I START CODING?
I AM STARTING UP - HOW DO I START CODING?Jnaapti
1.7K views51 slides
jnaapti's Pitch at Startup Saturday - Apr 12th 2014 by
jnaapti's Pitch at Startup Saturday - Apr 12th 2014jnaapti's Pitch at Startup Saturday - Apr 12th 2014
jnaapti's Pitch at Startup Saturday - Apr 12th 2014Jnaapti
975 views29 slides

More from Jnaapti(7)

Jnaapti - Who we are and What we do by Jnaapti
Jnaapti - Who we are and What we doJnaapti - Who we are and What we do
Jnaapti - Who we are and What we do
Jnaapti187 views
The Virtual Coach Platform - powered by jnaapti by Jnaapti
The Virtual Coach Platform - powered by jnaaptiThe Virtual Coach Platform - powered by jnaapti
The Virtual Coach Platform - powered by jnaapti
Jnaapti329 views
Jnaapti Training Process by Jnaapti
Jnaapti Training ProcessJnaapti Training Process
Jnaapti Training Process
Jnaapti271 views
The Jnaapti Virtual Coach Platform by Jnaapti
The Jnaapti Virtual Coach PlatformThe Jnaapti Virtual Coach Platform
The Jnaapti Virtual Coach Platform
Jnaapti379 views
I AM STARTING UP - HOW DO I START CODING? by Jnaapti
I AM STARTING UP - HOW DO I START CODING?I AM STARTING UP - HOW DO I START CODING?
I AM STARTING UP - HOW DO I START CODING?
Jnaapti1.7K views
jnaapti's Pitch at Startup Saturday - Apr 12th 2014 by Jnaapti
jnaapti's Pitch at Startup Saturday - Apr 12th 2014jnaapti's Pitch at Startup Saturday - Apr 12th 2014
jnaapti's Pitch at Startup Saturday - Apr 12th 2014
Jnaapti975 views
Dealing with web scale data by Jnaapti
Dealing with web scale dataDealing with web scale data
Dealing with web scale data
Jnaapti3K views

Recently uploaded

Redefining the book supply chain: A glimpse into the future - Tech Forum 2023 by
Redefining the book supply chain: A glimpse into the future - Tech Forum 2023Redefining the book supply chain: A glimpse into the future - Tech Forum 2023
Redefining the book supply chain: A glimpse into the future - Tech Forum 2023BookNet Canada
44 views19 slides
Evaluation of Quality of Experience of ABR Schemes in Gaming Stream by
Evaluation of Quality of Experience of ABR Schemes in Gaming StreamEvaluation of Quality of Experience of ABR Schemes in Gaming Stream
Evaluation of Quality of Experience of ABR Schemes in Gaming StreamAlpen-Adria-Universität
38 views34 slides
Why and How CloudStack at weSystems - Stephan Bienek - weSystems by
Why and How CloudStack at weSystems - Stephan Bienek - weSystemsWhy and How CloudStack at weSystems - Stephan Bienek - weSystems
Why and How CloudStack at weSystems - Stephan Bienek - weSystemsShapeBlue
247 views13 slides
Qualifying SaaS, IaaS.pptx by
Qualifying SaaS, IaaS.pptxQualifying SaaS, IaaS.pptx
Qualifying SaaS, IaaS.pptxSachin Bhandari
1.1K views8 slides
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ... by
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...Jasper Oosterveld
35 views49 slides
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha... by
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...ShapeBlue
183 views18 slides

Recently uploaded(20)

Redefining the book supply chain: A glimpse into the future - Tech Forum 2023 by BookNet Canada
Redefining the book supply chain: A glimpse into the future - Tech Forum 2023Redefining the book supply chain: A glimpse into the future - Tech Forum 2023
Redefining the book supply chain: A glimpse into the future - Tech Forum 2023
BookNet Canada44 views
Why and How CloudStack at weSystems - Stephan Bienek - weSystems by ShapeBlue
Why and How CloudStack at weSystems - Stephan Bienek - weSystemsWhy and How CloudStack at weSystems - Stephan Bienek - weSystems
Why and How CloudStack at weSystems - Stephan Bienek - weSystems
ShapeBlue247 views
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ... by Jasper Oosterveld
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha... by ShapeBlue
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...
ShapeBlue183 views
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit... by ShapeBlue
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...
ShapeBlue162 views
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT by ShapeBlue
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBITUpdates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT
ShapeBlue208 views
Optimizing Communication to Optimize Human Behavior - LCBM by Yaman Kumar
Optimizing Communication to Optimize Human Behavior - LCBMOptimizing Communication to Optimize Human Behavior - LCBM
Optimizing Communication to Optimize Human Behavior - LCBM
Yaman Kumar38 views
State of the Union - Rohit Yadav - Apache CloudStack by ShapeBlue
State of the Union - Rohit Yadav - Apache CloudStackState of the Union - Rohit Yadav - Apache CloudStack
State of the Union - Rohit Yadav - Apache CloudStack
ShapeBlue303 views
Business Analyst Series 2023 - Week 4 Session 7 by DianaGray10
Business Analyst Series 2023 -  Week 4 Session 7Business Analyst Series 2023 -  Week 4 Session 7
Business Analyst Series 2023 - Week 4 Session 7
DianaGray10146 views
"Running students' code in isolation. The hard way", Yurii Holiuk by Fwdays
"Running students' code in isolation. The hard way", Yurii Holiuk "Running students' code in isolation. The hard way", Yurii Holiuk
"Running students' code in isolation. The hard way", Yurii Holiuk
Fwdays36 views
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or... by ShapeBlue
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...
ShapeBlue199 views
Business Analyst Series 2023 - Week 4 Session 8 by DianaGray10
Business Analyst Series 2023 -  Week 4 Session 8Business Analyst Series 2023 -  Week 4 Session 8
Business Analyst Series 2023 - Week 4 Session 8
DianaGray10145 views
KVM Security Groups Under the Hood - Wido den Hollander - Your.Online by ShapeBlue
KVM Security Groups Under the Hood - Wido den Hollander - Your.OnlineKVM Security Groups Under the Hood - Wido den Hollander - Your.Online
KVM Security Groups Under the Hood - Wido den Hollander - Your.Online
ShapeBlue225 views
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue by ShapeBlue
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue
ShapeBlue152 views
Setting Up Your First CloudStack Environment with Beginners Challenges - MD R... by ShapeBlue
Setting Up Your First CloudStack Environment with Beginners Challenges - MD R...Setting Up Your First CloudStack Environment with Beginners Challenges - MD R...
Setting Up Your First CloudStack Environment with Beginners Challenges - MD R...
ShapeBlue178 views
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f... by TrustArc
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...
TrustArc176 views

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/
  • 54. Happy Hacking http://jnaapti.com/