Recently, we wanted to start a Virtual Machine running a Windows installation from a physical hard disk.
sudo dnf install qemu -y;
Configuring our command to start the Virtual Machine from the physical hard drive:
- Our hard disk was identified on the physical machine as
/dev/sdaso we set the
-hdaparameter to that value.
- Then we added the parameter
-boot cto instruct the virtual machine to boot from the first hard disk.
- The default guest start-up
128 MiB, so we set the parameter
-mto 4096 to give to the virtual machine
- Finally we added the
-snapshotparameter which instructed the system to write to temporary files instead of the disk image files (all disk images are considered as read only).
In this case, the raw disk image used are not written back. When sectors are written, they are written in a temporary file created in
You can however force the write back to the raw disk images by using the
commitmonitor command (or
C-a sin the serial console).
In the end our command was as follows:
sudo qemu-kvm -snapshot -m 4096 -boot c -hda /dev/sda;
This post is also available in: Greek