Can I run a virtual machine from external USB drive?

102,426

Solution 1

The answer depends a bit on what the VMs are supposed to do. For "paperwork" like writing and reading you'll be fine. "Major performance loss" is not a well-defined value.

For most people it should be okay. If you find yourself to be an extremely impatient computer user, get the fastest equipment you can, I would even suggest replacing the internal SSD with a bigger one. A 2 TB SSD is now on the market, which may or may not be too expensive for you (700-800$).

For programming, you likely won't get much more bang when writing code. You might get a performance boost when compiling. If you're not the type to do stuff in parallel while your code is compiling, get the fastest equipment you can.

The TLDR is: If you can afford it or if you don't have HDD lying around, get an SSD, internal or external (eSATA or USB 3). When in doubt, get the good stuff.

  1. Is it possible to run a VM from an external HDD? (Or is SSD a must here?)

Yes, it is possible, but you will likely have some performance loss. The VM should run okay as long as you don't have operations that require a lot of file writing. Also, the smaller the VM, the better. If you have a 50-60 GB Windows VM, it will be very slow on an external 5400 HD with USB 3. I am speaking from experience here. You can still do stuff, but it will take a while.

Running more than one VM on an external HDD at a time may bring a severe performance loss. Consider using two external HDDs for that scenario.

  1. Will USB3 suffice or should I get one that also supports eSATA?

USB3 should be fine, at least it was in the cases where I used them. Faster is better. If you haven't bought the external HDD yet, you might want to go for eSATA because you never know what you'll use your spare USB ports for. (You may want to add a 2nd external drive for back-up purposes.) With an HDD, you might not get much more performance from eSATA because file-writing and -reading speeds on a spinning platter disk are the limiting factor.

Also try to get an SSD or at least a 7200 rpm HDD for the external drive, if you can still find one. Or build one from an external case and an external USB enclosure. If you can't afford an SSD, a 7200 will cut file transfer times by a few percentage points.

  1. Is it better to store the less frequent used VMs on the external drive and then move them to the internal drive, when I need to use it? This will require me to move a VM from internal drive to external first, hence this question.

I think you should keep the VMs that will do lots of heavy lifting like file-writing and computing intensive stuff on the internal drive, irrespective of how often you use them. Shifting them can be quite a pain. Copying a 20 GB VM from internal to external HDD will take about 6-7 minutes at 60 MB/s. Internal to external SSD will be substantially faster. If you find the performance from the VMs on the external disk acceptable, moving them around might not be necessary. You can cross that bridge when you get there.

  1. Is it even possible to run a VM from an external drive without major performance loss?

See 1., yes it is possible for normal to medium computer work, if the VM is small. If you do graphics design or lots of file transfers, there may be a severe performance loss.

For your programming needs I would suggest on data gathered elsewhere that you get an SSD (What is more important CPU or RAM for compiling large software, e.g. bootstrapping gcc?, http://www.overclock.net/t/997361/compiling-and-cpu-usage). Though there are some dissenting opinions (https://stackoverflow.com/questions/15199356/speed-up-compile-time-with-ssd). Again, when in doubt, get the good stuff.

Edit: Januar 5th, 2016 - added some information due to recent experiences

Solution 2

I ran a VM on a USB3 stick over the last year. It was super easy to do and very convenient, but there are a few sidenotes to be made.

  • I'm not sure about VMWare, but for VirtualBox it's just a matter of dropping your virtual disk file onto the USB and linking it to your VM. You'll have to make a configuration on every host you use it with, but that's just a one time thing. The hosts play quite nicely with each other. The only thing I noticed is that my VM will have a network interface for every host network it has been connected to, but otherwise it hasn't given me any sort of conflicts.

  • My USB gave out eventually, which is not surprising. USB flash sticks are not meant for constantly taking in write cycles, they'll wear out quite fast if you use your VM for development purposes especially if your VM is acting as a server and constantly writing to log/cache files.

  • Performance can be an issue. If you do get a USB stick, look specifically for those with high read and write speeds, but even then you'll notice an impact.

  • I think an external SSD disk might be the better choice, it's less convenient than a small stick, but usually they're still portable enough to easily carry around, have higher performance, and live longer. (I'm aware Flash and SSD are really one and the same technology these days, but SSD's are designed with higher read and write frequency in mind while USB sticks are mostly just focused on file storage)

I've opted to use some kind of hybrid solution these days. It was really convenient to have my full programming suite inside a portable VM, but my IDE was noticeably slower running inside it and would occasionally freeze for a few seconds. Now I use most of my programming tools on the host while keeping the source code and servers on the guest. My VM is still a full-blown desktop as well though, so for the rare occasions that I still DO have to work on a foreign computer, I can just spin up my VM's GUI and work with its IDE and programming tools.

Share:
102,426

Related videos on Youtube

Boregore
Author by

Boregore

Updated on September 18, 2022

Comments

  • Boregore
    Boregore almost 2 years

    A question regarding how to setup my VMs on internal/external disks. First, here's my setup:

    • Host OS: Windows 10
    • Processor: i7 5600U
    • RAM: 16 GB
    • VMware Workstation Player (Licensed)

    I have 3 VMs so far and I'm soon getting a 4th and there's not enough space on my internal SSD anymore, so I need an external disk to place some of them on. I have a laptop with USB3 ports and a dock for the laptop with an eSATA port. I read about the speeds of both, and 5Gbps vs 6Gbps doesn't look like that much of a difference to me (but I'm not an expert on this) - and the only other USB devices connected are cabled mouse and keyboard.

    What I'm using the VMs for: I'm a developer, and the different VMs are for different development environments.

    • 1st VM is running Windows Server 2008 with Visual Studio, SQL server and K2 Blackpearl.
    • 2nd VM is running some Windows Server 2012 with Visual Studio, SQL server and BizTalk (among other things I don't know yet - this is the new VM I will get soon)
    • 3rd VM is running Ubuntu and will be used for Python development (probably in PyCharm)
    • 4th VM I haven't gotten around to yet - I was employed about a month ago :-)

    My questions:

    1. Is it possible to run a VM from an external HDD? (Or is SSD a must here?)
    2. Will USB3 suffice or should I get one that also supports eSATA?
    3. Is it better to store the less frequent used VMs on the external drive and then move them to the internal drive, when I need to use it? This will require me to move a VM from internal drive to external first, hence this question.
    4. Is it even possible to run a VM from an external drive without major performance loss?

    I think that was it for now. I look forward to your answers.

    Best regards,

    Joakim

    For anyone who finds this post and wants to know the result: I had some doubts about this pre hand, and I would not recommend this setup for any developer. The boot time is horrible and starting apps like Visual Studio takes at least 3-4 times as long time.

    My advice: Only use this solution if you have no alternatives.

    • yitwail
      yitwail almost 8 years
      Was it horrible even with an external SSD, or did you only use an external HDD?
    • Boregore
      Boregore almost 8 years
      I didn't get to try it with an external ssd. I imagine it'll be somewhat better, but I still think you would need to hook it up with e-sata for an acceptable performance, though.
    • yitwail
      yitwail almost 8 years
      I'm getting delivery of a 500GB USB3 external SSD in a couple of days, so I'll put a Windows 8 VM in it then run virtualbox & parallels desktop on it with a stopwatch on it, and when that's done, I'll post another comment with the results
    • Boregore
      Boregore almost 8 years
      Cool - people who stumble upon this post will appreciate that I think.
    • yitwail
      yitwail almost 8 years
      The SSD came and was defective, so experiment is postponed until replacement arrives. Not an auspicious start. If this were stackoverflow, I'd be sternly warned not to use the comment system to have a chat.
    • yitwail
      yitwail almost 8 years
      SSD was not defective, MacBook Pro needed SMC/NVRAM reset. So, with caveats, IE11 - Win8.1 Parallels VM is quite useable. If I suspend/resume it, and close apps before suspending, it suspends & resumes in 3-4 seconds. I use VM just to test IE, and IE is snappy. Parallels has so many settings, so cannot say I have an optimal setup. I also tweaked Win8 a bit for performance. I suppose I should repeat the experiment with internal disk, but someone else can do that. FYI, it's a 128GB Retina MacBook Pro, hence the need to put VM in an external SSD.
    • Teoman shipahi
      Teoman shipahi about 7 years
      What setup did you use? I was planning to put my VirtualBox vm into SSD and carry around my vdi files and boot from anywhere. But seems like it is not performant in 2017 :\
    • John Kouraklis
      John Kouraklis over 6 years
      Have you considered using the external drive with normal OS setup and apps, etc. and link it to your main system in a virtual machine? I am thinking of doing this and any experience to share is very welcome
  • Boregore
    Boregore over 8 years
    Thanks a lot for your answer. I should have specified what kind of work I'm doing though. I added what I do to the main post instead as I can't do newlines in the comments
  • Boregore
    Boregore over 8 years
    I guess the filewriting part is what I need to think about. Do you have any comments on this with regards to me being a software dev? I will wait a bit and see if anyone else has something to add and eventually accept your answer if nothing better comes up :-)
  • user 99572 is fine
    user 99572 is fine over 8 years
    @joborr Ow, you certainly got my juices going with your 2nd comment. ;) An upvote might soften my mood. But seriously, I am not a programmer so I can't say anything about that. If you're compiling code Here's another thought: Buy an external SSD for each VM. It will be a boon. See above (in about 2 minutes).
  • Boregore
    Boregore over 8 years
    Alrighty, thanks for all your tips - much appreciated :-)