The solution I eventually used revolved around creating two virtual disks (borrowing and idea from Alex) to attach to the Settings > Storage > SATA Controller.
I used the VirtualBox
GUI to create a 128M VMDK to contain the MBR and a /dev/sda1
to be the /boot
.
The other VMDK I created earlier from an LVM logical volume became the virtual /dev/sdb
(without partitions).
I loaded a gentoo install ISO into the VM's virtual CDROM (Settings > Storage > IDE Controller) and booted from that. Once the gentoo install environment was up and running I was able to partition /dev/sda
and create the /dev/sda1
/boot
filesystem and copy the kernel and other files from the source host. I did not partition /dev/sdb
because it already contained the root filesystem I had constructed before.
I mounted /dev/sdb
and the /boot
according to Preparing the Disks and rigged some of the virtual filesystems according to Mounting the necessary filesystems. With the filesystems prepared I could chroot and begin to reconfigure the VM to account for the differences between the source machine's disks and the VM's disks.
I had to update /etc/lilo.conf
inside the VM to use boot=/dev/sda
and root=/dev/sdb
.
Likewise /etc/fstab
needed alteration since the source host used a lot of individual partitions (a style that has gone out of favor in the intervening decade) and the VM only had /dev/sdb
for root and /dev/sda1
for /boot
.
I also had to recompile the kernel with support for the ahci
sata module, and the e1000
ethernet. The source machine is very old.
One shortcoming of this process is that I had to partition the virtual sda
inside a running VM. I do not know if there is a process that would allow me to partition the VMDK and fill its partitions with filesystems and data without booting up the VM that uses it.
I am not sure what problems would have arisen if I had attempted to recompile the guest kernel using the host OS and a chroot instead of recompiling inside of a VM (which would have required the use of the gentoo install ISO anyway).
I could not use a Debian live ISO because at some point in the boot process the screen turned into colored stripes of characters. I assume there's some incompatibility with the virtual video card and it was easier to just get gentoo than shovel through all the related discussions about that bug to test all the suggested solutions.