From the CMD, type Powershell to get in to the Powershell prompt.


Now we will create a new dynamically expanding Virtual Hard Drive with the new *.vhdx file extension and with a maximum size of 60 GB using:

The next step is to connect the newly created Virtual Hard Drive with the Virtual Machine.

Start the VM:

I prefer to also set up Dynamic Memory for my machine. In order to do this you first need top the machine using:
New-VM -Name DC -MemoryStartupBytes 512MB -Path D:\ws2012.localThis will create a Virtual Machine called DC in D:\ws2012.local with 512 MB memory. Note that a subfolder will be created with the name of the Virtual Machine. So in my case, the Virtual Machine will be placed in D:\ws2012.local\DC .
Now we will create a new dynamically expanding Virtual Hard Drive with the new *.vhdx file extension and with a maximum size of 60 GB using:
New-VHD -Path D:\ws2012.local\DC\DC.vhdx -SizeBytes 60GB -Dynamic
The next step is to connect the newly created Virtual Hard Drive with the Virtual Machine.
Add-VMHardDiskDrive -VMName DC -Path D:\ws2012.local\DC\DC.vhdx"Now you might want to connect an *.iso file for the Windows installation:
Set-VMDvdDrive -VMName DC -ControllerNumber 1 -Path "<path to ISO>
Start the VM:
Start-VM –Name DCView the status of the VM:
Get-VM DC
I prefer to also set up Dynamic Memory for my machine. In order to do this you first need top the machine using:
Stop-VM DCThen run:
Set-VMMemory -VMName DC -DynamicMemoryEnabled $true -StartupBytes 512MB -MinimumByter 512There are of course a lot more settings you can configure, but this will get you up and running. Once you get the hang of Powershell, you won’t be going back to create your machines in the GUI, as this is much faster
0 comments:
Post a Comment