Creating a copy of you harddrives for a virtual machine copy
✓ Published0🌍 Public
HHoffmannP
Last edited Dec 12, 2013
Created on Dec 12, 2013
This example shows a shell script that clones a physical computer’s hard drives into a new VirtualBox virtual machine, attaching each raw disk (via `VBoxManage internalcommands createrawvmdk`) as a SATA storage device. It iterates through `/dev/sd?` block devices, creates a `.vmdk` for each, and attaches them to the VM, then adds any ISO images from a specified folder as DVD drives. The script also configures memory, CPUs, and boot order, and finally prints the VM configuration and a command to launch it headless, relying solely on VirtualBox’s command-line API.
AI-generated description