Clone a Windows Server 2022 virtual machine in VirtualBox 6.1.44
Prereqs
- an existing Windows Server 2022 virtual machine
VirtualBox
In this example, the "Current state" equals the "Clean install" snapshot (otherwise it would have been "Current state (Changed)")
Change the name of the virtual machine. Clone type: full clone. Snapshots: current machine state. Be sure to generate new MAC addresses for all network adapters. Look at the screenshot below.
Sysprep
Sysprep is used to remove system-specific information from a Windows installation, such as the computer name and security identifier (SID). This is necessary, if you want to add a cloned Windows machine to a Windows active directory domain.
Boot the newly cloned VM and login. Start Explorer and navigate to "c:\Windows\System32\Sysprep". Right-click on "sysprep" and select "Run as Administrator".
Select "Enter System Out-of-Box Experience (OOBE)" and put a check next to "Generalize". Select "Reboot" as shutdown option.
IP address
Login. Right-click on the network icon on the bottom-right taskbar -> Open Network and Internet settings.
Double-click on "Ethernet", select "Properties", double-click on "Internet Protocol Version 4 (TCP/IPv4)" and configure IP settings.
Computername
Snapshot
Select "Current State" and click "Take". Give a proper name, like "Clean install". A good "Snapshot Description" can be handy!
If you change "something" in this virtual machine, you will get "Current State (changed)". Want to revert those changes? Select "Clean install" and click "Restore". Be sure to remove the checkbox at "Create a snapshot of the current machine state" or you'll end up with another snapshot.