All hardware is eventually decommissioned. It may be broken, stolen, or just too old and slow. However, the software on it might still be needed. Not all software is easily transferable to a new PC with the latest OS on it. This quick guide helps you convert the old machine to a virtual machine, so that you can run it in VirtualBox. The process is called physical to virtual (P2V).
This article assumes you are at home in a Linux shell.
- Boot the old hardware from a Ubuntu live CD or USB stick (or any other live cd, for example the gparted cd).
- Prepare copying each file system with the following steps:
- Mount the filesystem
- Remove the contents of /tmp and trashcans in the home directories.
- Clear free space with the following commands:
sudo -s dd if=/dev/zero of=/usr/bigfile; rm -f /usr/bigfile
Here are the two examples of copying the disk
/dev/sda
. The first puts netcat in listen mode on the target:
on target> nc -l 19001 | gzip -d -c | dd of=hd-copy.raw
on source> dd if=/dev/sda | gzip -c --fast | nc [target] 19001
on source> dd if=/dev/sda | gzip -c --fast | nc -l 19001
on target> nc [source] 19001 | gzip -d -c | dd of=hd-copy.raw
Make sure you have a decent network connection, 1 Gbit/s is fine.
VBoxManage convertfromraw hd-copy.raw hd-copy.vdi --variant Standard
VBoxManage modifyhd hd-copy.vdi --compact
References
Chapter 8 of the VirtualBox manual
Another P2V technique which also works in VMWare.
No comments:
Post a Comment