Getting started with virtualization: things you wish you'd known first

Discussion in 'sandboxing & virtualization' started by axial, Sep 23, 2008.

Thread Status:
Not open for further replies.
  1. axial

    axial Registered Member

    Joined:
    Jun 27, 2007
    Posts:
    477
    A thread inspired by Mrkvonic's excellent post here: https://www.wilderssecurity.com/showthread.php?t=220807

    Aside from the specific choice of tool to use, are there any tips / tricks / getting started guides / general philosophical insights that you wish you had known when you started out?

    For example, this article (and many others here on Wilders) about making a bare essentials Windows install using nLite: http://lifehacker.com/374376/trim-down-windows-to-the-bare-essentials

    What about issues like backups, keeping apps on VMs updated once the VM is created, "rescue" tips if/when things go wrong, all the day-to-day stuff that one eventually learns.
     
  2. Peter2150

    Peter2150 Global Moderator

    Joined:
    Sep 20, 2003
    Posts:
    17,047
    The beauty of VM ware's machines is when something goes wrong it's easy to fix. Yes it does give you another computer to update software on.

    If you are talking virtual machines, then the biggest single thing in my opinion is adequate host resources. Particularily in disk space and memory. My main working VM machine has 1gig of ram and 2 20gig hard drives. Place space for the snapshots. The folder for this one machine is 60gb and when running it uses about 1100K.

    But it also depends on what you want it for.

    Pete
     
  3. Sully

    Sully Registered Member

    Joined:
    Dec 23, 2005
    Posts:
    3,719
    I have been using vmWare 5.1 for some years now. It is expensive, but well worth it for me. I use it daily, and have many machines. Normally in my version to make a vm, you dedicate for xp approx 8gb of storage space. It may only consume 4, but intial size is set to 8. My machines vary from 1gb to 4gb ram, with 80gb to 750gb drives.

    In vmWare, you can use 2 types of 'rollback' features. One is called a snapshot and one is making the virtual hdd read only.

    Snapshots make using vmWare really nice. For instance, you can install a fresh OS (say, XP Pro from an .iso) and at any point along the setup, say between text mode and gui mode, you can make a snapshot. Or 2 or 3. This allows you to play with your .iso install and see what happens if you change things. Same goes for once the OS is installed. I often try a new program and see what it does. When I am done, I can easily rollback to a prior snapshot or make a new one. This does require hdd space, but that is np for me.

    Making the virtual hdd read only is another great method. Consider it something like returnil of sorts. You can start the vm up, do whatever, and when you shut the power off (virtually), all your changes are gone and you are right back to where it was locked.

    I use vmWare boxes for all sorts of stuff, from trying a new linus distro, to new firewall, new security apps, scripts I am writing, online banking, you name it. IMO it is better than installing it on my real OS. It gives me a great preview essentially.

    Sul.
     
  4. axial

    axial Registered Member

    Joined:
    Jun 27, 2007
    Posts:
    477
    My main interest in VMs is to be able to run various versions of specific commercial software. I support clients who run probably 8 or 10 different versions of 3 main applications, and I also participate in a early betas of the 3 products.

    It would be nice to have each version "easily" accessible for testing, without having to edit .ini files and in some cases even install/reinstall in order to troubleshoot. It would be cool to have a VM for each client, update each VM as the client updates, and keep everybody's "world" intact.

    I've read several comments about installing the VMs on external drives rather than the host system; I'm wondering if that has an impact on responsiveness, and if eSATA proves too slow, whether it's relatively easy to shift the VM back to the main system.

    Also, what about software registration / authorization, do the VM installs trigger them?

    fwiw, my system is 4gigs, dual quad core 2.4GHz, 1TB Samsung Spinpoint (tons of free space), plus assorted external drives, WinXP Pro.
     
  5. axial

    axial Registered Member

    Joined:
    Jun 27, 2007
    Posts:
    477
    Thank you both Peter and Sully. I'm just about to install VMware Workstation.

    I'm trying to figure out what would be most time-efficient as far as creating my first VM. I'm somewhat wary of the time involved in doing the Windows install (nLite or not) and would like to minimize the "up-front" setup time.

    So here's the question: I'm more interested in application-variant VMs rather than OS-variants, and I've seen references to using a ShadowProtect spf as the source of a VM. Does this mean that I could avoid having to do the whole Windows install, at least for this first toe-in-the-water? Am I dreaming?
     
  6. Peter2150

    Peter2150 Global Moderator

    Joined:
    Sep 20, 2003
    Posts:
    17,047
    Depends. I couldn't try it as my hosts have nvidia raid0 and the VM doesn't. I just took the time and did a full install for the first machine. After that you can clone them..

    A fast external drive on a good bus is fine.

    Pete
     
  7. axial

    axial Registered Member

    Joined:
    Jun 27, 2007
    Posts:
    477
  8. Peter2150

    Peter2150 Global Moderator

    Joined:
    Sep 20, 2003
    Posts:
    17,047
    I haven't tried it. I just started from scratch and went. Part of the point for me was a learning experience, which I gather is preciously what you want to avoid.

    Pete
     
  9. DasFox

    DasFox Registered Member

    Joined:
    May 5, 2006
    Posts:
    1,825
  10. Peter2150

    Peter2150 Global Moderator

    Joined:
    Sep 20, 2003
    Posts:
    17,047
    Not sure I see you point.
     
  11. axial

    axial Registered Member

    Joined:
    Jun 27, 2007
    Posts:
    477
    Precisely -- guilty as charged. :D
     
  12. Sully

    Sully Registered Member

    Joined:
    Dec 23, 2005
    Posts:
    3,719
    If I understand you correctly, you will be using primarily on 'guest OS', say XP. And that you wish to code say 3 products at one time for 3 different companies. Your situation may be different, but that seems like a generalized version.

    So, in this case you would need to decide, are the 3 different apps needing to run at the same time ever? If so, then you would make 3 different vm's. If not, then you could make one, and then make a baseline snapshot. Then from that baseline snapshot you make 3 'app specific' snapshots. Then you 'go to' the snapshot you want. Now the snapshot is a 'picture in time', so you would say make changes in Snapshot A, then save it. Now while vm OS is running, you can 'go to' Snapshot B. Make changes to keep, save Snapshot B, overwriting. This way you have one guest OS, and just sort of image it with snapshots.

    I have ran Electronic Workbench in one vm doing virtual circuits, while running 2 other spice analysis apps on 2 other vm's, on an Athlon XP 2400 with 1gb ram. There is some noticable lag if I do certain things, but it has not produced any errors thus far. I would personally see no problem with your setup using 3 different vm's at once. In fact, I have a very similar system, and routinely run 2 or 3 vm's at once, even installing the OS on more than one at one time. That is pushing it to the edge IMO of what a workstation can do with vm, installing OS's causes a LOT of heat in the cpu lol.

    Regardless, vmWare is a very mature product with many great features. I have tried some of the others, and some are pretty nice. But IMHO none of them yet equal the ease and polish of vmWare. If I were you in your case, I would just make 3 different vm's. As for install, I do my own customization, not involving nLite at all. When I am done I make an .iso of about 4gb. This is my XP Unattended DVD, but beauty part of vm, you just mount the .iso on a virtual cd rom, and watch how fast you can install windows. My very favorite thing to do is install and play with stuff related to it, because vm opens sooo many windows of opportunity at a much faster pace.

    HTH.

    Sul.
     
  13. Mrkvonic

    Mrkvonic Linux Systems Expert

    Joined:
    May 9, 2005
    Posts:
    8,698
    Hello,

    Some tips:

    1. Use a dedicated partition / hard disk for virtual machines, preferably a second internal or an external hard disk - this will make your host much more responsive while guests are running. No difference in using internal or external hard disk for images - as long as the disks are fast.

    2. Memory is important. My "virtualization" rigs have 2GB memory and I can use up 1.5GB of that without experiencing any slow down, roughly 3 512MB machines.

    3. I like to make images as small as possible, for example: Windows 6-8GB, with never more than 4-5GB taken, Linux 8-10GB, with never more than 4-6GB taken.

    4. Virtual hard disks are files, so copying them is equal to backup / snapshot, with some extra space taken. In this regard, snapshots are more like incremental/differential backups, while copying is more like a full backup. I use both, as needed.

    5. Firewall configuration on the host is important. In this regard, I have found the VMware network drivers to be solid and sturdy and work well in all kinds of environments, greatly simplifying deployment. Setups include windows / linux hosts with/without firewall running (outbound only in linux, two-way in windows), plus router. No problems.

    Mrk
     
  14. Sully

    Sully Registered Member

    Joined:
    Dec 23, 2005
    Posts:
    3,719
    Concerning #4, this is a great piece of info to include. I have many vm's that I have had over multiple OS re-installs. Like said, just copy them and re-use them.

    Concerning #5, I am absolutely 100% in agreement that the vmWare network drivers are top notch. Any host I have used works every time. It does take an exception in the host firewall usually though to allow outbound traffic from the guest to host to wan.

    Mrkvonic, do you ever turn some of those dhcp and similar services off for your vm's? I personally always use static ip's, and have found that I can disable all vmnet nics as well as setting all services to manual, and they rarely start.

    Sul.
     
  15. Mrkvonic

    Mrkvonic Linux Systems Expert

    Joined:
    May 9, 2005
    Posts:
    8,698
    Hello,
    In Windows, I let them be as they desire ...
    In Linux, I sometimes do set them as static ...
    Again, all depends on my needs.
    Mrk
     
  16. axial

    axial Registered Member

    Joined:
    Jun 27, 2007
    Posts:
    477
    With your comments I think I'm getting closer to understanding the path forward.

    The only guest OS needed immediately will be WinXP SP2, but I'd also like to test SP3 too (significant issues with OLE in SP3).

    The 3 "significant" apps I mentioned do/must work together, yes. So for example

    Combo 1
    =======
    App1 ver. 7.2
    App2 ver. 8.1.2p45
    App3 ver. 7.09

    Combo 2
    =======
    App1 ver. 8.0
    App2 ver. 8.1.2p45
    App3 ver. 8.1

    One or more clients might use a particular combination, so in the end I might have, say, 5 different combos to support 8 clients. Typically I'd only need one or possibly two actually running at any given time. Occasionally I have situations where I need to compare output from different versions in order to troubleshoot upgrade issues.

    What about other application updates? For example, if I have, say 2 VMs to start with, each with a different combo of the 3 "significant" apps. I use an XSL editor to do development, and it is configured to reference the specific XSL engine in one of the 3 "significant" apps. Will I need to update each of the 2 VMs independently when the XSL editor updates?
     
  17. Peter2150

    Peter2150 Global Moderator

    Joined:
    Sep 20, 2003
    Posts:
    17,047
    In essence yes. Also I doubt you will be able to run 2 VM's at the same time.

    Space wise it might be easier to keep things in separate snapshots and just go to the snapshot you need. Will certainly use less disk space.

    Pete
     
  18. Sully

    Sully Registered Member

    Joined:
    Dec 23, 2005
    Posts:
    3,719
    Why would you say that? I run 3 or 4 virtual machines on an e6600 with 4gb ram and 1.5tb hdd. I have not seen any problems as long as you are swtching to vm1, testing, then switch to vm2 and test, etc. I have seen some pretty major slowdowns when doing something a bit intesive on each machine at the same time though.

    Have you had issues running more than one vm? I do it with vmWare workstation btw.

    Sul.
     
  19. axial

    axial Registered Member

    Joined:
    Jun 27, 2007
    Posts:
    477
    As I continue learning more about VMs I've been thinking more about Peter's comment:

    I'm definitely coming at this from a business user's perspective rather than an IT perspective -- the bottom line is I want to know how to use VMs within a relatively narrow set of requirements, rather than learn how to use VMs in general.

    For example, I mentioned earlier that I use an XSL editor for development. But in actual fact I use several XSL editors, and many, many other apps at various times -- the time involved to install each of them again would be almost prohibitive. I have a kazillion tweaks to my current XP install that would be impossible to recreate -- even once -- for a single VM.
     
  20. Peter2150

    Peter2150 Global Moderator

    Joined:
    Sep 20, 2003
    Posts:
    17,047
    Hi Sul

    MY VM's all have 1gig or more RAM. So even with 4gig ram, having more than one running is going to tax things. OP is going to be working with video editors or the like if I read it right. He may need pretty good sized machines.

    Pete
     
  21. Peter2150

    Peter2150 Global Moderator

    Joined:
    Sep 20, 2003
    Posts:
    17,047

    I hear you on this. But also remember you probably bought a machine with OS installed. Here you are starting from scratch. I've never tried the restore of an image.

    Pete
     
  22. Meriadoc

    Meriadoc Registered Member

    Joined:
    Mar 28, 2006
    Posts:
    2,642
    Location:
    Cymru
    Per processor, the amount of vms that you can run would greatly depend on the processor, memory and guest workload.

    A business that wants to run vms would probably have enough servers and a growing populace for consolidation, many familiar applications and programs on different servers, considered compatibility.
     
  23. Longboard

    Longboard Registered Member

    Joined:
    Oct 2, 2004
    Posts:
    3,187
    Location:
    Sydney, Australia
    You may be looking for this ??.
    http://www.vmware.com/products/converter/
    Works.
    Convert current machine to VM...save back-up copies of VM offline, snapshots etc etc

    ( jic: image first...;) )
     
  24. Sully

    Sully Registered Member

    Joined:
    Dec 23, 2005
    Posts:
    3,719
    Ah. Yes, that would make sense, devoting larger amounts of ram to each vm. I think most of mine are either 256 or 512, although if I remember correctly they can dynamically grow to a certain % .

    As far as having to install many different tweaks/apps to each vm, you need to stop thinking of them as 'unique', when in fact you can simply make one install on one vm with your baseline tweaks. Then you name that as such, like 'Development Source'. Now you never touch this one, so make the hdd's read only. Then you clone this, say you call it 'Development Prep'. You install all your goodies that you need for any vm you might want. This might include ALL of your apps etc. Then, you clone that say 3 times. Viola! You now have 3 vm OS's each preinstalled with everything you need (presumably). You can fine tune each if it is required. You can also easily go to the 'Development Prep' vm, and make radical changes, ready now for re-cloning. I routinly clone my source vm to play with. I also write my data to a usb stick or a share (which is to my live OS), so deleting a clone and starting over never makes me lose my stuff. It is all about how you think ahead in the source and prep vm's so you don't have to do this again.

    Food for thought anyway.

    Sul.
     
  25. axial

    axial Registered Member

    Joined:
    Jun 27, 2007
    Posts:
    477
    Thanks, Sul. That's exactly the kind of tips I was hoping this thread might help me come to grips with -- the factors to consider when doing the "thinking ahead".

    How long does it take to clone a VM? Obviously disk speed, interface, and size are variable, but I'm trying to get some sense of how this compares to formatting a drive, say. I'll be using a dedicated internal SATA drive for the VMs.

    I've read some comments about the difference between cloning file-by-file vs. by sector, but only one blog that gives any indication of the time doing anything with VM can possibly take: http://raywoodcockslatest.blogspot.com/2008/07/vmware-trying-minimalist-winxp.html
     
Loading...
Thread Status:
Not open for further replies.