How to rename a Hyper-V virtual machine using PowerShell & Hyper-V Manager

Sometimes when you create a Hyper-V virtual machine, you may name it with the incorrect name or no longer want to use it. This article will provide three methods to rename a Hyper-V virtual machine so that it uses the name you want.

RENAME YOUR CAMERA HYPER-V WITH F2 KEY

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

To do this, launch Hyper-V Manager by typingHyper-Vin the Start Menu’s search field and then selecting Hyper-V Manager when it appears as shown below.

Once Hyper-V Manager is open, simply left-click on the virtual machine you want to rename so that it is selected. Then pressthe F2 keyon your keyboard and the virtual machine name will become a field you can edit as shown below.

Now type the new name you want to use for the virtual machine and when done pressEnteron your keyboard. The virtual machine will now use the new name.

RENAME OF HYPER-V CAMERA WITH HYPER-V MANAGER’S SCENE MENU

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

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

  2. When the Hyper-V manager opens, find the VM you want to rename and right-click on it so its context menu appears. As you can see from the image below, there is an option namedRename… . If this is the VM you want to rename, click Rename.

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

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

You can now close Hyper-V Manager.

RENAME OF CAMERA HYPER-V WITH POWERSHELL

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

  1. Start PowerShell as administrator by clicking the Start Menu button (

    ) and then select Windows PowerShell (Admin) as shown below.

  2. Once PowerShell opens, you can get a list of installed virtual machines by typingGet-VM and pressing Enter key on your keyboard. Get-VM command will give a virtual machine and their name.

  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 rename it to. It’s important to note that when using a name that contains spaces, you need to put quotes around the name.For example, we will rename the Ubuntu virtual machine to Ubuntu Renamed. To do this, enter the commandRename-VM Ubuntu “Ubuntu Renamed” and press Enteron the keyboard.

    Lệnh đổi tên máy ảo PowerShell

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

  5. As you can see the VM has been renamed from Ubuntu to Ubuntu Rename. Now you can typeExit and press Enterto exit PowerShell.