How to rename Hyper-V virtual machines using PowerShell and Hyper-V Manager

Sometimes when you create a Hyper-V virtual machine, you must give it a name and sometimes the naming is incorrect or simply you no longer want to use that name. This article will provide three methods to rename a Hyper-V virtual machine to your liking.

Sometimes when you create a Hyper-V virtual machine, you must give it a name and sometimes the naming is incorrect or simply you no longer want to use that name. This article will provide three methods to rename a Hyper-V virtual machine to your liking.

Change the Hyper-V virtual machine name using the F2 key

The easiest and fastest way to rename Hyper-V virtual machines is to simply use the F2 function key on the keyboard in the Hyper-V Manager.

To do this, launch the Hyper-V Manager by entering Hyper-V into the Start search field and then selecting Hyper-V Manager when it appears as shown below.

How to rename Hyper-V virtual machines using PowerShell and Hyper-V Manager Picture 1How to rename Hyper-V virtual machines using PowerShell and Hyper-V Manager Picture 1

When Hyper-V Manager is opened, just left-click on the virtual machine you want to rename to select. Then press F2 key on the keyboard and the virtual machine name will become an editable field as shown below.

How to rename Hyper-V virtual machines using PowerShell and Hyper-V Manager Picture 2How to rename Hyper-V virtual machines using PowerShell and Hyper-V Manager Picture 2

Now type the new name you want to use for the virtual machine and when done, press Enter on the keyboard. The virtual machine will now use the new name.

How to rename Hyper-V virtual machines using PowerShell and Hyper-V Manager Picture 3How to rename Hyper-V virtual machines using PowerShell and Hyper-V Manager Picture 3

Rename a Hyper-V virtual machine using the Hyper-V Manager Context Menu

To rename a Hyper-V virtual machine using Hyper-V Manager, follow these steps:

1. Launch Hyper-V Manager by typing Hyper-V in the Start search field and then selecting Hyper-V Manager when it appears as shown below.

How to rename Hyper-V virtual machines using PowerShell and Hyper-V Manager Picture 4How to rename Hyper-V virtual machines using PowerShell and Hyper-V Manager Picture 4

2. When the Hyper-V manager opens, find the virtual machine you want to rename and right-click it so that the virtual machine's context menu appears. As you can see in the picture below, there is an option called Rename . If this is the virtual machine you want to rename, click Rename .

How to rename Hyper-V virtual machines using PowerShell and Hyper-V Manager Picture 5How to rename Hyper-V virtual machines using PowerShell and Hyper-V Manager Picture 5

3. The virtual machine name will now become a field you can edit. Just delete the current name and enter the new name you want to use.

How to rename Hyper-V virtual machines using PowerShell and Hyper-V Manager Picture 6How to rename Hyper-V virtual machines using PowerShell and Hyper-V Manager Picture 6

4. When done, press Enter and the virtual machine will use the new name

How to rename Hyper-V virtual machines using PowerShell and Hyper-V Manager Picture 7How to rename Hyper-V virtual machines using PowerShell and Hyper-V Manager Picture 7

You can now close the Hyper-V Manager.

Change the Hyper-V virtual machine name using Powershell

For those who want to rename Hyper-V virtual machines via the command line or through a script, you can use the PowerShell Rename-VM command to rename the virtual machine. To rename the virtual machine using PowerShell, follow these steps:

1. Start PowerShell with administrative rights by clicking the Start button and then selecting Windows PowerShell (Admin) as shown below.

2. When PowerShell opens, you can get the list of installed virtual machines by typing Get-VM and pressing the Enter key on the keyboard. The Get-VM command will give a virtual machine and their names.

How to rename Hyper-V virtual machines using PowerShell and Hyper-V Manager Picture 8How to rename Hyper-V virtual machines using PowerShell and Hyper-V Manager Picture 8

3. To rename a virtual machine, you need to use the Rename-VM command. This command takes two arguments, the name of the virtual machine to rename and then the new name you want to change. It is important to note that when using names containing spaces, you need to put quotation marks around the name. For example, we will rename the Ubuntu virtual machine to Ubuntu Renamed. To do this, enter the following command and press Enter on the keyboard:

 Rename-VM Ubuntu "Ubuntu Renamed" 

How to rename Hyper-V virtual machines using PowerShell and Hyper-V Manager Picture 9How to rename Hyper-V virtual machines using PowerShell and Hyper-V Manager Picture 9

4. When PowerShell renames a virtual machine, it will not display any results. To see if the VM has been renamed, you can issue the Get-VM command.

How to rename Hyper-V virtual machines using PowerShell and Hyper-V Manager Picture 10How to rename Hyper-V virtual machines using PowerShell and Hyper-V Manager Picture 10

5. As you can see the virtual machine has been renamed from Ubuntu to Ubuntu Renamed. Now you can type Exit and press Enter to exit PowerShell.

See more:

  1. Create virtual machines in Hyper-V on Windows Server 2008
  2. Create and configure virtual machines in Hyper-V
  3. Create your own cloud using Hyper-V
4 ★ | 8 Vote