On Thursday, 5 March 2020 09:54:01 GMT Alessandro Barbieri wrote:
> I want to do a crazy thing. I want to migrate my gentoo installation from a
> chroot to a VM (both on the same host). The host is debian but I can only
> use SSH. What do you suggest to do?

There are VMWare applications to convert a physical installation of an OS to a 
VM disk, but since the guest OS is linux, the way I would do it would be:

1. Create a virtual disk of the desired size.
2. Attach a LiveCD to the VM and boot with it.
3. Use the LiveCD environment to partition/format/mount the VM disk.
4. Use rsync to copy the filesystem contents from the chroot to the VM 
partitions.
5. Edit the copied fstab to correspond to the VM disk partition UUIDs and 
potentially reinstall GRUB.
6. Unmount the VM disk partitions, shutdown the VM, detatch the LiveCD and 
restart the VM.

You could use partclone instead of rsync, which would retain the same UUIDs 
and filesystems as the chrooted system and therefore simplify the migration.

HTH.

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to