Change VM configuration files path.

Doria 1,246 Reputation points
2021-10-07T15:53:09.12+00:00

Hi everyone!

I imported a VM and the virtual machine definitions were in the wrong folder. How can I move these settings to the default path defined in Hyper-V?

138557-sem-titulo.png

System Center Virtual Machine Manager
Windows for business | Windows Client for IT Pros | Storage high availability | Virtualization and Hyper-V
0 comments No comments
{count} votes

Accepted answer
  1. AlexZhu-MSFT 6,591 Reputation points Moderator
    2021-10-08T00:45:00.693+00:00

    Hi,

    (1) shut down the target virtual machine
    (2) setting, note down the vhd file location, for example, S:\sc.com_pxe_client.vhdx
    (3) find out the configuration files and move to new location, for example, S:\alex
    (4) delete the vm from hyper-v manager
    (5) import the vm (register the vm, using the same id)
    (6) locate the vhd location (noted down in step 2)

    screenshots for your reference:

    step 3, copy the 3 files to the new location/default location
    138694-hyper-v-move-vm-01.png

    step 5, import the vm - locate configuration files folder
    138695-hyper-v-move-vm-02.png

    step 5, import the vm - select the vm in the location (we can put multiple configuration files in one location if you like)
    138675-hyper-v-move-vm-03.png

    step 5, import the vm - using same id
    138732-hyper-v-move-vm-04.png

    step 5, import the vm - locate the vhd file
    138655-hyper-v-move-vm-05.png

    Alex
    If the response is helpful, please click "Accept Answer" and upvote it.


1 additional answer

Sort by: Most helpful
  1. Dave Stevenson 81 Reputation points
    2022-04-15T15:36:20.19+00:00

    I don't know whether I did something wrong, but when following these instructions using Hyper-V manager under Windows 10 and referencing a Hyper-V server running Hyper-V 2016, I could not delete the VM. after moving the VM config files - the VM config options in Hyper-V manager were missing. To get this to work, I had to copy (not move!) the machine files back to their previous locations. Then I could delete the VM (and associated, but now redundant) config files.

    I could then Import the VM with the files that I had previously moved.

    So, unless I made a mistake somewhere, I suggest following most of the instructions above, apart from MOVING the config files, COPY them instead

    Hope this helps someone else

    Dave

    p.s., just noticed that there is an inconsistency in the instructions . . . .

    The text at the start says "(3) find out the configuration files and move to new location"

    But the text further down says "step 3, copy the 3 files to the new location/default location"

    i.e., you DO need to COPY the files first

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.