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.

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

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.

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

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.

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

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.

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

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 .

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

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.

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

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

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

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.

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

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" 

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

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.

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

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
Update 26 May 2019
Category

System

Mac OS X

Hardware

Game

Tech info

Technology

Science

Life

Application

Electric

Program

Mobile