Gentoo Archives: gentoo-user

From: Michael <confabulate@××××××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Migrating chroot to VM
Date: Thu, 05 Mar 2020 12:07:03
Message-Id: 3289543.iIbC2pHGDl@lenovo.localdomain
In Reply to: [gentoo-user] Migrating chroot to VM by Alessandro Barbieri
1 On Thursday, 5 March 2020 09:54:01 GMT Alessandro Barbieri wrote:
2 > I want to do a crazy thing. I want to migrate my gentoo installation from a
3 > chroot to a VM (both on the same host). The host is debian but I can only
4 > use SSH. What do you suggest to do?
5
6 There are VMWare applications to convert a physical installation of an OS to a
7 VM disk, but since the guest OS is linux, the way I would do it would be:
8
9 1. Create a virtual disk of the desired size.
10 2. Attach a LiveCD to the VM and boot with it.
11 3. Use the LiveCD environment to partition/format/mount the VM disk.
12 4. Use rsync to copy the filesystem contents from the chroot to the VM
13 partitions.
14 5. Edit the copied fstab to correspond to the VM disk partition UUIDs and
15 potentially reinstall GRUB.
16 6. Unmount the VM disk partitions, shutdown the VM, detatch the LiveCD and
17 restart the VM.
18
19 You could use partclone instead of rsync, which would retain the same UUIDs
20 and filesystems as the chrooted system and therefore simplify the migration.
21
22 HTH.

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-user] Migrating chroot to VM "Mickaël Bucas" <mbucas@×××××.com>