From time to time I find I need to copy a large file to a Virtual Machine running on Hyper-V. Normally copying files is easy when using Enhanced Session Mode — a simple copy and paste is all you need… except when dealing with really large files. This is what you get when you try that:
I ran into this error today when trying to copy a 5.47 GB ISO file, so I thought I’d share a quick tip on copying files using PowerShell Direct, a new feature of Hyper-V available in Windows 10 and Windows Server 2016.
$PSSession = New-Session -VMName SERVER-VM-01 -Credential (Get-Credential)
Copy-Item -ToSession $PSSession -Path C:\Local\Path\Image.iso -Destination C:\Remote\Path
That’s all there is to it!
Source: TechNet Blog Post by Ben Armstrong
Here’s a PowerShell one-liner that will eject/unmount ISO files on all Hyper-V virtual machines on a particular host.
Get-VM | Get-VMDvdDrive | Set-VMDvdDrive -Path $null
The Quest Begins
I trolled the homelab subreddit for a while, discussed options with friends and colleagues, and did a ton of research. I wanted something quiet, reasonably powerful, and expandable. While cost was a factor, it didn’t drive my decisions.
Many folks advocated purchasing older servers from eBay, where the Dell PowerEdge R710 is among the most popular options. It’s true there are really good deals out there for fairly powerful servers at very reasonable prices, but I chose a different route.
Unfortunately, commercial servers are generally pretty loud. I have to keep the server in my home office so I need something that won’t be distractingly loud. I also intend to migrate eight 3.5-inch drives and those older servers won’t accommodate that need.