2

I have a freshly installed Hyper-V server on Windows Server 2012R2 standard edition, and a VM inside with same OS version that hosts a domain and some file-based services. The host is NOT the member of the VM's domain, because there are no other servers in the local network, therefore no DCs to use if this one goes down. The host has a removable media attached that's intended to be a backup media. I need to back up files from the VM to that device.

I wonder if there's an ability to retrieve a file from the VM using Hyper-V tools, provided full compatibility on the host.

UPDATE: There is a commandlet Copy-VMFile that suddenly has -FileSource parameter available, but to my dismay this parameter can only accept the value of Host, that is, copying the file is only provided TO the VM, not from it.

3 Answers 3

1

If they are on the same IP Subnet, you can still use UNC Paths to access shares, but you will need to authenticate with the correct domain credentials.

In your case, share the removable media on the host (remember to set share permissions as well as NTFS permissions), then from the guest, navigate to \\IPofHost\RemovableMedia.

You can maintain the link, with saved password from explorer (ScreenShot taken from Windows 10) :-

Mapping Drive

4
  • So, it's still limited to file shares and foreign access. I need a backup to be done as a job, so either plaintext passwords or everyone/read on the share used to access the data from host. I'm going this way but still searching for the proper way to get a file from VM to the host without actually exposing the endpoint to the network.
    – Vesper
    Apr 11, 2017 at 14:55
  • Can you map the drive in explorer using the explorer option? This will store those credentials in the system, rather than in a plaintext Batch file. <- Updated the answer with this.
    – Stese
    Apr 11, 2017 at 15:00
  • IIRC mapping a drive in explorer stored credentials in current user's storage, not in system's. Before the backup job was running interactively (!) from logged in user, this is highly insecure and I have to make it run as system on hypervisor, while having a read connection to file system(s) on VM.
    – Vesper
    Apr 11, 2017 at 15:05
  • have a look at my alternative answer as well... it might be suitable.
    – Stese
    Apr 11, 2017 at 15:25
0

Another solution to backing up a HyperV VM is to use this :-

http://www.altaro.com/vm-backup/

It's free for 1 host and up to 2 Virtual Machines.

I've used it in the past, and it works very well. You can be as selective or not on what it backs up and when.

0

I'm not 100% sure on what you are trying to achieve but wouldn't Windows Server Backup give you everything you need? it will allow you to back up the VM or just the VHDX file from the VM if that's all you need. You can then restore the VHDX file (or the full VM) wherever you need it. Since you are using server 2012 R2 the newly restored VHDX can be mounted locally just by double clicking it then you can access all the files you want from it.

Alternatively if down time is not a problem then you could just shut down the VM, the VHDX can be mounted locally just by double clicking it then you can copy any files from it, after that dismount the VHDX in order to restart the VM.

2
  • I need resources from the VM. Backing up the VM itself is an option, but it's far from being the best, and anyway this backup WILL be performed as well. And downtime is not an option. After all, this solution isn't exactly one-time, the VM in question can be more complex - however I expect I'd have access to better backup devices than a home-grade USB hard drive.
    – Vesper
    Apr 11, 2017 at 16:58
  • The main problem is the policy that says I need to store backups for frikking half a year with daily granulation (thankfully the data corpus isn't too big for them to not fit on 1TB HDD). So I went with backing up that corpus as a single file (archive), and I want that archive to be retrieved from the VM into the USB hard drive.
    – Vesper
    Apr 11, 2017 at 16:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .