"To VM or not to VM"

"To VM or not to VM"

Just upgraded to Berlin, & I'm now pretty sure I'm going to stop using VM's for development work. In the past I had a VM for each version of Delphi & would take snapshots of the VM whenever I reached a major release point. Other than that, I'm struggling to see the benefits of working in a VM. In fact it now seems like using VM's is actually more of a problem than a benefit, i.e. not taking full advantage of my hardware, an extra boot-step, configuration required to access USB (still flaky), network access required to reach backup drives (Windows networking is just yuk), multiple screen support is clunky.

My current plan is to install all the Delphi versions I currently need (XE6 & 10.1) side-by-side on my host Windows machine.

Anyone got any input as to why this might be a bad idea & why I should stick with VMs? (Obviously you guys on Mac have to use a VM, so that won't count).

TIA

Comments

  1. I have D7, XE5 & XE8 on the same machine without VMs and they work perfectly. I use D2006 & XE5 at work without problems also.

    FYI Mac users may use Windows without VM, because they can boot their machines directly in Windows, if they want. Windows users may hack their PCs to use OSX (it's called Hackintosh) but it's not legal.

    ReplyDelete
  2. besides having one point of brake? OK...

    if you have everything on host system, and some divine license issue arises, you might end up with a bunch of Delphi unusable versions, you count the downtime;

    suppose you install some tool, for some reason, that tool ends up carrying a malware payload, your main system is now down, you count the downtime;

    it's easier to move the dev env if it's a self contained VM, if it comes to that;

    anything you do on the main system, can have significant impact on all your dev tools, and vice-versa;

    last time I checked a RAM benchmark, a windows 7 VM was about 60% of host system, but most of the time, it really doesn't matter, in fact, in over 6 years since I'm using solely VM's for dev, never noticed the slowness of memory;

    I have VM's for:
    - windows development: VS, Delphi, etc.;
    - OSX, iOS, tvOS, etc.;
    - android development(ubuntu);
    - and for each, a non-persistent VM on which I can test everything "clean", or test any tool that I might put on any of the VM's;

    for what it's worth, my advice is to at minimum have a VM in which you have all delphi versions installed, then it's contained and you can make snapshots before any update that my prove to brake your dev env.

    of course, what I'm saying may not make sense for you depending on your system config:
    - CPU cache(as much as it makes sense financially);
    - SSD faster, better;
    - RAM at minimum 16GB, my workstation has 64GB and when I run 3-4 VM's(all with 8GB+ of RAM, not trimmed!), RAM usage is around 4XGB;

    I'm waiting for the day in which we can run applications on host system, but be able to move them to a different system much like we can with a VM, the day in which, when we uninstall an application, everything that application has in terms of binary, config, etc. goes with it.

    ReplyDelete
  3. Moreno Zenaro you can run OSX on windows via VMWare, works great at 2560x1600 (;

    ReplyDelete
  4. Good points Dorin Duminica - thanks. My laptop has 16Gb RAM, an SSD + HD. Speed's not an issue for me, I only really run 1 or 2 VMs maximum. It's more convenience, but I take your point on being able to move the entire Dev environment to different hardware, thanks.

    ReplyDelete
  5. Dorin Duminica I know, but you can not legally run MacOSX on a PC as the only OS.

    ReplyDelete
  6. I use a Mac, so I'm in the "have to use a VM" category. I also use different VM software to you so will have a different experience. For example, with Parallels USB connections are fine: when you plug something in a dialog pops up asking if you want to connect it to OSX or Windows, and you can connect/disconnect at any time through a menu. As for the boot process, it only takes a few seconds, and I usually keep the VM paused so starting it up is like waking from hibernate in terms of speed. (Maybe ten seconds.)

    Hardware - the only thing I know of is that graphics cards often don't have support for newer versions of DirectX, which is bad.

    I have D2010 - Berlin all installed on the one VM, without problems. I make snapshots before installing or before the uninstall-reinstall process for an update, but that's it. No problems there.

    ReplyDelete
  7. Thanks David. I'm erring towards a single VM with multiple Delphi versions right now. Like you & Dorin said, I have hardware independence and easy protection against unsafe updates etc. Thnx :)

    ReplyDelete
  8. I'll never work without a VM. But I do not separate my Delphi's. I boot up my (windows) host - nearly empty - an run everything in my VM. One productive and others down to Windows 95 for testing. Before installation of XY make a snapshot... Backup? Just copy the VM-Dir.

    ReplyDelete
  9. I use VMs for utility machines (build, test, db servers..) but not for my main machine. I also want to avoid using a laptop as primary machine: been there done that, too many compromises.

    However there is a twist: the machine I use is hosted in a data-center, it is a bare-metal Xeon E3 server, with plenty of RAM, SSD RAID, a lot of bandwidth, and I connect to it through RDP. While it sounds expensive, it actually costs (yearly) only a fraction of a good laptop.

    For all the usual tasks, it is faster and packs more punch than even the hottest and noisest laptops, and even a 3G connection is enough for RDP. As soon as there is heavy internet, CPU, memory or I/O involved, it can get much faster. Can't beat data-center bandwidth and latency. Sure, you cannot do 3D games on it, but it is a work machine :)

    Being a server, with RAID, backups and all the bells and whistles, it is as solid as it gets. It's cool and dead-silent, even under prolonged high CPU load, you can connect from anywhere, even smartphone or tablet. And RDP supports multiple displays just fine when at the desk.

    It is not for everyone, but I personally find it quite convenient :)

    ReplyDelete
  10. I used to have at least one VM, sometimes more. But with my current job it's too much of a hassle, because I need hardware access at various levels. My home machine currently also doesn't have VMs and all Delphi versions from 6 to 10.1 are installed and work.
    But I was considering to move this installation to a VM again, just to make it kind of "portable" in case something happens to the Windows installation or the computer. I won't go to having one VM per Delphi installation though. That would be annoying whenever I want to compile GExperts for more than one version.

    ReplyDelete
  11. Eric Grange​ is that your personal installation or your employer's? If the former: Would you care to name the hoster and the cost?

    ReplyDelete
  12. I cannot imagine trashing up a perfectly good (non VM'd) Windows install for a RAD studio install. Windows is what, about 8 gig's of overhead for, well, a lot of RAD (60gb?). I usually snapshot right before and after hitting the install button. I consolidate the installs into more massive VMs every so often, and RAR them down (using big block sizes). I can't think of how many times those snapshots have come in handy, when RAD bites the dust (and it does for me on occasion). Just saying, that tough act to follow without a snapshot. On the other hand, you're talking to a guy that won't run hardly anything outside of a VM. Todays software just has little business not running inside of some sort of protective container. Just my 2 cents.

    ReplyDelete
  13. I have a VM, not per version of Delphi, but per customer. For instance I work with XE3 for one customer and XE8 for an other.

    On the host machine I also have the last version of Delphi to play with...and Delphi 6 for developping quickly tiny tools :)

    ReplyDelete
  14. At work we install Delphi straight. Never had any issues with that.

    Since we use SVN, switching branches in the VM is oh-so-slow, even with SSD.

    Though we have a VM server where we have some old versions of Delphi installed, just in case we need to fix some really old version of our program.

    ReplyDelete
  15. Install your host in a virtual hard disk; that way if your PC ever "gives the ghost", you can always swap out the HDD on which the VHD resides then mount it in a new machine or run the VHD as a VM.
    At https://wiert.me/2012/03/12/how-to-install-windows-7-on-a-virtual-hard-disk-vhd-in-10-steps-via-guides-tutorials/ I borrowed some steps. Works for W8.x and W10 as well.

    ReplyDelete
  16. Thanks everyone. I think I'm sticking with a VM now :) I'll add 10.1 to the existing XE6 VM and go from there.

    Jeroen Wiert Pluimers - is that like having a bare-metal, hypervisor as the host? If so what VM solution do you use? (I'm on VirtualBox still)

    Eric Grange - I considered a remote VM actually .. but then I realised my home broadband sucks and there's virtually no 3G here in case I need a backup connection :)

    Paul TOTH - I don't have separate customers as such - but it's a good idea if I ever do.

    Frank, Joe, Thomas, Abjorn, David, Moreno, Dorin- thanks for the input. I've been swayed. :D

    ReplyDelete
  17. Jeroen Wiert Pluimers use VHDs all the time - Win7 and Win10 (Preview and Stable) side-by-side on a single partition "hosting" all VHDs. There is a slight problem though - you can't update Windows to newer version booted from VHD, you should run it in a VM instead. Same for Win10 Insider Preview builds - they can't be updated at VHD, but update fine if run same VHD in VirtualBox VM from Win10 Stable/Win7.

    There is also a slight performance hit around 5% (or less) accessing file system in VHD. Very likely that VHDX in Win8+ featuring 4k sectors reduces that hit to the minimum. I'd also recommend to pre-format OS and data partition with /L switch to enjoy NTFS Large File Records.

    To backup any OS VHD just copy its file from the other OS. You can switch what OS to boot on next reboot with bcdedit.

    ReplyDelete
  18. I have exactly the same set up and workflow as David Millington but I was considering to move to a real PC purely for cost reasons. I am not sure whether having a Mac justifies the cost to develop on Windows. With the same money you can create a super duper Win machine

    ReplyDelete
  19. Stuart Clennett no hypervisor at all. Just disk indirection. Easier to do contingency measures.

    ReplyDelete
  20. Jeroen Wiert Pluimers thanks, I'll look closer into it :)

    ReplyDelete
  21. One caveat when using multiple Delphi versions is that some 3rd party libraries do not have Delphi versions embedded in their package names (e.g. they'll use mypackage.bpl instead of mypackage_xe8.bpl). This means you can sometimes end up with the wrong version of a library attempting to load in apps and the IDE (usually leading to crashes).

    You'll also find a minor performance hit as there are additional folders added to your PATH environment variable.

    ReplyDelete
  22. Marc Durdin time to say goodbye to those vendors.
    The PATH thing is a real issue though usually that grows to big when you have more than a few versions installed. Some people use a shorter base directory to workaround or use an expandable PATH variable that depends on other environment variables.

    ReplyDelete
  23. Impressed by all your hardware and configs guys, especially when I read about testing or build machines... I realize how old fashioned I am: one desktop running both D7 and D2007... under XP! And an OSX laptop with a great SSD but only 256GB, so it's a bit tiny to host multiple VMs. Even though I have a Win7 and a 8.1 but located on an external HDD, although connection is USB3 I find this quite slow and I only use them to test my apps behavior under recent Windows versions.
    Well I'm not proud of that but I've never been aware of virtualization or any "recent" practice, it's already tricky enough to keep up to date with software architectures and technologies... Maybe time for me to ask for a training :)

    ReplyDelete

Post a Comment