Automation

 View Only
  • 1.  Copying a file into a guest OS

    Posted Apr 04, 2011 10:39 PM

    How do I use powerCLI to copy a file from the computer I am running PowerCLI on into the guest operating sytem of a Windows virtual machine?  I want this to without the OS inside the VM having it's network adapter configured, by connecting to the vCenter Server.  I want to use credentials for the vCenter server only and not the credentials for the ESX host the VM is on.

    Thanks



  • 2.  RE: Copying a file into a guest OS

    Posted Apr 04, 2011 11:33 PM

    Here are some examples found here:

    http://www.amikkelsen.com/?p=357

    Did a quick google search, and that's what I came up with. I'm still learning myself. :smileyhappy:



  • 3.  RE: Copying a file into a guest OS
    Best Answer

    Posted Apr 05, 2011 08:12 AM

    You need to use the 'Copy-VMGuestfile cmdlet'

    NAME
        Copy-VMGuestFile

    SYNOPSIS
        Copies a file from and to the guest OS of the specified virtual machines using VMware Tools.

        --------------  Example 1 --------------

        C:\PS>Copy-VMGuestFile -Source c:\text.txt -Destination c:\temp\ -VM VM -GuestToLocal -HostUser root -HostPassword pass1 -GuestUser user
        ssword pass2


        Copies the text.txt file from the guest OS system to the local Temp directory.



  • 4.  RE: Copying a file into a guest OS

    Posted Apr 19, 2011 07:28 PM

    Ok great thanks.



  • 5.  RE: Copying a file into a guest OS

    Posted Apr 05, 2011 05:27 PM

    You would in any case have to provide at least the credentials for the OS inside the guest.

    And when you are connected to the vCenter, you also have to provide, afaik, the ESX(i) credentials.