How to copy files from a non-networked virtual machine using PowerCLI
search cancel

How to copy files from a non-networked virtual machine using PowerCLI

book

Article ID: 421428

calendar_today

Updated On:

Products

VMware vSphere ESXi 8.0

Issue/Introduction

This article explains how to copy files from a virtual machine that is not routable or where you are unable to use FTP/SFTP.

Note: The source virtual machine must have VMware Tools installed.

Environment

VMware vSphere PowerCLI

Resolution

To copy of the files from a Non-Networked Virtual Machine, you can use PowerCLI.
 
The syntax is as follows.

PS C:\> Copy-VMGuestFile -GuestToLocal -VM "<VM Name>" -Source "<Source Path>" -Destination "<Destination path>" -GuestUser "<Usaer Name>" -GuestPassword "<Password>"

The following example command copies files from C:\temp\ on the Windows VM Test_VM to the local C:\work\.

EX)
PS C:\>  Copy-VMGuestFile -GuestToLocal -VM "Test_VM" -Source "C:\temp\" -Destination "C:\work\" -GuestUser "Administrator" -GuestPassword "Passwd"

Note: The virtual machine name specified by <VM Name> can be confirmed using the Get-VM command.