Hi All,
We can create a virtual machine in Hyper V server using the simple commands in powershell.
To create a Virtual machine follow the simple steps
Open the Powershell
type the following in terminal
The syntax for new VM creation is
New-VM -Name -Path -MemorystartupBytes To create new VM
New-VM -Name Testmachine -path C:\vm-machine --MemoryStartupBytes 512MB Note:
MemoryStartupBytes is the RAM for new VM
To create Harddisk for new VM we can use New-VHD command
New-VHD -Path c:\vm-Machine\Testmahcine\Testmachine.vhdx -SizeBytes 10GB -Dynamic To attach virtual hard disk for a Virtual Machine we can use Add-VMHardDiskDrive command
syntax is as follows
Add-VMHardDiskDrive -VMName -PathAdd-VMHardDiskDrive -VMName TestMachine -path "C:\vm-machine\Testmachine\Testmachine.vhdx" We can map the ISO image to virtual machine CD/DVD ROM by
Set-VMDvdDrive -VMName -ControllerNumber 1 -PathWe can start new VM by
Start-VM -NameTo stop VM use the command below
Stop-VM -NameTo check the VM status
use the command below
Get-VMThat's It