On the Physical Machine

  • Boot the Arch Linux installation CD.
  • Do whatever you need to in order to mount the existing hard drives to /mnt in the live environment. This may mean you need to load the LVM or Software RAID modules and assembling them.
  • Mount the existing disks to /mnt, including any separate partitions such as /home /boot or /var etc. I suggest you use the '-o ro' option to `mount` to mount the partitions read-only and ensure they can not be altered in any way during the migration.
  • Configure the network and make sure it is working (ping your gateway etc)
  • Start SSHD and add 'sshd: ALL' to /etc/hosts.allow
  • Use passwd to set a password for the 'root' user

On the Virtual Box Machine

  • Boot the Arch Linux installation ISO.
  • fdisk and format the hard disk(s) in the Virtual Box instance. It does not need to be the same configuration as the physical machine.
  • Mount the partitions you just created to /mnt
  • Configure the network and make sure it is working (ping your gateway, the physical machine etc)
  • Use the following rsync command to start the migration. Replace with the IP address of the Physical Machine.
# rsync -a --progress root@* /mnt/
  • chroot into the virtual machine hard drive:
# mount -o bind /dev /mnt/dev
# mount -t proc none /mnt/proc
# mount -t sysfs none /mnt/sys
# chroot /mnt /bin/bash
  • If you have a separate /boot partition, you will need to explicitly mount it in the chroot environment.
  • Update /etc/fstab to suit the new partitioning scheme / device names if required.
  • Update /etc/mkinitcpio.conf to use the appropriate HOOKS for the new environment.
  • Rebuild the init image: mkinitcpio -p kernel26
  • Install grub to the MBR of the Virtual Box hard drive, exit the chroot then reboot!
# grub
root (hd0,0)
setup (hd0)
# exit
# sync
# umount -a
# reboot
  • You should have successfully migrated your physical machine to your Virtual Box instance!