How do I move files from an ESXi datastore onto a VM?

5,212

If you enable ssh on the esxi server then you can scp the files off into an attached vmdk either using winpe or another suitable bootdisc.

Share:
5,212

Related videos on Youtube

PerryC
Author by

PerryC

I'm a Computer Science and Software Engineering graduate from the University of Washington. I've previously developed in C++, C#, and Python. I currently work primarily in Java and JavaScript for Amazon.

Updated on September 18, 2022

Comments

  • PerryC
    PerryC almost 2 years

    I uploaded two 15GB .WIM images onto my ESXi 6.0.0 datastore. I have a VM that I would like to image using those .WIM files from within a WinPE environment but can't access the files from within the VM (which does seem logical -- it would be a a security risk to allow access to the root drive from a VM). In any case, it's what I want to do. So I'm looking for workarounds.

    I found an open source VMFS driver but it uses Java and WinPE doesn't have Java (https://code.google.com/p/vmfs/).

    I thought of maybe mounting the .WIM files as a "ISO" (which doesn't quite work). vSphere will mount the file just fine, but if you try to navigate to the CD drive it complains that there is no filesystem (which is correct). I thought of maybe using DD to try a raw copy from the "mounted" WIM? It just seems like there should be a better way (and I'm not sure if DD will work in this case).

    I want to try to avoid having to upload a 30GB ISO image of the two WIMs because it will take a day or two.

    • GregL
      GregL almost 9 years
      This sounds kind of like an XY Problem. What are you trying to do, and why do you need to upload the WIM to a Datastore?
    • PerryC
      PerryC almost 9 years
      I'm trying to apply a WIM image to a VM running on an ESXi server. I've already uploaded the WIM files to the datastore on the ESXi host hoping for a faster image application speed. I just can't access the files on the datastore from within my VM. I don't think this is an XY problem -- I'm asking if it's possible to access files on a datastore from within a VM. I wanted to show my research effort -- not get answers for my "solutions".
    • PerryC
      PerryC almost 9 years
      @GregL Agreed. I should find a better way as this is not something I'll be doing often. In that sense, I guess it is a bit XY. Thanks for your input.
    • austinian
      austinian almost 9 years
      As for attacking X instead of Y, I'd suggest, in this case, having a "maintenance" VMDK where you store your images. You can modify its contents to it by attaching it to a management VM or mount it in windows using vmware-mount, then attach it to the VM you wish to use the WIM to image and boot into WinPE there, or even put WinPE in a VMDK and keep the WIMs and WinPE all in one spot. Or do something else entirely.
  • GregL
    GregL almost 9 years
    As far as I'm concerned, enabling SSH on an ESXi node should really only be done for emergency management purposes, not for trying to solve problems like this.
  • PerryC
    PerryC almost 9 years
    The only file transfer app included with WinPE is FTP, which won't work for this case.
  • JamesRyan
    JamesRyan almost 9 years
    @GregL not really, it is fine if used temporarily and turned off again, plus it should be behind a firewall
  • GregL
    GregL almost 9 years
    Your router probably supports TFTP and/or SSH, but you wouldn't dream of using it like this. ESXi hosts should be treated the same way. They're single-purpose appliances which have tools and systems to manage them. Using those tools for things other than their intended purpose, while feasible, shouldn't be done if a better way exists.
  • GregL
    GregL almost 9 years
    I can't entirely agree with your comparison of tasks; one is a direct use of the tool to manage the system in question, one isn't. Just because he's already copied the files to the system doesn't mean he should continue down that path. Instead, it might serve him well to revisit why he copied them there in the first place and take a new approach to his intended outcome.