fepitre / qubes-gentoo

This is the official ebuild repository for Qubes OS Gentoo template.
7 stars 10 forks source link

Make a stage4 installation into a qubes vm #27

Open Kalle72 opened 1 month ago

Kalle72 commented 1 month ago

This is more a question then an error...

I have an air-gapped gentoo-machine (holding the data, that is important for me) and I think about to transfer this whole machine into a qubes VM. (I like the qubes-idea.)

Until now, I managed some hardware-changes via a stage4-archive and stage4-installation which works quite well. With this approach it is also possible to transfer a bare-metal gentoo-installation into e.g. a virtualbox-VM an vice versa. One has to do only some minor kernel-adaptions and install the guest-additions and that is all.

So my question is: How to transfer my stage4 to a qubesVM. If I see it right, I have to transfer the "user-data" to an app-VM based on a template-VM. And I have to build a new templateVM with my old installation. (And can then also build other app-VM's based on this template which would be really nice, too.)

So what are the key-points to build a templateVM from an existing bare-metal gentoo (with xfce) installation. What changes are necessary to the kernel, what additional packages do I have to install for seamless qubes integration etc.?

Some hints would be nice ...

Thanks in advance Kalle

fepitre commented 1 month ago

So basically, what you need to do is to import your root filesystem (make a raw image if it's a bare-metal machine) as a HVM (see https://www.qubes-os.org/doc/standalones-and-hvms/#converting-virtualbox-vms-to-qubes-hvms for inspiration). Depending on if you want this machine being a template or not, you will to adapt the type to template or standalone. Then, when you have dumped the rootfs into the root of the HVM, you will need to emerge basically components from this repository (the minimal list is provided here: https://github.com/QubesOS/qubes-builder-gentoo/blob/main/scripts/packages_qubes_minimal.list). Once you have all ready, you can copy your userdata in the AppVM generated based on this new template or directly into the standalone VM if you decided to go this way.